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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_CACHE_H_
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_CACHE_H_
8 namespace enterprise_management
{
13 class PrefRegistrySimple
;
17 // There is need (metrics at OOBE stage) to store settings (that normally would
18 // go into DeviceSettings storage) before owner has been assigned (hence no key
19 // is available). This set of functions serves as a transient storage in that
21 namespace device_settings_cache
{
22 // Registers required pref section.
23 void RegisterPrefs(PrefRegistrySimple
* registry
);
25 // Stores a new policy blob inside the cache stored in |local_state|.
26 bool Store(const enterprise_management::PolicyData
&policy
,
27 PrefService
* local_state
);
29 // Retrieves the policy blob from the cache stored in |local_state|.
30 bool Retrieve(enterprise_management::PolicyData
*policy
,
31 PrefService
* local_state
);
33 // Call this after owner has been assigned to persist settings into
34 // DeviceSettings storage.
35 void Finalize(PrefService
* local_state
);
36 } // namespace device_settings_cache
38 } // namespace chromeos
40 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_CACHE_H_