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_DEVICE_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 // CrosSettingsProvider implementation that works with device settings. | 32 // CrosSettingsProvider implementation that works with device settings. |
33 class DeviceSettingsProvider : public CrosSettingsProvider, | 33 class DeviceSettingsProvider : public CrosSettingsProvider, |
34 public DeviceSettingsService::Observer { | 34 public DeviceSettingsService::Observer { |
35 public: | 35 public: |
36 DeviceSettingsProvider(const NotifyObserversCallback& notify_cb, | 36 DeviceSettingsProvider(const NotifyObserversCallback& notify_cb, |
37 DeviceSettingsService* device_settings_service); | 37 DeviceSettingsService* device_settings_service); |
38 virtual ~DeviceSettingsProvider(); | 38 virtual ~DeviceSettingsProvider(); |
39 | 39 |
| 40 // Returns true if |path| is handled by this provider. |
| 41 static bool IsDeviceSetting(const std::string& name); |
| 42 |
40 // CrosSettingsProvider implementation. | 43 // CrosSettingsProvider implementation. |
41 virtual const base::Value* Get(const std::string& path) const OVERRIDE; | 44 virtual const base::Value* Get(const std::string& path) const OVERRIDE; |
42 virtual TrustedStatus PrepareTrustedValues( | 45 virtual TrustedStatus PrepareTrustedValues( |
43 const base::Closure& callback) OVERRIDE; | 46 const base::Closure& callback) OVERRIDE; |
44 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; | 47 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; |
45 | 48 |
46 private: | 49 private: |
47 // CrosSettingsProvider implementation: | 50 // CrosSettingsProvider implementation: |
48 virtual void DoSet(const std::string& path, | 51 virtual void DoSet(const std::string& path, |
49 const base::Value& value) OVERRIDE; | 52 const base::Value& value) OVERRIDE; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 InitializationTestUnowned); | 160 InitializationTestUnowned); |
158 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, | 161 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, |
159 PolicyFailedPermanentlyNotification); | 162 PolicyFailedPermanentlyNotification); |
160 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); | 163 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); |
161 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); | 164 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); |
162 }; | 165 }; |
163 | 166 |
164 } // namespace chromeos | 167 } // namespace chromeos |
165 | 168 |
166 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 169 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
OLD | NEW |