| Index: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
|
| diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
|
| index 9affdd52f3a60d1a430e785fef89f68d2043e72a..f2e30719c288484c4770dd588f73b7a331a9bd82 100644
|
| --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
|
| +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
|
| @@ -32,7 +32,6 @@
|
| #include "chrome/browser/ui/browser_list.h"
|
| #include "chrome/browser/ui/browser_list_observer.h"
|
| #include "chrome/browser/ui/browser_window.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/tab_strip_model.h"
|
| @@ -243,7 +242,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenURLsPopup) {
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run);
|
| // This should create a new window, but re-use the profile from |popup|. If
|
| // it used a NULL or invalid profile, it would crash.
|
| - launch.OpenURLsInBrowser(popup, false, urls, chrome::GetActiveDesktop());
|
| + launch.OpenURLsInBrowser(popup, false, urls);
|
| ASSERT_NE(popup, observer.added_browser_);
|
| BrowserList::RemoveObserver(&observer);
|
| }
|
| @@ -264,7 +263,6 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
| urls.push_back(embedded_test_server()->GetURL("/title2.html"));
|
|
|
| Profile* profile = browser()->profile();
|
| - chrome::HostDesktopType host_desktop_type = browser()->host_desktop_type();
|
|
|
| // Set the startup preference to open these URLs.
|
| SessionStartupPref pref(SessionStartupPref::URLS);
|
| @@ -283,8 +281,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
| chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
|
| {
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run);
|
| - ASSERT_TRUE(
|
| - launch.Launch(profile, std::vector<GURL>(), false, host_desktop_type));
|
| + ASSERT_TRUE(launch.Launch(profile, std::vector<GURL>(), false));
|
| }
|
|
|
| // This should have created a new browser window. |browser()| is still
|
| @@ -321,8 +318,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
|
|
| {
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run);
|
| - ASSERT_TRUE(launch.Launch(profile, std::vector<GURL>(), false,
|
| - host_desktop_type));
|
| + ASSERT_TRUE(launch.Launch(profile, std::vector<GURL>(), false));
|
| }
|
|
|
| // Find the new browser and ensure that it has only the specified URLs this
|
| @@ -363,8 +359,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
| chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
|
| {
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(
|
| + launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
| }
|
|
|
| // This should have created a new browser window.
|
| @@ -393,8 +389,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
|
|
| {
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(),
|
| - false, browser()->host_desktop_type()));
|
| + ASSERT_TRUE(
|
| + launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
| }
|
|
|
| // Find the new browser and ensure that it has only the one tab this time.
|
| @@ -418,8 +414,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutNoPref) {
|
| chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
|
| chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
|
| StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // No pref was set, so the app should have opened in a tab in a new window.
|
| // The launch should have created a new browser.
|
| @@ -445,8 +440,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutWindowPref) {
|
| chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
|
| chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
|
| StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // Pref was set to open in a window, so the app should have opened in a
|
| // window. The launch should have created a new browser. Find the new
|
| @@ -476,8 +470,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutTabPref) {
|
| chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
|
| chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
|
| StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // When an app shortcut is open and the pref indicates a tab should
|
| // open, the tab is open in a new browser window. Expect a new window.
|
| @@ -542,8 +535,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, MAYBE_AddFirstRunTab) {
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -580,8 +572,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, MAYBE_AddCustomFirstRunTab) {
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -605,8 +596,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoNoWelcomePage) {
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -640,8 +630,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoWithWelcomePage) {
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -682,8 +671,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoWithFirstRunTabs) {
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -716,8 +704,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1245,8 +1232,7 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserBrowserCreatorTest,
|
| content::WindowedNotificationObserver observer(
|
| content::NOTIFICATION_LOAD_STOP,
|
| content::NotificationService::AllSources());
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1334,8 +1320,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1384,8 +1369,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1429,8 +1413,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1477,8 +1460,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1527,8 +1509,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1577,8 +1558,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1625,8 +1605,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
| @@ -1687,8 +1666,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest,
|
| base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
|
| StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
|
| chrome::startup::IS_FIRST_RUN);
|
| - ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true,
|
| - browser()->host_desktop_type()));
|
| + ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true));
|
|
|
| // This should have created a new browser window.
|
| Browser* new_browser = FindOneOtherBrowser(browser());
|
|
|