| Index: chrome/browser/chromeos/policy/network_configuration_updater.h
|
| diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.h b/chrome/browser/chromeos/policy/network_configuration_updater.h
|
| index 5872e8c038c960d15cf51b3c87e1a7cbac38ecc0..70634255bafe406d005ae718c46f1c476d79dd48 100644
|
| --- a/chrome/browser/chromeos/policy/network_configuration_updater.h
|
| +++ b/chrome/browser/chromeos/policy/network_configuration_updater.h
|
| @@ -5,17 +5,7 @@
|
| #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
|
| #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
|
|
|
| -#include <string>
|
| -
|
| -#include "chrome/browser/chromeos/cros/network_constants.h"
|
| -#include "chrome/browser/chromeos/cros/network_library.h"
|
| -#include "chrome/browser/policy/policy_service.h"
|
| -#include "chromeos/network/network_ui_data.h"
|
| -#include "chromeos/network/onc/onc_constants.h"
|
| -
|
| -namespace base {
|
| -class Value;
|
| -}
|
| +#include "base/basictypes.h"
|
|
|
| namespace net {
|
| class CertTrustAnchorProvider;
|
| @@ -23,37 +13,26 @@ 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 {
|
| +// Keeps track of the network configuration policy settings and pushes changes
|
| +// to the respective configuration backend, which in turn writes configurations
|
| +// to Shill.
|
| +class NetworkConfigurationUpdater {
|
| public:
|
| - NetworkConfigurationUpdater(PolicyService* policy_service,
|
| - chromeos::NetworkLibrary* network_library);
|
| - virtual ~NetworkConfigurationUpdater();
|
| -
|
| - // NetworkProfileObserver overrides.
|
| - virtual void OnProfileListChanged() OVERRIDE;
|
| + NetworkConfigurationUpdater() {}
|
| + virtual ~NetworkConfigurationUpdater() {}
|
|
|
| // 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();
|
| + // function is called, the user policy is not applied. This function may
|
| + // trigger immediate policy applications.
|
| + virtual void OnUserPolicyInitialized() = 0;
|
| +
|
| + // TODO(pneubeck): Extract the following two certificate related functions
|
| + // into a separate CertificateUpdater.
|
|
|
| // 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;
|
| - }
|
| + virtual void set_allow_trusted_certificates_from_policy(bool allow) = 0;
|
|
|
| // Returns a CertTrustAnchorProvider that provides the list of server and
|
| // CA certificates with the Web trust flag set that were retrieved from the
|
| @@ -62,44 +41,9 @@ class NetworkConfigurationUpdater
|
| // 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();
|
| + virtual net::CertTrustAnchorProvider* GetCertTrustAnchorProvider() = 0;
|
|
|
| private:
|
| - // Callback that's called by |policy_service_| if the respective ONC policy
|
| - // changed.
|
| - void OnPolicyChanged(chromeos::onc::ONCSource onc_source,
|
| - const base::Value* previous,
|
| - const base::Value* current);
|
| -
|
| - // Retrieves the ONC policies from |policy_service_| and pushes the
|
| - // configurations to |network_library_|. Ensures that a device policy is
|
| - // always overwritten by a user policy.
|
| - void ApplyNetworkConfigurations();
|
| -
|
| - // Push the policy stored at |policy_key| for |onc_source| to
|
| - // |network_library_|.
|
| - void ApplyNetworkConfiguration(const std::string& policy_key,
|
| - chromeos::onc::ONCSource onc_source);
|
| -
|
| - // Wraps the policy service we read network configuration from.
|
| - PolicyChangeRegistrar policy_change_registrar_;
|
| -
|
| - // Network library to write network configuration to.
|
| - chromeos::NetworkLibrary* network_library_;
|
| -
|
| - // Whether the user policy is already available.
|
| - bool user_policy_initialized_;
|
| -
|
| - // Whether Web trust is allowed or not.
|
| - bool allow_trusted_certificates_from_policy_;
|
| -
|
| - // The policy service storing the ONC policies.
|
| - PolicyService* policy_service_;
|
| -
|
| - // An implementation of CertTrustAnchorProvider. Owned by the updater, but
|
| - // lives on the IO thread.
|
| - net::CertTrustAnchorProvider* cert_trust_provider_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater);
|
| };
|
|
|
|
|