diff options
-rw-r--r-- | chrome/browser/chrome_browser_main_mac.mm | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run.cc | 10 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run.h | 5 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 7 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 2 | ||||
-rw-r--r-- | chrome/test/nacl/nacl_browsertest_util.cc | 1 |
8 files changed, 23 insertions, 9 deletions
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index 3d41c65..07f250c 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -229,7 +229,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; // Disk image installation is sort of a first-run task, so it shares the - // kNoFirstRun switch. + // no first run switches. // // This needs to be done after the resource bundle is initialized (for // access to localizations in the UI) and after Keystone is initialized @@ -240,7 +240,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { // anyone tries doing anything silly like firing off an import job, and // before anything creating preferences like Local State in order for the // relaunched installed application to still consider itself as first-run. - if (!parsed_command_line().HasSwitch(switches::kNoFirstRun)) { + if (!first_run::IsFirstRunSuppressed(parsed_command_line())) { if (MaybeInstallFromDiskImage()) { // The application was installed and the installed copy has been // launched. This process is now obsolete. Exit. diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc index c1aa932..3bf47c8 100644 --- a/chrome/browser/chromeos/login/login_browsertest.cc +++ b/chrome/browser/chromeos/login/login_browsertest.cc @@ -65,7 +65,6 @@ class LoginUserTest : public LoginTestBase { command_line->AppendSwitchASCII( chromeos::switches::kLoginUser, "TestUser@gmail.com"); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); - command_line->AppendSwitch(::switches::kNoFirstRun); } }; @@ -75,7 +74,6 @@ class LoginGuestTest : public LoginTestBase { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); - command_line->AppendSwitch(::switches::kNoFirstRun); } }; diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index e7a6fcc..6b9e650 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -598,9 +598,10 @@ bool IsChromeFirstRun() { const CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kForceFirstRun)) { internal::first_run_ = internal::FIRST_RUN_TRUE; - } else if (command_line->HasSwitch(switches::kNoFirstRun)) { + } else if (command_line->HasSwitch(switches::kCancelFirstRun)) { internal::first_run_ = internal::FIRST_RUN_CANCEL; - } else if (internal::GetFirstRunSentinelFilePath(&first_run_sentinel) && + } else if (!command_line->HasSwitch(switches::kNoFirstRun) && + internal::GetFirstRunSentinelFilePath(&first_run_sentinel) && !base::PathExists(first_run_sentinel)) { internal::first_run_ = internal::FIRST_RUN_TRUE; } @@ -608,6 +609,11 @@ bool IsChromeFirstRun() { return internal::first_run_ == internal::FIRST_RUN_TRUE; } +bool IsFirstRunSuppressed(const CommandLine& command_line) { + return command_line.HasSwitch(switches::kCancelFirstRun) || + command_line.HasSwitch(switches::kNoFirstRun); +} + void CreateSentinelIfNeeded() { if (IsChromeFirstRun() || internal::first_run_ == internal::FIRST_RUN_CANCEL) { diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h index 9f86f83..b180e29f 100644 --- a/chrome/browser/first_run/first_run.h +++ b/chrome/browser/first_run/first_run.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" +class CommandLine; class GURL; class Profile; @@ -84,6 +85,10 @@ struct MasterPrefs { // Returns true if this is the first time chrome is run for this user. bool IsChromeFirstRun(); +// Returns true if |command_line|'s switches explicitly specify that first run +// should be suppressed in the current run. +bool IsFirstRunSuppressed(const CommandLine& command_line); + // Creates the first run sentinel if needed. This should only be called after // the process singleton has been grabbed by the current process // (http://crbug.com/264694). diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 8119470..c802fd1 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -145,6 +145,10 @@ const char kAutomationClientChannelID[] = "automation-channel"; const char kAutomationReinitializeOnChannelError[] = "automation-reinitialize-on-channel-error"; +// Similar to kNoFirstRun, but also drops the First Run beacon so that first run +// will not occur in subsequent runs either. +const char kCancelFirstRun[] = "cancel-first-run"; + // How often (in seconds) to check for updates. Should only be used for testing // purposes. const char kCheckForUpdateIntervalSec[] = "check-for-update-interval"; @@ -809,7 +813,8 @@ const char kFileDescriptorLimit[] = "file-descriptor-limit"; const char kForceAppMode[] = "force-app-mode"; // Displays the First Run experience when the browser is started, regardless of -// whether or not it's actually the First Run (this overrides kNoFirstRun). +// whether or not it's actually the First Run (this overrides kNoFirstRun and +// kCancelFirstRun). const char kForceFirstRun[] = "force-first-run"; // Tries to load cloud policy for every signed in user, regardless of whether diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 3272ce5..17d203c 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -56,6 +56,7 @@ extern const char kAuthServerWhitelist[]; extern const char kAutoLaunchAtStartup[]; extern const char kAutomationClientChannelID[]; extern const char kAutomationReinitializeOnChannelError[]; +extern const char kCancelFirstRun[]; extern const char kCheckForUpdateIntervalSec[]; extern const char kCheckCloudPrintConnectorPolicy[]; extern const char kChromeFrame[]; diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index dc96a5b..1f7a59f 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -1111,7 +1111,7 @@ installer::InstallStatus UninstallProducts( // trigger Active Setup and make sure the system-level Chrome doesn't go // through first run. trigger_active_setup = true; - system_level_cmd.AppendSwitch(::switches::kNoFirstRun); + system_level_cmd.AppendSwitch(::switches::kCancelFirstRun); } } } diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc index c1e5655..266a5d7 100644 --- a/chrome/test/nacl/nacl_browsertest_util.cc +++ b/chrome/test/nacl/nacl_browsertest_util.cc @@ -203,7 +203,6 @@ NaClBrowserTestBase::~NaClBrowserTestBase() { } void NaClBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { - command_line->AppendSwitch(switches::kNoFirstRun); command_line->AppendSwitch(switches::kEnableNaCl); } |