OLD | NEW |
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 dont_import_items(0), | 584 dont_import_items(0), |
585 make_chrome_default_for_user(false), | 585 make_chrome_default_for_user(false), |
586 suppress_first_run_default_browser_prompt(false) { | 586 suppress_first_run_default_browser_prompt(false) { |
587 } | 587 } |
588 | 588 |
589 MasterPrefs::~MasterPrefs() {} | 589 MasterPrefs::~MasterPrefs() {} |
590 | 590 |
591 bool IsChromeFirstRun() { | 591 bool IsChromeFirstRun() { |
592 if (internal::g_first_run == internal::FIRST_RUN_UNKNOWN) { | 592 if (internal::g_first_run == internal::FIRST_RUN_UNKNOWN) { |
593 internal::g_first_run = internal::FIRST_RUN_FALSE; | 593 internal::g_first_run = internal::FIRST_RUN_FALSE; |
594 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 594 const base::CommandLine* command_line = |
| 595 base::CommandLine::ForCurrentProcess(); |
595 if (command_line->HasSwitch(switches::kForceFirstRun) || | 596 if (command_line->HasSwitch(switches::kForceFirstRun) || |
596 (!command_line->HasSwitch(switches::kNoFirstRun) && | 597 (!command_line->HasSwitch(switches::kNoFirstRun) && |
597 !internal::IsFirstRunSentinelPresent())) { | 598 !internal::IsFirstRunSentinelPresent())) { |
598 internal::g_first_run = internal::FIRST_RUN_TRUE; | 599 internal::g_first_run = internal::FIRST_RUN_TRUE; |
599 } | 600 } |
600 } | 601 } |
601 return internal::g_first_run == internal::FIRST_RUN_TRUE; | 602 return internal::g_first_run == internal::FIRST_RUN_TRUE; |
602 } | 603 } |
603 | 604 |
604 #if defined(OS_MACOSX) | 605 #if defined(OS_MACOSX) |
605 bool IsFirstRunSuppressed(const CommandLine& command_line) { | 606 bool IsFirstRunSuppressed(const base::CommandLine& command_line) { |
606 return command_line.HasSwitch(switches::kNoFirstRun); | 607 return command_line.HasSwitch(switches::kNoFirstRun); |
607 } | 608 } |
608 #endif | 609 #endif |
609 | 610 |
610 void CreateSentinelIfNeeded() { | 611 void CreateSentinelIfNeeded() { |
611 if (IsChromeFirstRun()) | 612 if (IsChromeFirstRun()) |
612 internal::CreateSentinel(); | 613 internal::CreateSentinel(); |
613 } | 614 } |
614 | 615 |
615 std::string GetPingDelayPrefName() { | 616 std::string GetPingDelayPrefName() { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 SetShouldDoPersonalDataManagerFirstRun(); | 805 SetShouldDoPersonalDataManagerFirstRun(); |
805 | 806 |
806 internal::DoPostImportPlatformSpecificTasks(profile); | 807 internal::DoPostImportPlatformSpecificTasks(profile); |
807 } | 808 } |
808 | 809 |
809 uint16 auto_import_state() { | 810 uint16 auto_import_state() { |
810 return g_auto_import_state; | 811 return g_auto_import_state; |
811 } | 812 } |
812 | 813 |
813 } // namespace first_run | 814 } // namespace first_run |
OLD | NEW |