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

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

Issue 2935011: Initial accounts options page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: use ListItem directly for now per arv Created 10 years, 5 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_
7
8 #include <string>
9 #include "base/values.h"
10
11 #include "chrome/browser/chromeos/cros_settings_names.h"
12
13 namespace chromeos {
14
15 // A class manages per-device/global settings.
16 class CrosSettings {
17 public:
18 // Class factory.
19 static CrosSettings* Get();
20
21 // Helper function to test if given path is a value cros settings name.
22 static bool IsCrosSettings(const std::wstring& path);
23
24 // Sets |in_value| to given |path| in cros settings.
25 // Note that this takes ownership of |in_value|.
26 virtual void Set(const std::wstring& path, Value* in_value) = 0;
27
28 // Gets settings value of given |path| to |out_value|.
29 // Note that |out_value| is still owned by this class.
30 virtual bool Get(const std::wstring& path, Value** out_value) const = 0;
31
32 // Convenience forms of Set(). These methods will replace any existing
33 // value at that path, even if it has a different type.
34 void SetBoolean(const std::wstring& path, bool in_value);
35 void SetInteger(const std::wstring& path, int in_value);
36 void SetReal(const std::wstring& path, double in_value);
37 void SetString(const std::wstring& path, const std::string& in_value);
38
39 // These are convenience forms of Get(). The value will be retrieved
40 // and the return value will be true if the path is valid and the value at
41 // the end of the path can be returned in the form specified.
42 bool GetBoolean(const std::wstring& path, bool* out_value) const;
43 bool GetInteger(const std::wstring& path, int* out_value) const;
44 bool GetReal(const std::wstring& path, double* out_value) const;
45 bool GetString(const std::wstring& path, std::string* out_value) const;
46 };
47
48 } // namespace chromeos
49
50 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698