| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // If reboot didn't happen, ask user to reboot device manually. | 71 // If reboot didn't happen, ask user to reboot device manually. |
| 72 const int kWaitForRebootTimeSec = 3; | 72 const int kWaitForRebootTimeSec = 3; |
| 73 | 73 |
| 74 // Interval in ms which is used for smooth screen showing. | 74 // Interval in ms which is used for smooth screen showing. |
| 75 static int kShowDelayMs = 400; | 75 static int kShowDelayMs = 400; |
| 76 | 76 |
| 77 // Saves boolean "Local State" preference and forces its persistence to disk. | 77 // Saves boolean "Local State" preference and forces its persistence to disk. |
| 78 void SaveBoolPreferenceForced(const char* pref_name, bool value) { | 78 void SaveBoolPreferenceForced(const char* pref_name, bool value) { |
| 79 PrefService* prefs = g_browser_process->local_state(); | 79 PrefService* prefs = g_browser_process->local_state(); |
| 80 prefs->SetBoolean(pref_name, value); | 80 prefs->SetBoolean(pref_name, value); |
| 81 prefs->SavePersistentPrefs(); | 81 prefs->CommitPendingWrite(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 // Saves integer "Local State" preference and forces its persistence to disk. | 84 // Saves integer "Local State" preference and forces its persistence to disk. |
| 85 void SaveIntegerPreferenceForced(const char* pref_name, int value) { | 85 void SaveIntegerPreferenceForced(const char* pref_name, int value) { |
| 86 PrefService* prefs = g_browser_process->local_state(); | 86 PrefService* prefs = g_browser_process->local_state(); |
| 87 prefs->SetInteger(pref_name, value); | 87 prefs->SetInteger(pref_name, value); |
| 88 prefs->SavePersistentPrefs(); | 88 prefs->CommitPendingWrite(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 // Saves string "Local State" preference and forces its persistence to disk. | 91 // Saves string "Local State" preference and forces its persistence to disk. |
| 92 void SaveStringPreferenceForced(const char* pref_name, | 92 void SaveStringPreferenceForced(const char* pref_name, |
| 93 const std::string& value) { | 93 const std::string& value) { |
| 94 PrefService* prefs = g_browser_process->local_state(); | 94 PrefService* prefs = g_browser_process->local_state(); |
| 95 prefs->SetString(pref_name, value); | 95 prefs->SetString(pref_name, value); |
| 96 prefs->SavePersistentPrefs(); | 96 prefs->CommitPendingWrite(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace | 99 } // namespace |
| 100 | 100 |
| 101 namespace chromeos { | 101 namespace chromeos { |
| 102 | 102 |
| 103 const char WizardController::kNetworkScreenName[] = "network"; | 103 const char WizardController::kNetworkScreenName[] = "network"; |
| 104 const char WizardController::kLoginScreenName[] = "login"; | 104 const char WizardController::kLoginScreenName[] = "login"; |
| 105 const char WizardController::kUpdateScreenName[] = "update"; | 105 const char WizardController::kUpdateScreenName[] = "update"; |
| 106 const char WizardController::kUserImageScreenName[] = "image"; | 106 const char WizardController::kUserImageScreenName[] = "image"; |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 680 |
| 681 bool WizardController::usage_statistics_reporting() const { | 681 bool WizardController::usage_statistics_reporting() const { |
| 682 return usage_statistics_reporting_; | 682 return usage_statistics_reporting_; |
| 683 } | 683 } |
| 684 | 684 |
| 685 void WizardController::SetZeroDelays() { | 685 void WizardController::SetZeroDelays() { |
| 686 kShowDelayMs = 0; | 686 kShowDelayMs = 0; |
| 687 } | 687 } |
| 688 | 688 |
| 689 } // namespace chromeos | 689 } // namespace chromeos |
| OLD | NEW |