diff options
Diffstat (limited to 'chrome/browser/ui')
8 files changed, 22 insertions, 16 deletions
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index 9f7c6f03..89bea69 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc @@ -29,6 +29,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/extensions/shell_window.h" +#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -546,7 +547,7 @@ IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, LaunchMaximized) { content::WindowedNotificationObserver open_observer( chrome::NOTIFICATION_BROWSER_WINDOW_READY, content::NotificationService::AllSources()); - chrome::NewEmptyWindow(browser()->profile()); + chrome::NewEmptyWindow(browser()->profile(), chrome::HOST_DESKTOP_TYPE_ASH); open_observer.Wait(); Browser* browser2 = content::Source<Browser>(open_observer.source()).ptr(); aura::Window* window2 = browser2->window()->GetNativeWindow(); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc index 6a87f6a..f8de36a 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc @@ -658,7 +658,8 @@ void ChromeLauncherControllerPerApp::CreateNewWindow() { } void ChromeLauncherControllerPerApp::CreateNewIncognitoWindow() { - chrome::NewEmptyWindow(GetProfileForNewWindows()->GetOffTheRecordProfile()); + chrome::NewEmptyWindow(GetProfileForNewWindows()->GetOffTheRecordProfile(), + chrome::HOST_DESKTOP_TYPE_ASH); } bool ChromeLauncherControllerPerApp::CanPin() const { diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc index f4eba24..9c2620f 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc @@ -28,6 +28,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/extensions/shell_window.h" +#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -549,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, LaunchMaximized) { content::WindowedNotificationObserver open_observer( chrome::NOTIFICATION_BROWSER_WINDOW_READY, content::NotificationService::AllSources()); - chrome::NewEmptyWindow(browser()->profile()); + chrome::NewEmptyWindow(browser()->profile(), chrome::HOST_DESKTOP_TYPE_ASH); open_observer.Wait(); Browser* browser2 = content::Source<Browser>(open_observer.source()).ptr(); aura::Window* window2 = browser2->window()->GetNativeWindow(); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc index 2d911eb..b21698b 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc @@ -36,6 +36,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/extensions/extension_enable_flow.h" +#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/chrome_notification_types.h" @@ -684,7 +685,8 @@ void ChromeLauncherControllerPerBrowser::CreateNewWindow() { } void ChromeLauncherControllerPerBrowser::CreateNewIncognitoWindow() { - chrome::NewEmptyWindow(GetProfileForNewWindows()->GetOffTheRecordProfile()); + chrome::NewEmptyWindow(GetProfileForNewWindows()->GetOffTheRecordProfile(), + chrome::HOST_DESKTOP_TYPE_ASH); } bool ChromeLauncherControllerPerBrowser::CanPin() const { diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 212a54a..56e4de2 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -38,6 +38,7 @@ #include "chrome/browser/ui/browser_ui_prefs.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/extensions/application_launch.h" +#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/startup/startup_browser_creator.h" #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" #include "chrome/browser/ui/tabs/pinned_tab_codec.h" @@ -487,7 +488,8 @@ IN_PROC_BROWSER_TEST_F(BeforeUnloadAtQuitWithTwoWindows, // Open a second browser window at about:blank. ui_test_utils::BrowserAddedObserver browser_added_observer; - chrome::NewEmptyWindow(browser()->profile()); + chrome::NewEmptyWindow(browser()->profile(), + chrome::HOST_DESKTOP_TYPE_NATIVE); Browser* second_window = browser_added_observer.WaitForSingleNewBrowser(); ui_test_utils::NavigateToURL(second_window, GURL("about:blank")); @@ -1722,7 +1724,7 @@ IN_PROC_BROWSER_TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) { EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); ui_test_utils::BrowserAddedObserver browser_added_observer; - chrome::NewEmptyWindow(profile); + chrome::NewEmptyWindow(profile, chrome::HOST_DESKTOP_TYPE_NATIVE); browser_added_observer.WaitForSingleNewBrowser(); EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 3c5dac2..884e0cf 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -292,7 +292,9 @@ void NewEmptyWindow(Profile* profile, HostDesktopType desktop_type) { } } -void NewEmptyWindow(Profile* profile) { +// TODO(gab): This method is deprecated and will be removed shortly. Please use +// the new version of the NewEmptyWindow call. +void NewEmptyWindowDeprecated(Profile* profile) { NewEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); } @@ -308,10 +310,6 @@ Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) { return browser; } -Browser* OpenEmptyWindow(Profile* profile) { - return OpenEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); -} - void OpenWindowWithRestoredTabs(Profile* profile, HostDesktopType host_desktop_type) { TabRestoreService* service = TabRestoreServiceFactory::GetForProfile(profile); @@ -449,11 +447,13 @@ void Stop(Browser* browser) { #if !defined(OS_WIN) void NewWindow(Browser* browser) { - NewEmptyWindow(browser->profile()->GetOriginalProfile()); + NewEmptyWindow(browser->profile()->GetOriginalProfile(), + browser->host_desktop_type()); } void NewIncognitoWindow(Browser* browser) { - NewEmptyWindow(browser->profile()->GetOffTheRecordProfile()); + NewEmptyWindow(browser->profile()->GetOffTheRecordProfile(), + browser->host_desktop_type()); } #endif // OS_WIN diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h index 3153e64..b5b56c5 100644 --- a/chrome/browser/ui/browser_commands.h +++ b/chrome/browser/ui/browser_commands.h @@ -40,12 +40,11 @@ void RemoveCommandObserver(Browser*, int command, CommandObserver* observer); int GetContentRestrictions(const Browser* browser); // Opens a new window with the default blank tab. -void NewEmptyWindow(Profile* profile); +void NewEmptyWindowDeprecated(Profile* profile); void NewEmptyWindow(Profile* profile, HostDesktopType desktop_type); // Opens a new window with the default blank tab. This bypasses metrics and // various internal bookkeeping; NewEmptyWindow (above) is preferred. -Browser* OpenEmptyWindow(Profile* profile); Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type); // Opens a new window with the tabs from |profile|'s TabRestoreService. diff --git a/chrome/browser/ui/browser_win.cc b/chrome/browser/ui/browser_win.cc index 5c477f9..db2316f 100644 --- a/chrome/browser/ui/browser_win.cc +++ b/chrome/browser/ui/browser_win.cc @@ -30,7 +30,7 @@ void NewWindowMaybeMetro(Browser* source_browser, Profile* profile) { host_desktop_type); if (!browser) { - chrome::OpenEmptyWindow(profile); + chrome::OpenEmptyWindow(profile, host_desktop_type); return; } |