| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/prefs/pref_value_map.h" | 17 #include "base/prefs/pref_value_map.h" |
| 18 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 18 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 19 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 19 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 20 #include "chromeos/settings/cros_settings_provider.h" | 20 #include "chromeos/settings/cros_settings_provider.h" |
| 21 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class Value; | 24 class Value; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace enterprise_management { | 27 namespace enterprise_management { |
| 27 class ChromeDeviceSettingsProto; | 28 class ChromeDeviceSettingsProto; |
| 28 } // namespace enterprise_management | 29 } // namespace enterprise_management |
| 29 | 30 |
| 30 namespace chromeos { | 31 namespace chromeos { |
| 31 | 32 |
| 32 // CrosSettingsProvider implementation that works with device settings. | 33 // CrosSettingsProvider implementation that works with device settings. |
| 33 class DeviceSettingsProvider : public CrosSettingsProvider, | 34 class DeviceSettingsProvider : public CrosSettingsProvider, |
| 34 public DeviceSettingsService::Observer { | 35 public DeviceSettingsService::Observer { |
| 35 public: | 36 public: |
| 37 // The callback type that is called to get the device mode. |
| 38 typedef base::Callback<policy::DeviceMode(void)> GetDeviceModeCallback; |
| 39 |
| 36 DeviceSettingsProvider(const NotifyObserversCallback& notify_cb, | 40 DeviceSettingsProvider(const NotifyObserversCallback& notify_cb, |
| 37 DeviceSettingsService* device_settings_service); | 41 DeviceSettingsService* device_settings_service); |
| 38 virtual ~DeviceSettingsProvider(); | 42 virtual ~DeviceSettingsProvider(); |
| 39 | 43 |
| 40 // Returns true if |path| is handled by this provider. | 44 // Returns true if |path| is handled by this provider. |
| 41 static bool IsDeviceSetting(const std::string& name); | 45 static bool IsDeviceSetting(const std::string& name); |
| 42 | 46 |
| 43 // CrosSettingsProvider implementation. | 47 // CrosSettingsProvider implementation. |
| 44 virtual const base::Value* Get(const std::string& path) const OVERRIDE; | 48 virtual const base::Value* Get(const std::string& path) const OVERRIDE; |
| 45 virtual TrustedStatus PrepareTrustedValues( | 49 virtual TrustedStatus PrepareTrustedValues( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 InitializationTestUnowned); | 169 InitializationTestUnowned); |
| 166 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, | 170 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, |
| 167 PolicyFailedPermanentlyNotification); | 171 PolicyFailedPermanentlyNotification); |
| 168 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); | 172 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); |
| 169 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); | 173 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); |
| 170 }; | 174 }; |
| 171 | 175 |
| 172 } // namespace chromeos | 176 } // namespace chromeos |
| 173 | 177 |
| 174 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 178 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
| OLD | NEW |