diff options
-rw-r--r-- | chrome/browser/browser_init.cc | 21 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 13 |
2 files changed, 21 insertions, 13 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index fdb85ea..3f3906f 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -436,6 +436,27 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile, browser = BrowserList::GetLastActive(); OpenURLsInBrowser(browser, process_startup, urls_to_open); } +#if defined(OS_LINUX) + // TODO(port): Remove ifdef when the Linux splash page is not needed. + const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); + // This can mess up UI tests, so only do it when UI tests aren't running. + if (!parsed_command_line.HasSwitch(switches::kHomePage)) { + Browser* browser = BrowserList::GetLastActive(); + // Only show the splash page if it isn't already showing. + bool open_splash = true; + for (int i = 0; i < browser->tab_count(); ++i) { + if (browser->GetTabContentsAt(i)->GetURL().spec() == + "about:linux-splash") { + open_splash = false; + } + } + + if (open_splash) { + browser->OpenURL(GURL("about:linux-splash"), GURL(), + NEW_FOREGROUND_TAB, PageTransition::START_PAGE); + } + } +#endif // Check whether we are the default browser. if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) CheckDefaultBrowser(profile); diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index d03a8d4..aef62de 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -71,8 +71,6 @@ #if defined(OS_LINUX) #include "chrome/app/breakpad_linux.h" -// TODO(estade): remove this when the linux splash is removed. -#include "chrome/browser/session_startup_pref.h" #endif // TODO(port): several win-only methods have been pulled out of this, but @@ -536,17 +534,6 @@ int BrowserMain(const MainFunctionParams& parameters) { // services aware of all our preferences. browser::RegisterAllPrefs(user_prefs, local_state); -#if defined(OS_LINUX) - // UI tests expect that the browser will show the home page on startup. - if (!parsed_command_line.HasSwitch(switches::kHomePage)) { - // TODO(port): Remove ifdef when the Linux splash page is not needed. - SessionStartupPref startup_pref = - SessionStartupPref(SessionStartupPref::URLS); - startup_pref.urls.push_back(GURL("about:linux-splash")); - SessionStartupPref::SetStartupPref(profile, startup_pref); - } -#endif - // Now that all preferences have been registered, set the install date // for the uninstall metrics if this is our first run. This only actually // gets used if the user has metrics reporting enabled at uninstall time. |