• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
7 
8 #include <string>
9 
10 class Value;
11 
12 namespace chromeos {
13 
14 class CrosSettingsProvider {
15  public:
~CrosSettingsProvider()16   virtual ~CrosSettingsProvider() {}
17 
18   // Sets |in_value| to given |path| in cros settings.
19   // Note that this takes ownership of |in_value|.
20   void Set(const std::string& path, Value* in_value);
21 
22   // Gets settings value of given |path| to |out_value|.
23   // Note that |out_value| is owned by the caller, not this class.
24   virtual bool Get(const std::string& path, Value** out_value) const = 0;
25 
26   // Gets the namespace prefix provided by this provider
27   virtual bool HandlesSetting(const std::string& path) = 0;
28 
29  private:
30   // Does the real job for Set().
31   virtual void DoSet(const std::string& path, Value* in_value) = 0;
32 };
33 
34 }  // namespace chromeos
35 
36 #endif  // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
37