Remove last usages of FindTabbedBrowserDeprecated.

BUG=129187
TEST=NONE


Review URL: https://chromiumcodereview.appspot.com/11348344

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171057 0039d316-1c4b-4281-b951-d872f2087c98
parent 499d5bc8
...@@ -171,16 +171,6 @@ _BANNED_CPP_FUNCTIONS = ( ...@@ -171,16 +171,6 @@ _BANNED_CPP_FUNCTIONS = (
True, True,
(), (),
), ),
(
'browser::FindTabbedBrowserDeprecated',
(
'This function is deprecated and we\'re working on removing it. Pass',
'more context to get a Browser*, like a WebContents, window, or session',
'id. Talk to robertshield@ for more information.',
),
True,
(),
),
( (
'RunAllPending()', 'RunAllPending()',
( (
......
...@@ -238,7 +238,7 @@ Browser* CreateBrowserWindow(const Browser::CreateParams& params, ...@@ -238,7 +238,7 @@ Browser* CreateBrowserWindow(const Browser::CreateParams& params,
// The false parameter passed below is to ensure that we find a browser // The false parameter passed below is to ensure that we find a browser
// object matching the profile passed in, instead of the original profile // object matching the profile passed in, instead of the original profile
new_window = browser::FindTabbedBrowser( new_window = browser::FindTabbedBrowser(
profile, false, chrome::GetActiveDesktop()); profile, false, params.host_desktop_type);
if (!new_window) if (!new_window)
new_window = new Browser(params); new_window = new Browser(params);
...@@ -615,6 +615,7 @@ bool CreateWindowFunction::RunImpl() { ...@@ -615,6 +615,7 @@ bool CreateWindowFunction::RunImpl() {
window_profile); window_profile);
} }
create_params.initial_show_state = ui::SHOW_STATE_NORMAL; create_params.initial_show_state = ui::SHOW_STATE_NORMAL;
create_params.host_desktop_type = chrome::GetActiveDesktop();
Browser* new_window = CreateBrowserWindow(create_params, window_profile, Browser* new_window = CreateBrowserWindow(create_params, window_profile,
extension_id); extension_id);
...@@ -997,8 +998,8 @@ bool CreateTabFunction::RunImpl() { ...@@ -997,8 +998,8 @@ bool CreateTabFunction::RunImpl() {
// Ensure the selected browser is tabbed. // Ensure the selected browser is tabbed.
if (!browser->is_type_tabbed() && browser->IsAttemptingToCloseBrowser()) if (!browser->is_type_tabbed() && browser->IsAttemptingToCloseBrowser())
browser = browser::FindTabbedBrowserDeprecated(profile(), browser = browser::FindTabbedBrowser(profile(), include_incognito(),
include_incognito()); browser->host_desktop_type());
if (!browser || !browser->window()) if (!browser || !browser->window())
return false; return false;
...@@ -1064,9 +1065,12 @@ bool CreateTabFunction::RunImpl() { ...@@ -1064,9 +1065,12 @@ bool CreateTabFunction::RunImpl() {
!GetExtension()->incognito_split_mode() && !GetExtension()->incognito_split_mode() &&
browser->profile()->IsOffTheRecord()) { browser->profile()->IsOffTheRecord()) {
Profile* profile = browser->profile()->GetOriginalProfile(); Profile* profile = browser->profile()->GetOriginalProfile();
browser = browser::FindTabbedBrowserDeprecated(profile, false); chrome::HostDesktopType desktop_type = browser->host_desktop_type();
browser = browser::FindTabbedBrowser(profile, false, desktop_type);
if (!browser) { if (!browser) {
browser = new Browser(Browser::CreateParams(profile)); browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED,
profile, desktop_type));
browser->window()->Show(); browser->window()->Show();
} }
} }
......
...@@ -187,7 +187,9 @@ void ExtensionInstallUIDefault::ShowThemeInfoBar( ...@@ -187,7 +187,9 @@ void ExtensionInstallUIDefault::ShowThemeInfoBar(
return; return;
// Get last active tabbed browser of profile. // Get last active tabbed browser of profile.
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, true); Browser* browser = browser::FindTabbedBrowser(profile,
true,
chrome::GetActiveDesktop());
if (!browser) if (!browser)
return; return;
......
...@@ -231,7 +231,9 @@ void ExtensionTabUtil::CreateTab(WebContents* web_contents, ...@@ -231,7 +231,9 @@ void ExtensionTabUtil::CreateTab(WebContents* web_contents,
bool user_gesture) { bool user_gesture) {
Profile* profile = Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext()); Profile::FromBrowserContext(web_contents->GetBrowserContext());
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, false); Browser* browser = browser::FindTabbedBrowser(profile,
false,
chrome::GetActiveDesktop());
const bool browser_created = !browser; const bool browser_created = !browser;
if (!browser) if (!browser)
browser = new Browser(Browser::CreateParams(profile)); browser = new Browser(Browser::CreateParams(profile));
......
...@@ -127,12 +127,6 @@ size_t GetBrowserCountImpl(Profile* profile, ...@@ -127,12 +127,6 @@ size_t GetBrowserCountImpl(Profile* profile,
namespace browser { namespace browser {
Browser* FindTabbedBrowserDeprecated(Profile* profile,
bool match_original_profiles) {
return FindTabbedBrowser(profile, match_original_profiles,
chrome::HOST_DESKTOP_TYPE_NATIVE);
}
Browser* FindTabbedBrowser(Profile* profile, Browser* FindTabbedBrowser(Profile* profile,
bool match_original_profiles, bool match_original_profiles,
chrome::HostDesktopType type) { chrome::HostDesktopType type) {
......
...@@ -18,10 +18,6 @@ class WebContents; ...@@ -18,10 +18,6 @@ class WebContents;
namespace browser { namespace browser {
// Deprecated: Use FindTabbedBrowser() instead and pass in a desktop context.
Browser* FindTabbedBrowserDeprecated(Profile* profile,
bool match_original_profiles);
// Retrieve the last active tabbed browser with a profile matching |profile|. // Retrieve the last active tabbed browser with a profile matching |profile|.
// If |match_original_profiles| is true, matching is done based on the // If |match_original_profiles| is true, matching is done based on the
// original profile, eg profile->GetOriginalProfile() == // original profile, eg profile->GetOriginalProfile() ==
......
...@@ -94,6 +94,7 @@ WebContents* OpenApplicationWindow( ...@@ -94,6 +94,7 @@ WebContents* OpenApplicationWindow(
Browser::CreateParams params(type, profile); Browser::CreateParams params(type, profile);
params.app_name = app_name; params.app_name = app_name;
params.initial_bounds = window_bounds; params.initial_bounds = window_bounds;
params.host_desktop_type = chrome::GetActiveDesktop();
#if defined(USE_ASH) #if defined(USE_ASH)
if (extension && if (extension &&
...@@ -143,11 +144,15 @@ WebContents* OpenApplicationTab(Profile* profile, ...@@ -143,11 +144,15 @@ WebContents* OpenApplicationTab(Profile* profile,
const Extension* extension, const Extension* extension,
const GURL& override_url, const GURL& override_url,
WindowOpenDisposition disposition) { WindowOpenDisposition disposition) {
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, false); Browser* browser = browser::FindTabbedBrowser(profile,
false,
chrome::GetActiveDesktop());
WebContents* contents = NULL; WebContents* contents = NULL;
if (!browser) { if (!browser) {
// No browser for this profile, need to open a new one. // No browser for this profile, need to open a new one.
browser = new Browser(Browser::CreateParams(profile)); browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED,
profile,
chrome::GetActiveDesktop()));
browser->window()->Show(); browser->window()->Show();
// There's no current tab in this browser window, so add a new one. // There's no current tab in this browser window, so add a new one.
disposition = NEW_FOREGROUND_TAB; disposition = NEW_FOREGROUND_TAB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment