summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 04:39:45 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 04:39:45 +0000
commitd6df2e3959cafedab1d19fce2e312e8b674c34e6 (patch)
tree13f72b2ef171b638679c4646b812f4ee7795f684 /chrome/browser/browser.cc
parentaec0c94c6d5a0cc97254c38d57b97f3d7292ea7e (diff)
downloadchromium_src-d6df2e3959cafedab1d19fce2e312e8b674c34e6.zip
chromium_src-d6df2e3959cafedab1d19fce2e312e8b674c34e6.tar.gz
chromium_src-d6df2e3959cafedab1d19fce2e312e8b674c34e6.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. I now also maintain a fallback to walk the entire registered list of browsers forward if the active scan fails. This is likely only in a testing environment where a Browser may never have been activated. 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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30531 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30659 Review URL: http://codereview.chromium.org/330013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 295beff..60d08c8 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1616,7 +1616,8 @@ void Browser::DuplicateContentsAt(int index) {
} else {
Browser* browser = NULL;
if (type_ & TYPE_APP) {
- browser = Browser::CreateForApp(app_name_, profile_, type_ & TYPE_POPUP);
+ browser = Browser::CreateForApp(app_name_, profile_,
+ !!(type_ & TYPE_POPUP));
} else if (type_ == TYPE_POPUP) {
browser = Browser::CreateForPopup(profile_);
}
@@ -1973,7 +1974,7 @@ void Browser::DetachContents(TabContents* source) {
bool Browser::IsPopup(TabContents* source) {
// A non-tabbed BROWSER is an unconstrained popup.
- return (type() & TYPE_POPUP);
+ return !!(type() & TYPE_POPUP);
}
void Browser::ToolbarSizeChanged(TabContents* source, bool is_animating) {