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

Side by Side 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: Replace hardcoded --no-first-run in scripts Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/first_run/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 bool IsChromeFirstRun() { 475 bool IsChromeFirstRun() {
476 if (internal::first_run_ != internal::FIRST_RUN_UNKNOWN) 476 if (internal::first_run_ != internal::FIRST_RUN_UNKNOWN)
477 return internal::first_run_ == internal::FIRST_RUN_TRUE; 477 return internal::first_run_ == internal::FIRST_RUN_TRUE;
478 478
479 internal::first_run_ = internal::FIRST_RUN_FALSE; 479 internal::first_run_ = internal::FIRST_RUN_FALSE;
480 480
481 base::FilePath first_run_sentinel; 481 base::FilePath first_run_sentinel;
482 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 482 const CommandLine* command_line = CommandLine::ForCurrentProcess();
483 if (command_line->HasSwitch(switches::kForceFirstRun)) { 483 if (command_line->HasSwitch(switches::kForceFirstRun)) {
484 internal::first_run_ = internal::FIRST_RUN_TRUE; 484 internal::first_run_ = internal::FIRST_RUN_TRUE;
485 } else if (command_line->HasSwitch(switches::kNoFirstRun)) { 485 } else if (command_line->HasSwitch(switches::kCancelFirstRun)) {
486 internal::first_run_ = internal::FIRST_RUN_CANCEL; 486 internal::first_run_ = internal::FIRST_RUN_CANCEL;
grt (UTC plus 2) 2013/07/30 02:48:16 FIRST_RUN_CANCEL doesn't seem to exist in the repo
gab 2013/07/30 12:58:54 Ah, yes, can't sneak anything by you ;)! Based on
487 } else if (internal::GetFirstRunSentinelFilePath(&first_run_sentinel) && 487 } else if (!command_line->HasSwitch(switches::kSkipFirstRun) &&
488 internal::GetFirstRunSentinelFilePath(&first_run_sentinel) &&
488 !base::PathExists(first_run_sentinel)) { 489 !base::PathExists(first_run_sentinel)) {
489 internal::first_run_ = internal::FIRST_RUN_TRUE; 490 internal::first_run_ = internal::FIRST_RUN_TRUE;
490 } 491 }
491 492
492 return internal::first_run_ == internal::FIRST_RUN_TRUE; 493 return internal::first_run_ == internal::FIRST_RUN_TRUE;
493 } 494 }
494 495
495 void CreateSentinelIfNeeded() { 496 void CreateSentinelIfNeeded() {
496 if (IsChromeFirstRun() || 497 if (IsChromeFirstRun() ||
497 internal::first_run_ == internal::FIRST_RUN_CANCEL) { 498 internal::first_run_ == internal::FIRST_RUN_CANCEL) {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 SetShouldDoPersonalDataManagerFirstRun(); 777 SetShouldDoPersonalDataManagerFirstRun();
777 778
778 internal::DoPostImportPlatformSpecificTasks(profile); 779 internal::DoPostImportPlatformSpecificTasks(profile);
779 } 780 }
780 781
781 uint16 auto_import_state() { 782 uint16 auto_import_state() {
782 return g_auto_import_state; 783 return g_auto_import_state;
783 } 784 }
784 785
785 } // namespace first_run 786 } // namespace first_run
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698