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

Unified Diff: chrome/browser/ui/browser_commands.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/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index dd93505cd82f822fd6c504f05916dc51bee71aa6..5beb96d4528bc759e3636e28ff4731f8ff23efd9 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -234,7 +234,7 @@ WebContents* GetTabAndRevertIfNecessary(Browser* browser,
case WindowOpenDisposition::NEW_WINDOW: {
WebContents* new_tab = current_tab->Clone();
Browser* new_browser =
- new Browser(Browser::CreateParams(browser->profile()));
+ new Browser(Browser::CreateParams(browser->profile(), true));
new_browser->tab_strip_model()->AddWebContents(
new_tab, -1, ui::PAGE_TRANSITION_LINK,
TabStripModel::ADD_ACTIVE);
@@ -393,7 +393,7 @@ void NewEmptyWindow(Profile* profile) {
Browser* OpenEmptyWindow(Profile* profile) {
Browser* browser =
- new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile));
+ new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile, true));
AddTabAt(browser, GURL(), -1, true);
browser->window()->Show();
return browser;
@@ -705,10 +705,10 @@ WebContents* DuplicateTabAt(Browser* browser, int index) {
if (browser->is_app() && !browser->is_type_popup()) {
new_browser = new Browser(Browser::CreateParams::CreateForApp(
browser->app_name(), browser->is_trusted_source(), gfx::Rect(),
- browser->profile()));
+ browser->profile(), true));
} else {
new_browser = new Browser(
- Browser::CreateParams(browser->type(), browser->profile()));
+ Browser::CreateParams(browser->type(), browser->profile(), true));
}
// Preserve the size of the original window. The new window has already
// been given an offset by the OS, so we shouldn't copy the old bounds.
@@ -748,7 +748,7 @@ void ConvertPopupToTabbedBrowser(Browser* browser) {
TabStripModel* tab_strip = browser->tab_strip_model();
WebContents* contents =
tab_strip->DetachWebContentsAt(tab_strip->active_index());
- Browser* b = new Browser(Browser::CreateParams(browser->profile()));
+ Browser* b = new Browser(Browser::CreateParams(browser->profile(), true));
b->tab_strip_model()->AppendWebContents(contents, true);
b->window()->Show();
}
@@ -1265,7 +1265,7 @@ void ViewSource(Browser* browser,
add_types);
} else {
Browser* b = new Browser(
- Browser::CreateParams(Browser::TYPE_TABBED, browser->profile()));
+ Browser::CreateParams(Browser::TYPE_TABBED, browser->profile(), true));
// Preserve the size of the original window. The new window has already
// been given an offset by the OS, so we shouldn't copy the old bounds.
@@ -1336,7 +1336,8 @@ void ConvertTabToAppWindow(Browser* browser,
browser->tab_strip_model()->DetachWebContentsAt(index);
Browser* app_browser = new Browser(Browser::CreateParams::CreateForApp(
- app_name, true /* trusted_source */, gfx::Rect(), browser->profile()));
+ app_name, true /* trusted_source */, gfx::Rect(), browser->profile(),
+ true));
app_browser->tab_strip_model()->AppendWebContents(contents, true);
contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
« no previous file with comments | « chrome/browser/ui/browser_command_controller_unittest.cc ('k') | chrome/browser/ui/browser_finder_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698