Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/browser/chromeos/cros_settings_provider.h

Issue 7867044: PART1: Initiated the SignedSettings refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up some debug output. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h"
11
10 namespace base { 12 namespace base {
11 class Value; 13 class Value;
12 } 14 }
13 15
14 namespace chromeos { 16 namespace chromeos {
15 17
16 class CrosSettingsProvider { 18 class CrosSettingsProvider {
17 public: 19 public:
18 virtual ~CrosSettingsProvider() {} 20 virtual ~CrosSettingsProvider() {}
19 21
22 // Callback function type.
23 typedef base::Closure Callback;
24
20 // Sets |in_value| to given |path| in cros settings. 25 // Sets |in_value| to given |path| in cros settings.
21 // Note that this takes ownership of |in_value|. 26 // Note that this takes ownership of |in_value|.
22 void Set(const std::string& path, base::Value* in_value); 27 void Set(const std::string& path, base::Value* in_value);
23 28
24 // Gets settings value of given |path| to |out_value|. 29 // Gets settings value of given |path| to |out_value|.
25 // Note that |out_value| is owned by the caller, not this class. 30 // Note that |out_value| is owned by the caller, not this class.
26 virtual bool Get(const std::string& path, base::Value** out_value) const = 0; 31 virtual const base::Value* Get(const std::string& path) const = 0;
32
33 // Starts a fetch from the trusted store for the value of |path|. It will
34 // call the |callback| function upon completion.
35 virtual bool GetTrusted(const std::string& path,
36 const Callback& callback) const = 0;
27 37
28 // Gets the namespace prefix provided by this provider 38 // Gets the namespace prefix provided by this provider
29 virtual bool HandlesSetting(const std::string& path) const = 0; 39 virtual bool HandlesSetting(const std::string& path) const = 0;
30 40
31 private: 41 private:
32 // Does the real job for Set(). 42 // Does the real job for Set().
33 virtual void DoSet(const std::string& path, base::Value* in_value) = 0; 43 virtual void DoSet(const std::string& path, base::Value* in_value) = 0;
34 }; 44 };
35 45
36 } // namespace chromeos 46 } // namespace chromeos
37 47
38 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ 48 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698