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/chromeos/login/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "ui/base/l10n/l10n_util.h" | 60 #include "ui/base/l10n/l10n_util.h" |
61 | 61 |
62 #if defined(USE_LINUX_BREAKPAD) | 62 #if defined(USE_LINUX_BREAKPAD) |
63 #include "chrome/app/breakpad_linux.h" | 63 #include "chrome/app/breakpad_linux.h" |
64 #endif | 64 #endif |
65 | 65 |
66 using content::BrowserThread; | 66 using content::BrowserThread; |
67 | 67 |
68 namespace { | 68 namespace { |
69 | 69 |
70 // A boolean pref of the EULA accepted flag. | |
71 const char kEulaAccepted[] = "EulaAccepted"; | |
72 | |
73 // A string pref with initial locale set in VPD or manifest. | 70 // A string pref with initial locale set in VPD or manifest. |
74 const char kInitialLocale[] = "intl.initial_locale"; | 71 const char kInitialLocale[] = "intl.initial_locale"; |
75 | 72 |
76 // A boolean pref of the OOBE complete flag (first OOBE part before login). | 73 // A boolean pref of the OOBE complete flag (first OOBE part before login). |
77 const char kOobeComplete[] = "OobeComplete"; | 74 const char kOobeComplete[] = "OobeComplete"; |
78 | 75 |
79 // A boolean pref of the device registered flag (second part after first login). | 76 // A boolean pref of the device registered flag (second part after first login). |
80 const char kDeviceRegistered[] = "DeviceRegistered"; | 77 const char kDeviceRegistered[] = "DeviceRegistered"; |
81 | 78 |
82 // Time in seconds that we wait for the device to reboot. | 79 // Time in seconds that we wait for the device to reboot. |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 } | 414 } |
418 | 415 |
419 void WizardController::SkipUpdateEnrollAfterEula() { | 416 void WizardController::SkipUpdateEnrollAfterEula() { |
420 skip_update_enroll_after_eula_ = true; | 417 skip_update_enroll_after_eula_ = true; |
421 } | 418 } |
422 | 419 |
423 // static | 420 // static |
424 void WizardController::RegisterPrefs(PrefRegistrySimple* registry) { | 421 void WizardController::RegisterPrefs(PrefRegistrySimple* registry) { |
425 registry->RegisterBooleanPref(kOobeComplete, false); | 422 registry->RegisterBooleanPref(kOobeComplete, false); |
426 registry->RegisterIntegerPref(kDeviceRegistered, -1); | 423 registry->RegisterIntegerPref(kDeviceRegistered, -1); |
427 registry->RegisterBooleanPref(kEulaAccepted, false); | 424 registry->RegisterBooleanPref(prefs::kEulaAccepted, false); |
428 registry->RegisterStringPref(kInitialLocale, "en-US"); | 425 registry->RegisterStringPref(kInitialLocale, "en-US"); |
429 } | 426 } |
430 | 427 |
431 /////////////////////////////////////////////////////////////////////////////// | 428 /////////////////////////////////////////////////////////////////////////////// |
432 // WizardController, ExitHandlers: | 429 // WizardController, ExitHandlers: |
433 void WizardController::OnNetworkConnected() { | 430 void WizardController::OnNetworkConnected() { |
434 if (is_official_build_) { | 431 if (is_official_build_) { |
435 if (!IsEulaAccepted()) { | 432 if (!IsEulaAccepted()) { |
436 ShowEulaScreen(); | 433 ShowEulaScreen(); |
437 } else { | 434 } else { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 if (is_out_of_box_) { | 691 if (is_out_of_box_) { |
695 ShowNetworkScreen(); | 692 ShowNetworkScreen(); |
696 } else { | 693 } else { |
697 ShowLoginScreen(); | 694 ShowLoginScreen(); |
698 } | 695 } |
699 } | 696 } |
700 } | 697 } |
701 | 698 |
702 // static | 699 // static |
703 bool WizardController::IsEulaAccepted() { | 700 bool WizardController::IsEulaAccepted() { |
704 return g_browser_process->local_state()->GetBoolean(kEulaAccepted); | 701 return g_browser_process->local_state()->GetBoolean(prefs::kEulaAccepted); |
705 } | 702 } |
706 | 703 |
707 // static | 704 // static |
708 bool WizardController::IsOobeCompleted() { | 705 bool WizardController::IsOobeCompleted() { |
709 return g_browser_process->local_state()->GetBoolean(kOobeComplete); | 706 return g_browser_process->local_state()->GetBoolean(kOobeComplete); |
710 } | 707 } |
711 | 708 |
712 // static | 709 // static |
713 void WizardController::MarkEulaAccepted() { | 710 void WizardController::MarkEulaAccepted() { |
714 SaveBoolPreferenceForced(kEulaAccepted, true); | 711 SaveBoolPreferenceForced(prefs::kEulaAccepted, true); |
715 } | 712 } |
716 | 713 |
717 // static | 714 // static |
718 void WizardController::MarkOobeCompleted() { | 715 void WizardController::MarkOobeCompleted() { |
719 SaveBoolPreferenceForced(kOobeComplete, true); | 716 SaveBoolPreferenceForced(kOobeComplete, true); |
720 } | 717 } |
721 | 718 |
722 // Returns the path to flag file indicating that both parts of OOBE were | 719 // Returns the path to flag file indicating that both parts of OOBE were |
723 // completed. | 720 // completed. |
724 // On chrome device, returns /home/chronos/.oobe_completed. | 721 // On chrome device, returns /home/chronos/.oobe_completed. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 return zero_delay_enabled_; | 887 return zero_delay_enabled_; |
891 } | 888 } |
892 | 889 |
893 // static | 890 // static |
894 void WizardController::SetZeroDelays() { | 891 void WizardController::SetZeroDelays() { |
895 kShowDelayMs = 0; | 892 kShowDelayMs = 0; |
896 zero_delay_enabled_ = true; | 893 zero_delay_enabled_ = true; |
897 } | 894 } |
898 | 895 |
899 } // namespace chromeos | 896 } // namespace chromeos |
OLD | NEW |