diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 22:44:31 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 22:44:31 +0000 |
commit | 62b0b53d2faff1ff658359e00b9fe8c1c7137d25 (patch) | |
tree | b69dd47875f8837956f0af70ee65307c8d1412e3 /chrome/browser/browser.cc | |
parent | b931f02fb3474485bd69140c6710fb9a80f4e14d (diff) | |
download | chromium_src-62b0b53d2faff1ff658359e00b9fe8c1c7137d25.zip chromium_src-62b0b53d2faff1ff658359e00b9fe8c1c7137d25.tar.gz chromium_src-62b0b53d2faff1ff658359e00b9fe8c1c7137d25.tar.bz2 |
Fix the logic in extensions GetCurrentWindow:
- We try to find an associated window for the calling extension page.
- If there is none (bg pages), fallback to the topmost browser window.
- If the extension is enabled in incognito, include incognito windows in the
search for "topmost".
This fixes a bug where clicking a browser action in an incognito window might open a tab in a normal window, which is confusing.
BUG=39113
Review URL: http://codereview.chromium.org/1422001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 2f80049..48cb020 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -355,8 +355,7 @@ void Browser::OpenWindowWithRestoredTabs(Profile* profile) { void Browser::OpenURLOffTheRecord(Profile* profile, const GURL& url) { Profile* off_the_record_profile = profile->GetOffTheRecordProfile(); Browser* browser = BrowserList::FindBrowserWithType( - off_the_record_profile, - TYPE_NORMAL); + off_the_record_profile, TYPE_NORMAL, false); if (!browser) browser = Browser::Create(off_the_record_profile); // TODO(eroman): should we have referrer here? @@ -3214,7 +3213,8 @@ bool Browser::CanCloseWithInProgressDownloads() { // static Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) { - Browser* browser = BrowserList::FindBrowserWithType(profile, TYPE_NORMAL); + Browser* browser = BrowserList::FindBrowserWithType(profile, TYPE_NORMAL, + false); if (!browser) browser = Browser::Create(profile); return browser; |