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