| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_ACTIVE_DIRECTORY_POLICY_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_ACTIVE_DIRECTORY_POLICY_MANAGER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 11 #include "components/policy/core/common/configuration_policy_provider.h" |
| 12 |
| 13 namespace policy { |
| 14 |
| 15 // ConfigurationPolicyProvider for policy from Active Directory. The policy is |
| 16 // fetched from the Domain Controller by authpolicyd which stores it in session |
| 17 // manager and from where it is loaded by DeviceActiveDirectoryPolicyManager. |
| 18 // TODO(tnagel): Wire RefreshPolicies() through to authpolicyd. |
| 19 class DeviceActiveDirectoryPolicyManager : public ConfigurationPolicyProvider, |
| 20 public CloudPolicyStore::Observer { |
| 21 public: |
| 22 explicit DeviceActiveDirectoryPolicyManager( |
| 23 std::unique_ptr<CloudPolicyStore> store); |
| 24 ~DeviceActiveDirectoryPolicyManager() override; |
| 25 |
| 26 // ConfigurationPolicyProvider: |
| 27 void Init(SchemaRegistry* registry) override; |
| 28 void Shutdown() override; |
| 29 bool IsInitializationComplete(PolicyDomain domain) const override; |
| 30 void RefreshPolicies() override; |
| 31 |
| 32 // CloudPolicyStore::Observer: |
| 33 void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) override; |
| 34 void OnStoreError(CloudPolicyStore* cloud_policy_store) override; |
| 35 |
| 36 const CloudPolicyStore* store() const { return store_.get(); } |
| 37 |
| 38 private: |
| 39 // Publishes the policy that's currently cached in the store. |
| 40 void PublishPolicy(); |
| 41 |
| 42 std::unique_ptr<CloudPolicyStore> store_; |
| 43 }; |
| 44 |
| 45 } // namespace policy |
| 46 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_ACTIVE_DIRECTORY_POLICY_MANAGER
_H_ |
| OLD | NEW |