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