| 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/startup_utils.h" | 5 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // A string pref with initial locale set in VPD or manifest. | 24 // A string pref with initial locale set in VPD or manifest. |
| 25 const char kInitialLocale[] = "intl.initial_locale"; | 25 const char kInitialLocale[] = "intl.initial_locale"; |
| 26 | 26 |
| 27 // A boolean pref of the OOBE complete flag (first OOBE part before login). | 27 // A boolean pref of the OOBE complete flag (first OOBE part before login). |
| 28 const char kOobeComplete[] = "OobeComplete"; | 28 const char kOobeComplete[] = "OobeComplete"; |
| 29 | 29 |
| 30 // A boolean pref of the device registered flag (second part after first login). | 30 // A boolean pref of the device registered flag (second part after first login). |
| 31 const char kDeviceRegistered[] = "DeviceRegistered"; | 31 const char kDeviceRegistered[] = "DeviceRegistered"; |
| 32 | 32 |
| 33 // Time in seconds that we wait for the device to reboot. | |
| 34 // If reboot didn't happen, ask user to reboot device manually. | |
| 35 const int kWaitForRebootTimeSec = 3; | |
| 36 | |
| 37 // Saves boolean "Local State" preference and forces its persistence to disk. | 33 // Saves boolean "Local State" preference and forces its persistence to disk. |
| 38 void SaveBoolPreferenceForced(const char* pref_name, bool value) { | 34 void SaveBoolPreferenceForced(const char* pref_name, bool value) { |
| 39 PrefService* prefs = g_browser_process->local_state(); | 35 PrefService* prefs = g_browser_process->local_state(); |
| 40 prefs->SetBoolean(pref_name, value); | 36 prefs->SetBoolean(pref_name, value); |
| 41 prefs->CommitPendingWrite(); | 37 prefs->CommitPendingWrite(); |
| 42 } | 38 } |
| 43 | 39 |
| 44 // Saves integer "Local State" preference and forces its persistence to disk. | 40 // Saves integer "Local State" preference and forces its persistence to disk. |
| 45 void SaveIntegerPreferenceForced(const char* pref_name, int value) { | 41 void SaveIntegerPreferenceForced(const char* pref_name, int value) { |
| 46 PrefService* prefs = g_browser_process->local_state(); | 42 PrefService* prefs = g_browser_process->local_state(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 155 |
| 160 // static | 156 // static |
| 161 void StartupUtils::SetInitialLocale(const std::string& locale) { | 157 void StartupUtils::SetInitialLocale(const std::string& locale) { |
| 162 if (l10n_util::IsValidLocaleSyntax(locale)) | 158 if (l10n_util::IsValidLocaleSyntax(locale)) |
| 163 SaveStringPreferenceForced(kInitialLocale, locale); | 159 SaveStringPreferenceForced(kInitialLocale, locale); |
| 164 else | 160 else |
| 165 NOTREACHED(); | 161 NOTREACHED(); |
| 166 } | 162 } |
| 167 | 163 |
| 168 } // namespace chromeos | 164 } // namespace chromeos |
| OLD | NEW |