diff options
-rw-r--r-- | PRESUBMIT.py | 10 | ||||
-rw-r--r-- | chrome/browser/extensions/api/tabs/tabs.cc | 14 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_install_ui_default.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_tab_util.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/browser_finder.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/browser_finder.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/extensions/application_launch.cc | 9 |
7 files changed, 22 insertions, 29 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 3b8669a..0bb6e3d 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -172,16 +172,6 @@ _BANNED_CPP_FUNCTIONS = ( (), ), ( - '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()', ( 'This function is deprecated and we\'re working on removing it. Rename', diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc index 3b92c40..724f487 100644 --- a/chrome/browser/extensions/api/tabs/tabs.cc +++ b/chrome/browser/extensions/api/tabs/tabs.cc @@ -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(); } } diff --git a/chrome/browser/extensions/extension_install_ui_default.cc b/chrome/browser/extensions/extension_install_ui_default.cc index a058ea6..a63eff6 100644 --- a/chrome/browser/extensions/extension_install_ui_default.cc +++ b/chrome/browser/extensions/extension_install_ui_default.cc @@ -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; diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc index 729deb5..2693447 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc @@ -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)); diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc index 859fb11..f14202e 100644 --- a/chrome/browser/ui/browser_finder.cc +++ b/chrome/browser/ui/browser_finder.cc @@ -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) { diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h index 5bc3ffc..25f2020 100644 --- a/chrome/browser/ui/browser_finder.h +++ b/chrome/browser/ui/browser_finder.h @@ -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() == diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc index 45d5b79..353b4ec 100644 --- a/chrome/browser/ui/extensions/application_launch.cc +++ b/chrome/browser/ui/extensions/application_launch.cc @@ -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; |