summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r--chrome/browser/first_run/first_run.cc10
-rw-r--r--chrome/browser/first_run/first_run.h5
2 files changed, 13 insertions, 2 deletions
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).