Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1218)

Unified Diff: chrome/browser/chromeos/policy/device_ad_policy_manager.h

Issue 2486813002: Add DeviceADPolicyManager to provide AD policy. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_ad_policy_manager.h
diff --git a/chrome/browser/chromeos/policy/device_ad_policy_manager.h b/chrome/browser/chromeos/policy/device_ad_policy_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3146fb087f2710d9dea41083433233f48f9e70a
--- /dev/null
+++ b/chrome/browser/chromeos/policy/device_ad_policy_manager.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// 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_DEVICE_AD_POLICY_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_AD_POLICY_MANAGER_H_
+
+#include <memory>
+
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/configuration_policy_provider.h"
+
+namespace policy {
+
+// ConfigurationPolicyProvider for policy from Active Directory. The policy is
+// fetched from the Domain Controller by authpolicyd which stores it in session
+// manager and from where it is loaded by DeviceADPolicyManager.
+// TODO(tnagel): Wire RefreshPolicies() through to authpolicyd.
+class DeviceADPolicyManager : public ConfigurationPolicyProvider,
emaxx 2016/11/11 15:25:08 I understand that unabbreviated "AD" will be quite
Thiemo Nagel 2016/11/16 19:11:01 I guess you're right. I'm converting it all, plea
+ public CloudPolicyStore::Observer {
+ public:
+ explicit DeviceADPolicyManager(std::unique_ptr<CloudPolicyStore> store);
+ ~DeviceADPolicyManager() override;
+
+ // ConfigurationPolicyProvider:
+ void Init(SchemaRegistry* registry) override;
+ void Shutdown() override;
+ bool IsInitializationComplete(PolicyDomain domain) const override;
+ void RefreshPolicies() override;
+
+ // CloudPolicyStore::Observer:
+ void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) override;
+ void OnStoreError(CloudPolicyStore* cloud_policy_store) override;
+
+ const CloudPolicyStore* store() const { return store_.get(); }
+
+ private:
+ // Publishes the policy that's currently cached in the store.
+ void PublishPolicy();
+
+ std::unique_ptr<CloudPolicyStore> store_;
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_AD_POLICY_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698