summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 23:43:48 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 23:43:48 +0000
commit0bfff0758445c1b0abdb0deff3dfb8aa5b2229e3 (patch)
treede50ea7a99d42e5fdc95b710ad714d649a45a788
parent9adda5ced8f9f3ce5fda4f678911dca98fd73c8a (diff)
downloadchromium_src-0bfff0758445c1b0abdb0deff3dfb8aa5b2229e3.zip
chromium_src-0bfff0758445c1b0abdb0deff3dfb8aa5b2229e3.tar.gz
chromium_src-0bfff0758445c1b0abdb0deff3dfb8aa5b2229e3.tar.bz2
Don't clobber the previous session when showing about-linux splash page.
BUG=16599 TEST=previous session should restore + linux splash page Review URL: http://codereview.chromium.org/149555 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20571 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_init.cc21
-rw-r--r--chrome/browser/browser_main.cc13
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.