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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: rebase to tot Created 3 years, 10 months 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
Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 237ccc7800a9a39c18aa603224b7e497556aa7d9..f9d37252fce1ad2dfd12e0f6955db38bd798fd77 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -447,8 +447,16 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(Browser* browser,
if (!profile_ && browser)
profile_ = browser->profile();
- if (!browser || !browser->is_type_tabbed())
- browser = new Browser(Browser::CreateParams(profile_));
+ if (!browser || !browser->is_type_tabbed()) {
+ // Startup browsers are not counted as being created by a user_gesture
+ // because of historical accident, even though the startup browser was
+ // created in response to the user clicking on chrome. There was an
+ // incomplete check on whether a user gesture created a window which looked
+ // at the state of the MessageLoop.
+ Browser::CreateParams params = Browser::CreateParams(profile_);
+ params.user_gesture = false;
+ browser = new Browser(params);
+ }
bool first_tab = true;
ProtocolHandlerRegistry* registry = profile_ ?

Powered by Google App Engine
This is Rietveld 408576698