Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_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 #include "base/values.h" |
| 13 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" | |
| 14 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | |
| 15 | |
| 16 namespace em = enterprise_management; | |
| 13 | 17 |
| 14 class PrefService; | 18 class PrefService; |
| 15 | 19 |
| 16 namespace chromeos { | 20 namespace chromeos { |
| 17 | 21 |
| 18 // There is need (proxy settings at OOBE stage) to store settings | 22 // There is need (proxy settings at OOBE stage) to store settings |
| 19 // (that are normally go into SignedSettings storage) | 23 // (that are normally go into SignedSettings storage) |
|
Mattias Nissler (ping if slow)
2011/11/30 11:22:44
s/are//
pastarmovj
2011/11/30 17:21:16
Done.
| |
| 20 // before owner has been assigned (hence no key is available). | 24 // before owner has been assigned (hence no key is available). |
| 21 // This class serves as a transient storage in that case. | 25 // This class serves as a transient storage in that case. |
| 22 class SignedSettingsTempStorage { | 26 class SignedSettingsCache { |
|
Mattias Nissler (ping if slow)
2011/11/30 11:22:44
Only statics? Convert to namespace.
pastarmovj
2011/11/30 17:21:16
Done.
| |
| 23 public: | 27 public: |
| 24 // Registers required pref section. | 28 // Registers required pref section. |
| 25 static void RegisterPrefs(PrefService* local_state); | 29 static void RegisterPrefs(PrefService* local_state); |
| 26 | 30 |
| 27 static bool Store(const std::string& name, | 31 static bool Store(const em::PolicyData &policy, |
| 28 const base::Value& value, | |
| 29 PrefService* local_state); | 32 PrefService* local_state); |
| 30 static bool Retrieve(const std::string& name, | 33 static bool Retrieve(em::PolicyData *policy, |
| 31 base::Value** value, | |
| 32 PrefService* local_state); | 34 PrefService* local_state); |
| 33 | 35 |
| 34 // Call this after owner has been assigned to persist settings | 36 // Call this after owner has been assigned to persist settings |
| 35 // into SignedSettings storage. | 37 // into SignedSettings storage. |
| 36 static void Finalize(PrefService* local_state); | 38 static void Finalize(PrefService* local_state, |
| 39 const em::PolicyFetchResponse& policy); | |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 SignedSettingsTempStorage() {} | 42 SignedSettingsCache() {} |
| 40 DISALLOW_COPY_AND_ASSIGN(SignedSettingsTempStorage); | 43 DISALLOW_COPY_AND_ASSIGN(SignedSettingsCache); |
| 41 }; | 44 }; |
| 42 | 45 |
| 43 } // namespace chromeos | 46 } // namespace chromeos |
| 44 | 47 |
| 45 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_H_ |
| OLD | NEW |