OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback_list.h" | 11 #include "base/callback_list.h" |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" | 15 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
16 #include "components/onc/onc_constants.h" | 16 #include "components/onc/onc_constants.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class ListValue; | 20 class ListValue; |
21 class Value; | 21 class Value; |
22 } | 22 } |
23 | 23 |
(...skipping 13 matching lines...) Expand all Loading... |
37 | 37 |
38 // Implements addtional special handling of ONC device policies, which requires | 38 // Implements addtional special handling of ONC device policies, which requires |
39 // listening for notifications from CrosSettings. | 39 // listening for notifications from CrosSettings. |
40 class DeviceNetworkConfigurationUpdater : public NetworkConfigurationUpdater { | 40 class DeviceNetworkConfigurationUpdater : public NetworkConfigurationUpdater { |
41 public: | 41 public: |
42 ~DeviceNetworkConfigurationUpdater() override; | 42 ~DeviceNetworkConfigurationUpdater() override; |
43 | 43 |
44 // Creates an updater that applies the ONC device policy from |policy_service| | 44 // Creates an updater that applies the ONC device policy from |policy_service| |
45 // once the policy service is completely initialized and on each policy | 45 // once the policy service is completely initialized and on each policy |
46 // change. The argument objects must outlive the returned updater. | 46 // change. The argument objects must outlive the returned updater. |
47 static scoped_ptr<DeviceNetworkConfigurationUpdater> CreateForDevicePolicy( | 47 static std::unique_ptr<DeviceNetworkConfigurationUpdater> |
| 48 CreateForDevicePolicy( |
48 PolicyService* policy_service, | 49 PolicyService* policy_service, |
49 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, | 50 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, |
50 chromeos::NetworkDeviceHandler* network_device_handler, | 51 chromeos::NetworkDeviceHandler* network_device_handler, |
51 chromeos::CrosSettings* cros_settings); | 52 chromeos::CrosSettings* cros_settings); |
52 | 53 |
53 private: | 54 private: |
54 DeviceNetworkConfigurationUpdater( | 55 DeviceNetworkConfigurationUpdater( |
55 PolicyService* policy_service, | 56 PolicyService* policy_service, |
56 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, | 57 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, |
57 chromeos::NetworkDeviceHandler* network_device_handler, | 58 chromeos::NetworkDeviceHandler* network_device_handler, |
58 chromeos::CrosSettings* cros_settings); | 59 chromeos::CrosSettings* cros_settings); |
59 | 60 |
60 void Init() override; | 61 void Init() override; |
61 void ImportCertificates(const base::ListValue& certificates_onc) override; | 62 void ImportCertificates(const base::ListValue& certificates_onc) override; |
62 void ApplyNetworkPolicy( | 63 void ApplyNetworkPolicy( |
63 base::ListValue* network_configs_onc, | 64 base::ListValue* network_configs_onc, |
64 base::DictionaryValue* global_network_config) override; | 65 base::DictionaryValue* global_network_config) override; |
65 void OnDataRoamingSettingChanged(); | 66 void OnDataRoamingSettingChanged(); |
66 | 67 |
67 chromeos::NetworkDeviceHandler* network_device_handler_; | 68 chromeos::NetworkDeviceHandler* network_device_handler_; |
68 chromeos::CrosSettings* cros_settings_; | 69 chromeos::CrosSettings* cros_settings_; |
69 scoped_ptr<base::CallbackList<void(void)>::Subscription> | 70 std::unique_ptr<base::CallbackList<void(void)>::Subscription> |
70 data_roaming_setting_subscription_; | 71 data_roaming_setting_subscription_; |
71 | 72 |
72 base::WeakPtrFactory<DeviceNetworkConfigurationUpdater> weak_factory_; | 73 base::WeakPtrFactory<DeviceNetworkConfigurationUpdater> weak_factory_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(DeviceNetworkConfigurationUpdater); | 75 DISALLOW_COPY_AND_ASSIGN(DeviceNetworkConfigurationUpdater); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace policy | 78 } // namespace policy |
78 | 79 |
79 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H
_ | 80 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_NETWORK_CONFIGURATION_UPDATER_H
_ |
80 | 81 |
OLD | NEW |