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_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H
_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H
_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H
_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H
_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/cros/network_constants.h" | 10 #include "chrome/browser/chromeos/cros/network_constants.h" |
11 #include "chrome/browser/chromeos/cros/network_library.h" | 11 #include "chrome/browser/chromeos/cros/network_library.h" |
12 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" | 12 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
13 #include "chrome/browser/policy/policy_service.h" | 13 #include "chrome/browser/policy/policy_service.h" |
14 #include "chromeos/network/network_ui_data.h" | 14 #include "chromeos/network/network_ui_data.h" |
15 #include "chromeos/network/onc/onc_constants.h" | 15 #include "chromeos/network/onc/onc_constants.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class Value; | 18 class Value; |
19 } | 19 } |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 class CertificateHandler; | 22 namespace onc { |
| 23 class CertificateImporter; |
| 24 } |
23 } | 25 } |
24 | 26 |
25 namespace policy { | 27 namespace policy { |
26 | 28 |
27 class PolicyMap; | 29 class PolicyMap; |
28 | 30 |
29 // DEPRECATED: will be replaced by NetworkConfigurationImpl. | 31 // DEPRECATED: will be replaced by NetworkConfigurationImpl. |
30 // This implementation pushes policies through the NetworkLibrary. It applies | 32 // This implementation pushes policies through the NetworkLibrary. It applies |
31 // network policies every time one of the relevant policies or Shill's profiles | 33 // network policies every time one of the relevant policies or Shill's profiles |
32 // changed or OnUserPolicyInitialized() is called. If the user policy is | 34 // changed or OnUserPolicyInitialized() is called. If the user policy is |
33 // available, always both the device and the user policy are applied. Otherwise | 35 // available, always both the device and the user policy are applied. Otherwise |
34 // only the device policy is applied. | 36 // only the device policy is applied. |
35 class NetworkConfigurationUpdaterImplCros | 37 class NetworkConfigurationUpdaterImplCros |
36 : public NetworkConfigurationUpdater, | 38 : public NetworkConfigurationUpdater, |
37 public chromeos::NetworkLibrary::NetworkProfileObserver, | 39 public chromeos::NetworkLibrary::NetworkProfileObserver, |
38 public PolicyService::Observer { | 40 public PolicyService::Observer { |
39 public: | 41 public: |
40 // The pointer |device_policy_service| is stored. The caller must guarantee | 42 // The pointer |device_policy_service| is stored. The caller must guarantee |
41 // that it's outliving the updater. | 43 // that it's outliving the updater. |
42 NetworkConfigurationUpdaterImplCros( | 44 NetworkConfigurationUpdaterImplCros( |
43 PolicyService* device_policy_service, | 45 PolicyService* device_policy_service, |
44 chromeos::NetworkLibrary* network_library, | 46 chromeos::NetworkLibrary* network_library, |
45 scoped_ptr<chromeos::CertificateHandler> certificate_handler); | 47 scoped_ptr<chromeos::onc::CertificateImporter> certificate_importer); |
46 virtual ~NetworkConfigurationUpdaterImplCros(); | 48 virtual ~NetworkConfigurationUpdaterImplCros(); |
47 | 49 |
48 // NetworkProfileObserver overrides. | 50 // NetworkProfileObserver overrides. |
49 virtual void OnProfileListChanged() OVERRIDE; | 51 virtual void OnProfileListChanged() OVERRIDE; |
50 | 52 |
51 // NetworkConfigurationUpdater overrides. | 53 // NetworkConfigurationUpdater overrides. |
52 | 54 |
53 // In this implementation, this function applies both device and user policy. | 55 // In this implementation, this function applies both device and user policy. |
54 virtual void SetUserPolicyService( | 56 virtual void SetUserPolicyService( |
55 bool allow_trusted_certs_from_policy, | 57 bool allow_trusted_certs_from_policy, |
(...skipping 25 matching lines...) Expand all Loading... |
81 void ApplyNetworkConfiguration(const std::string& policy_key, | 83 void ApplyNetworkConfiguration(const std::string& policy_key, |
82 chromeos::onc::ONCSource onc_source, | 84 chromeos::onc::ONCSource onc_source, |
83 PolicyService* policy_service); | 85 PolicyService* policy_service); |
84 | 86 |
85 // Wraps the policy service we read network configuration from. | 87 // Wraps the policy service we read network configuration from. |
86 PolicyChangeRegistrar policy_change_registrar_; | 88 PolicyChangeRegistrar policy_change_registrar_; |
87 | 89 |
88 // Network library to write network configuration to. | 90 // Network library to write network configuration to. |
89 chromeos::NetworkLibrary* network_library_; | 91 chromeos::NetworkLibrary* network_library_; |
90 | 92 |
91 scoped_ptr<chromeos::CertificateHandler> certificate_handler_; | 93 scoped_ptr<chromeos::onc::CertificateImporter> certificate_importer_; |
92 | 94 |
93 // Needed to check whether user policies are ready. | 95 // Needed to check whether user policies are ready. |
94 // Unowned. | 96 // Unowned. |
95 PolicyService* user_policy_service_; | 97 PolicyService* user_policy_service_; |
96 | 98 |
97 // The device policy service storing the ONC policies. Also needed to check | 99 // The device policy service storing the ONC policies. Also needed to check |
98 // whether device policies are ready. | 100 // whether device policies are ready. |
99 // Unowned. | 101 // Unowned. |
100 PolicyService* device_policy_service_; | 102 PolicyService* device_policy_service_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImplCros); | 104 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImplCros); |
103 }; | 105 }; |
104 | 106 |
105 } // namespace policy | 107 } // namespace policy |
106 | 108 |
107 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CRO
S_H_ | 109 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CRO
S_H_ |
OLD | NEW |