Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: chrome/browser/browser_navigator.cc

Issue 5238002: Reintegrate 552 r66225-r66645.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552d/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_navigator.h ('k') | chrome/browser/cocoa/content_exceptions_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_navigator.cc
===================================================================
--- chrome/browser/browser_navigator.cc (revision 66837)
+++ chrome/browser/browser_navigator.cc (working copy)
@@ -114,11 +114,28 @@
params->disposition = NEW_FOREGROUND_TAB;
}
- // Disposition trumps add types. ADD_SELECTED is a default, so we need to
- // remove it if disposition implies the tab is going to open in the
- // background.
- if (params->disposition == NEW_BACKGROUND_TAB)
- params->tabstrip_add_types &= ~TabStripModel::ADD_SELECTED;
+ switch (params->disposition) {
+ case NEW_BACKGROUND_TAB:
+ // Disposition trumps add types. ADD_SELECTED is a default, so we need to
+ // remove it if disposition implies the tab is going to open in the
+ // background.
+ params->tabstrip_add_types &= ~TabStripModel::ADD_SELECTED;
+ break;
+
+ case NEW_WINDOW:
+ case NEW_POPUP:
+ // Code that wants to open a new window typically expects it to be shown
+ // automatically.
+ params->show_window = true;
+ // Fall-through.
+ case NEW_FOREGROUND_TAB:
+ case SINGLETON_TAB:
+ params->tabstrip_add_types |= TabStripModel::ADD_SELECTED;
+ break;
+
+ default:
+ break;
+ }
}
// This class makes sure the Browser object held in |params| is made visible
@@ -208,12 +225,19 @@
}
void Navigate(NavigateParams* params, NavigatorDelegate* delegate) {
+ Browser* browser = params->browser;
DCHECK(delegate);
params->browser = GetBrowserForDisposition(params);
if (!params->browser)
return;
// Navigate() must not return early after this point.
+ if (browser != params->browser &&
+ params->browser->tabstrip_model()->empty()) {
+ // A new window has been created. So it needs to be displayed.
+ params->show_window = true;
+ }
+
// Make sure the Browser is shown if params call for it.
ScopedBrowserDisplayer displayer(params);
« no previous file with comments | « chrome/browser/browser_navigator.h ('k') | chrome/browser/cocoa/content_exceptions_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698