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 = (
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()',
(
......
......@@ -238,7 +238,7 @@ Browser* CreateBrowserWindow(const Browser::CreateParams& params,
// The false parameter passed below is to ensure that we find a browser
// object matching the profile passed in, instead of the original profile
new_window = browser::FindTabbedBrowser(
profile, false, chrome::GetActiveDesktop());
profile, false, params.host_desktop_type);
if (!new_window)
new_window = new Browser(params);
......@@ -615,6 +615,7 @@ bool CreateWindowFunction::RunImpl() {
window_profile);
}
create_params.initial_show_state = ui::SHOW_STATE_NORMAL;
create_params.host_desktop_type = chrome::GetActiveDesktop();
Browser* new_window = CreateBrowserWindow(create_params, window_profile,
extension_id);
......@@ -997,8 +998,8 @@ bool CreateTabFunction::RunImpl() {
// Ensure the selected browser is tabbed.
if (!browser->is_type_tabbed() && browser->IsAttemptingToCloseBrowser())
browser = browser::FindTabbedBrowserDeprecated(profile(),
include_incognito());
browser = browser::FindTabbedBrowser(profile(), include_incognito(),
browser->host_desktop_type());
if (!browser || !browser->window())
return false;
......@@ -1064,9 +1065,12 @@ bool CreateTabFunction::RunImpl() {
!GetExtension()->incognito_split_mode() &&
browser->profile()->IsOffTheRecord()) {
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) {
browser = new Browser(Browser::CreateParams(profile));
browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED,
profile, desktop_type));
browser->window()->Show();
}
}
......
......@@ -187,7 +187,9 @@ void ExtensionInstallUIDefault::ShowThemeInfoBar(
return;
// Get last active tabbed browser of profile.
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, true);
Browser* browser = browser::FindTabbedBrowser(profile,
true,
chrome::GetActiveDesktop());
if (!browser)
return;
......
......@@ -231,7 +231,9 @@ void ExtensionTabUtil::CreateTab(WebContents* web_contents,
bool user_gesture) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, false);
Browser* browser = browser::FindTabbedBrowser(profile,
false,
chrome::GetActiveDesktop());
const bool browser_created = !browser;
if (!browser)
browser = new Browser(Browser::CreateParams(profile));
......
......@@ -127,12 +127,6 @@ size_t GetBrowserCountImpl(Profile* profile,
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,
bool match_original_profiles,
chrome::HostDesktopType type) {
......
......@@ -18,10 +18,6 @@ class WebContents;
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|.
// If |match_original_profiles| is true, matching is done based on the
// original profile, eg profile->GetOriginalProfile() ==
......
......@@ -94,6 +94,7 @@ WebContents* OpenApplicationWindow(
Browser::CreateParams params(type, profile);
params.app_name = app_name;
params.initial_bounds = window_bounds;
params.host_desktop_type = chrome::GetActiveDesktop();
#if defined(USE_ASH)
if (extension &&
......@@ -143,11 +144,15 @@ WebContents* OpenApplicationTab(Profile* profile,
const Extension* extension,
const GURL& override_url,
WindowOpenDisposition disposition) {
Browser* browser = browser::FindTabbedBrowserDeprecated(profile, false);
Browser* browser = browser::FindTabbedBrowser(profile,
false,
chrome::GetActiveDesktop());
WebContents* contents = NULL;
if (!browser) {
// 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();
// There's no current tab in this browser window, so add a new one.
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