| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/values.h" |
| 12 | 13 |
| 13 class PrefService; | 14 class PrefService; |
| 14 | 15 |
| 15 namespace chromeos { | 16 namespace chromeos { |
| 16 | 17 |
| 17 // There is need (proxy settings at OOBE stage) to store settings | 18 // There is need (proxy settings at OOBE stage) to store settings |
| 18 // (that are normally go into SignedSettings storage) | 19 // (that are normally go into SignedSettings storage) |
| 19 // before owner has been assigned (hence no key is available). | 20 // before owner has been assigned (hence no key is available). |
| 20 // This class serves as a transient storage in that case. | 21 // This class serves as a transient storage in that case. |
| 21 class SignedSettingsTempStorage { | 22 class SignedSettingsTempStorage { |
| 22 public: | 23 public: |
| 23 // Registers required pref section. | 24 // Registers required pref section. |
| 24 static void RegisterPrefs(PrefService* local_state); | 25 static void RegisterPrefs(PrefService* local_state); |
| 25 | 26 |
| 26 static bool Store(const std::string& name, | 27 static bool Store(const std::string& name, |
| 27 const std::string& value, | 28 const base::Value& value, |
| 28 PrefService* local_state); | 29 PrefService* local_state); |
| 29 static bool Retrieve(const std::string& name, | 30 static bool Retrieve(const std::string& name, |
| 30 std::string* value, | 31 base::Value** value, |
| 31 PrefService* local_state); | 32 PrefService* local_state); |
| 32 | 33 |
| 33 // Call this after owner has been assigned to persist settings | 34 // Call this after owner has been assigned to persist settings |
| 34 // into SignedSettings storage. | 35 // into SignedSettings storage. |
| 35 static void Finalize(PrefService* local_state); | 36 static void Finalize(PrefService* local_state); |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 SignedSettingsTempStorage() {} | 39 SignedSettingsTempStorage() {} |
| 39 DISALLOW_COPY_AND_ASSIGN(SignedSettingsTempStorage); | 40 DISALLOW_COPY_AND_ASSIGN(SignedSettingsTempStorage); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace chromeos | 43 } // namespace chromeos |
| 43 | 44 |
| 44 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ |
| OLD | NEW |