Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5730)

Unified Diff: chrome/browser/first_run/first_run.cc

Issue 21150006: Introduce --cancel-first-run and reduce the strength of --no-first-run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add first_run::IsFirstRunSuppressed() Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/first_run/first_run.cc
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 29c443b63fb46941dffdd0a09c6253f6323c0104..4ed78285cd4617a6f68711c74fa7ee28cc0e2112 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -482,9 +482,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::kSkipFirstRun) &&
+ internal::GetFirstRunSentinelFilePath(&first_run_sentinel) &&
!base::PathExists(first_run_sentinel)) {
internal::first_run_ = internal::FIRST_RUN_TRUE;
}
@@ -492,6 +493,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::kSkipFirstRun);
+}
+
void CreateSentinelIfNeeded() {
if (IsChromeFirstRun() ||
internal::first_run_ == internal::FIRST_RUN_CANCEL) {

Powered by Google App Engine
This is Rietveld 408576698