Only use Browser::TYPE_NORMAL as the last-chance GetCurrentBrowser for Extension functions.
It was previously accepting any browser type. This was problematic, in particular if the last active browser was a DEVTOOLS window.
BUG=49111
TEST=Verify bug is no longer reproducible
Review URL: http://codereview.chromium.org/3113010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55980 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 752f886..e2c30c4 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -390,7 +390,7 @@
if (!include_incognito)
profile = profile->GetOriginalProfile();
- browser = BrowserList::FindBrowserWithType(profile, Browser::TYPE_ANY,
+ browser = BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL,
include_incognito);
// NOTE(rafaelw): This can return NULL in some circumstances. In particular,