OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SETTINGS_CROS_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
16 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
| 20 class DictionaryValue; |
20 class ListValue; | 21 class ListValue; |
21 class Value; | 22 class Value; |
22 } | 23 } |
23 | 24 |
24 namespace chromeos { | 25 namespace chromeos { |
25 | 26 |
26 // This class manages per-device/global settings. | 27 // This class manages per-device/global settings. |
27 class CrosSettings : public base::NonThreadSafe { | 28 class CrosSettings : public base::NonThreadSafe { |
28 public: | 29 public: |
29 // Manage singleton instance. | 30 // Manage singleton instance. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 67 |
67 // These are convenience forms of Get(). The value will be retrieved | 68 // These are convenience forms of Get(). The value will be retrieved |
68 // and the return value will be true if the |path| is valid and the value at | 69 // and the return value will be true if the |path| is valid and the value at |
69 // the end of the path can be returned in the form specified. | 70 // the end of the path can be returned in the form specified. |
70 bool GetBoolean(const std::string& path, bool* out_value) const; | 71 bool GetBoolean(const std::string& path, bool* out_value) const; |
71 bool GetInteger(const std::string& path, int* out_value) const; | 72 bool GetInteger(const std::string& path, int* out_value) const; |
72 bool GetDouble(const std::string& path, double* out_value) const; | 73 bool GetDouble(const std::string& path, double* out_value) const; |
73 bool GetString(const std::string& path, std::string* out_value) const; | 74 bool GetString(const std::string& path, std::string* out_value) const; |
74 bool GetList(const std::string& path, | 75 bool GetList(const std::string& path, |
75 const base::ListValue** out_value) const; | 76 const base::ListValue** out_value) const; |
| 77 bool GetDictionary(const std::string& path, |
| 78 const base::DictionaryValue** out_value) const; |
76 | 79 |
77 // Helper function for the whitelist op. Implemented here because we will need | 80 // Helper function for the whitelist op. Implemented here because we will need |
78 // this in a few places. The functions searches for |email| in the pref |path| | 81 // this in a few places. The functions searches for |email| in the pref |path| |
79 // It respects whitelists so foo@bar.baz will match *@bar.baz too. | 82 // It respects whitelists so foo@bar.baz will match *@bar.baz too. |
80 bool FindEmailInList(const std::string& path, const std::string& email) const; | 83 bool FindEmailInList(const std::string& path, const std::string& email) const; |
81 | 84 |
82 // Adding/removing of providers. | 85 // Adding/removing of providers. |
83 bool AddSettingsProvider(CrosSettingsProvider* provider); | 86 bool AddSettingsProvider(CrosSettingsProvider* provider); |
84 bool RemoveSettingsProvider(CrosSettingsProvider* provider); | 87 bool RemoveSettingsProvider(CrosSettingsProvider* provider); |
85 | 88 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 private: | 131 private: |
129 bool initialized_device_settings_service_; | 132 bool initialized_device_settings_service_; |
130 bool initialized_cros_settings_; | 133 bool initialized_cros_settings_; |
131 | 134 |
132 DISALLOW_COPY_AND_ASSIGN(ScopedTestCrosSettings); | 135 DISALLOW_COPY_AND_ASSIGN(ScopedTestCrosSettings); |
133 }; | 136 }; |
134 | 137 |
135 } // namespace chromeos | 138 } // namespace chromeos |
136 | 139 |
137 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ | 140 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
OLD | NEW |