cros_settings_provider.h revision 513209b27ff55e2841eac0e4120199c23acce758
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_CROS_SETTINGS_PROVIDER_H_
6#define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
7
8#include <string>
9
10class Value;
11
12namespace chromeos {
13
14class CrosSettingsProvider {
15 public:
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 still owned by 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