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

Side by Side Diff: chrome/browser/ui/browser_live_tab_context.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_live_tab_context.h" 5 #include "chrome/browser/ui/browser_live_tab_context.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_commands.h" 8 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_tabrestore.h" 10 #include "chrome/browser/ui/browser_tabrestore.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void BrowserLiveTabContext::CloseTab() { 101 void BrowserLiveTabContext::CloseTab() {
102 chrome::CloseTab(browser_); 102 chrome::CloseTab(browser_);
103 } 103 }
104 104
105 // static 105 // static
106 sessions::LiveTabContext* BrowserLiveTabContext::Create( 106 sessions::LiveTabContext* BrowserLiveTabContext::Create(
107 Profile* profile, 107 Profile* profile,
108 const std::string& app_name) { 108 const std::string& app_name) {
109 Browser* browser; 109 Browser* browser;
110 if (app_name.empty()) { 110 if (app_name.empty()) {
111 browser = new Browser(Browser::CreateParams(profile)); 111 browser = new Browser(Browser::CreateParams(profile, true));
112 } else { 112 } else {
113 // Only trusted app popup windows should ever be restored. 113 // Only trusted app popup windows should ever be restored.
114 browser = new Browser(Browser::CreateParams::CreateForApp( 114 browser = new Browser(Browser::CreateParams::CreateForApp(
115 app_name, true /* trusted_source */, gfx::Rect(), profile)); 115 app_name, true /* trusted_source */, gfx::Rect(), profile, true));
116 } 116 }
117 if (browser) 117 if (browser)
118 return browser->live_tab_context(); 118 return browser->live_tab_context();
119 else 119 else
120 return NULL; 120 return NULL;
121 } 121 }
122 122
123 // static 123 // static
124 sessions::LiveTabContext* BrowserLiveTabContext::FindContextForWebContents( 124 sessions::LiveTabContext* BrowserLiveTabContext::FindContextForWebContents(
125 const WebContents* contents) { 125 const WebContents* contents) {
126 Browser* browser = chrome::FindBrowserWithWebContents(contents); 126 Browser* browser = chrome::FindBrowserWithWebContents(contents);
127 return browser ? browser->live_tab_context() : nullptr; 127 return browser ? browser->live_tab_context() : nullptr;
128 } 128 }
129 129
130 // static 130 // static
131 sessions::LiveTabContext* BrowserLiveTabContext::FindContextWithID( 131 sessions::LiveTabContext* BrowserLiveTabContext::FindContextWithID(
132 SessionID::id_type desired_id) { 132 SessionID::id_type desired_id) {
133 Browser* browser = chrome::FindBrowserWithID(desired_id); 133 Browser* browser = chrome::FindBrowserWithID(desired_id);
134 return browser ? browser->live_tab_context() : nullptr; 134 return browser ? browser->live_tab_context() : nullptr;
135 } 135 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_instant_controller_unittest.cc ('k') | chrome/browser/ui/browser_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698