| Index: chrome/browser/chromeos/policy/device_local_account_policy_provider.h
|
| diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_provider.h b/chrome/browser/chromeos/policy/device_local_account_policy_provider.h
|
| index fa398154c1ec1a5234d15acda8d7d6e759707895..079f931493c6ec8ad48c0717edf6a416cbb75bed 100644
|
| --- a/chrome/browser/chromeos/policy/device_local_account_policy_provider.h
|
| +++ b/chrome/browser/chromeos/policy/device_local_account_policy_provider.h
|
| @@ -14,6 +14,8 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
|
| #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
|
| +#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
|
| +#include "components/policy/core/common/cloud/resource_cache.h"
|
| #include "components/policy/core/common/configuration_policy_provider.h"
|
|
|
| namespace policy {
|
| @@ -27,7 +29,8 @@ class PolicyMap;
|
| // and RefreshPolicies becomes a no-op.
|
| class DeviceLocalAccountPolicyProvider
|
| : public ConfigurationPolicyProvider,
|
| - public DeviceLocalAccountPolicyService::Observer {
|
| + public DeviceLocalAccountPolicyService::Observer,
|
| + public ComponentCloudPolicyService::Delegate {
|
| public:
|
| DeviceLocalAccountPolicyProvider(
|
| const std::string& user_id,
|
| @@ -43,12 +46,19 @@ class DeviceLocalAccountPolicyProvider
|
| DeviceLocalAccountPolicyService* service);
|
|
|
| // ConfigurationPolicyProvider:
|
| + virtual void Init(SchemaRegistry* registry) OVERRIDE;
|
| virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE;
|
| virtual void RefreshPolicies() OVERRIDE;
|
| + virtual void Shutdown() OVERRIDE;
|
|
|
| // DeviceLocalAccountPolicyService::Observer:
|
| virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE;
|
| virtual void OnDeviceLocalAccountsChanged() OVERRIDE;
|
| + virtual void OnBrokerShutdown(
|
| + DeviceLocalAccountPolicyBroker* broker) OVERRIDE;
|
| +
|
| + // ComponentCloudPolicyService::Delegate:
|
| + virtual void OnComponentCloudPolicyUpdated() OVERRIDE;
|
|
|
| private:
|
| // Returns the broker for |user_id_| or NULL if not available.
|
| @@ -62,6 +72,10 @@ class DeviceLocalAccountPolicyProvider
|
| // policy from the broker if available or keeping the current policy.
|
| void UpdateFromBroker();
|
|
|
| + // Creates the |component_policy_service_| if it hasn't been created yet
|
| + // and all the dependencies are in place.
|
| + void MaybeCreateComponentPolicyService();
|
| +
|
| const std::string user_id_;
|
| scoped_refptr<DeviceLocalAccountExternalDataManager> external_data_manager_;
|
|
|
| @@ -75,6 +89,8 @@ class DeviceLocalAccountPolicyProvider
|
| bool store_initialized_;
|
| bool waiting_for_policy_refresh_;
|
|
|
| + scoped_ptr<ComponentCloudPolicyService> component_policy_service_;
|
| +
|
| base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider);
|
|
|