Index: chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h |
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.h b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h |
similarity index 52% |
copy from chrome/browser/chromeos/policy/network_configuration_updater.h |
copy to chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h |
index 5872e8c038c960d15cf51b3c87e1a7cbac38ecc0..fca611fca3527da905d33dcefa529ddbb9f8aaa7 100644 |
--- a/chrome/browser/chromeos/policy/network_configuration_updater.h |
+++ b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h |
@@ -2,13 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
-#define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
+#ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H_ |
+#define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H_ |
#include <string> |
#include "chrome/browser/chromeos/cros/network_constants.h" |
#include "chrome/browser/chromeos/cros/network_library.h" |
+#include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
#include "chrome/browser/policy/policy_service.h" |
#include "chromeos/network/network_ui_data.h" |
#include "chromeos/network/onc/onc_constants.h" |
@@ -17,52 +18,34 @@ namespace base { |
class Value; |
} |
-namespace net { |
-class CertTrustAnchorProvider; |
-} |
- |
namespace policy { |
class PolicyMap; |
-// Keeps track of the network configuration policy settings and Shill's |
-// profiles. Requests the NetworkLibrary to apply the ONC of the network |
-// policies every time one of the relevant policies or Shill's profiles changes |
-// or OnUserPolicyInitialized() is called. If the user policy is available, |
-// always both the device and the user policy are applied. Otherwise only the |
-// device policy is applied. |
-class NetworkConfigurationUpdater |
- : public chromeos::NetworkLibrary::NetworkProfileObserver { |
+// DEPRECATED: will be replaced by NetworkConfigurationImpl. |
+// This implementation pushes policies through the NetworkLibrary. It applies |
+// network policies every time one of the relevant policies or Shill's profiles |
+// changed or OnUserPolicyInitialized() is called. If the user policy is |
+// available, always both the device and the user policy are applied. Otherwise |
+// only the device policy is applied. |
+class NetworkConfigurationUpdaterImplCros |
+ : public NetworkConfigurationUpdater, |
+ public chromeos::NetworkLibrary::NetworkProfileObserver { |
public: |
- NetworkConfigurationUpdater(PolicyService* policy_service, |
- chromeos::NetworkLibrary* network_library); |
- virtual ~NetworkConfigurationUpdater(); |
+ NetworkConfigurationUpdaterImplCros( |
+ PolicyService* policy_service, |
+ chromeos::NetworkLibrary* network_library); |
+ virtual ~NetworkConfigurationUpdaterImplCros(); |
// NetworkProfileObserver overrides. |
virtual void OnProfileListChanged() OVERRIDE; |
- // Notifies this updater that the user policy is initialized. Before this |
- // function is called, the user policy is not applied. Afterwards, always both |
- // device and user policy are applied as described in the class comment. This |
- // function also triggers an immediate policy application of both device and |
- // user policy. |
- void OnUserPolicyInitialized(); |
- |
- // Web trust isn't given to certificates imported from ONC by default. Setting |
- // |allow| to true allows giving Web trust to the certificates that |
- // request it. |
- void set_allow_trusted_certificates_from_policy(bool allow) { |
- allow_trusted_certificates_from_policy_ = allow; |
- } |
- |
- // Returns a CertTrustAnchorProvider that provides the list of server and |
- // CA certificates with the Web trust flag set that were retrieved from the |
- // last user ONC policy update. |
- // This getter must be used on the UI thread, and the provider must be used |
- // on the IO thread. It is only valid as long as the |
- // NetworkConfigurationUpdater is valid; the NetworkConfigurationUpdater |
- // outlives all the profiles, and deletes the provider on the IO thread. |
- net::CertTrustAnchorProvider* GetCertTrustAnchorProvider(); |
+ // NetworkConfigurationUpdater overrides. |
+ |
+ // In this implementation, this function applies both device and user policy. |
+ virtual void OnUserPolicyInitialized() OVERRIDE; |
+ virtual void set_allow_trusted_certificates_from_policy(bool allow) OVERRIDE; |
+ virtual net::CertTrustAnchorProvider* GetCertTrustAnchorProvider() OVERRIDE; |
private: |
// Callback that's called by |policy_service_| if the respective ONC policy |
@@ -100,9 +83,9 @@ class NetworkConfigurationUpdater |
// lives on the IO thread. |
net::CertTrustAnchorProvider* cert_trust_provider_; |
- DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); |
+ DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImplCros); |
}; |
} // namespace policy |
-#endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_CROS_H_ |