diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 23:28:10 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 23:28:10 +0000 |
commit | 38409b83ae4f9c25b6c87d9b035f5eb4c1ae3214 (patch) | |
tree | 7582f9fd65104a42de74aa73a844cb16a5c9d8cf /chrome/browser/browser_list.h | |
parent | 4a87dcd3b5bc959f4be9e10e747b51120aa81b91 (diff) | |
download | chromium_src-38409b83ae4f9c25b6c87d9b035f5eb4c1ae3214.zip chromium_src-38409b83ae4f9c25b6c87d9b035f5eb4c1ae3214.tar.gz chromium_src-38409b83ae4f9c25b6c87d9b035f5eb4c1ae3214.tar.bz2 |
Rework the way the FindBrowserWithProfile/Type methods work.
We now always walk the last active list backwards rather than consulting the last active then walking the registered browser list forwards.
This ensures that when the last active browser is a popup or app frame the last active TYPE_NORMAL browser is located when opening a new tab.
http://crbug.com/17498
TEST=Open an app frame. Open a browser window (Ctrl+N) and load a page. Minimize it. Open another browser window and minimize it. Activate the app frame. Press Ctrl+T. The second browser window should be restored and have a new tab added to it rather than the first.
Review URL: http://codereview.chromium.org/330013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_list.h')
-rw-r--r-- | chrome/browser/browser_list.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h index b510b8c..45a0246 100644 --- a/chrome/browser/browser_list.h +++ b/chrome/browser/browser_list.h @@ -58,14 +58,14 @@ class BrowserList { // open browser owned by |profile| is returned. If none exist, returns NULL. static Browser* GetLastActiveWithProfile(Profile *profile); - // Find an existing browser window with the provided type. If the last active - // has the right type, it is returned. Otherwise, the next available browser - // is returned. Returns NULL if no such browser currently exists. + // Find an existing browser window with the provided type. Searches in the + // order of last activation. Only browsers that have been active can be + // returned. Returns NULL if no such browser currently exists. static Browser* FindBrowserWithType(Profile* p, Browser::Type t); - // Find an existing browser window with the provided profile. If the last - // active has the right profile, it is returned. Returns NULL if no such - // browser currently exists. + // Find an existing browser window with the provided profile. Searches in the + // order of last activation. Only browsers that have been active can be + // returned. Returns NULL if no such browser currently exists. static Browser* FindBrowserWithProfile(Profile* p); // Find an existing browser with the provided ID. Returns NULL if no such |