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

Side by Side Diff: chrome/browser/chromeos/policy/device_active_directory_policy_manager.h

Issue 2638623006: Merge {Device,User}ActiveDirectoryPolicyManager into a single class (Closed)
Patch Set: Have factories return unique_ptr Created 3 years, 11 months 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 unified diff | Download patch
OLDNEW
(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 "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "components/policy/core/common/cloud/cloud_policy_store.h"
13 #include "components/policy/core/common/configuration_policy_provider.h"
14
15 namespace policy {
16
17 // ConfigurationPolicyProvider for policy from Active Directory. The policy is
18 // fetched from the Domain Controller by authpolicyd which stores it in session
19 // manager and from where it is loaded by DeviceActiveDirectoryPolicyManager.
20 class DeviceActiveDirectoryPolicyManager : public ConfigurationPolicyProvider,
21 public CloudPolicyStore::Observer {
22 public:
23 explicit DeviceActiveDirectoryPolicyManager(
24 std::unique_ptr<CloudPolicyStore> store);
25 ~DeviceActiveDirectoryPolicyManager() override;
26
27 // ConfigurationPolicyProvider:
28 void Init(SchemaRegistry* registry) override;
29 void Shutdown() override;
30 bool IsInitializationComplete(PolicyDomain domain) const override;
31 void RefreshPolicies() override;
32
33 // CloudPolicyStore::Observer:
34 void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) override;
35 void OnStoreError(CloudPolicyStore* cloud_policy_store) override;
36
37 CloudPolicyStore* store() const { return store_.get(); }
38
39 private:
40 // Publishes the policy that's currently cached in the store.
41 void PublishPolicy();
42
43 // Callback from authpolicyd.
44 void OnPolicyRefreshed(bool success);
45
46 std::unique_ptr<CloudPolicyStore> store_;
47
48 // Must be last member.
49 base::WeakPtrFactory<DeviceActiveDirectoryPolicyManager> weak_ptr_factory_;
50
51 DISALLOW_COPY_AND_ASSIGN(DeviceActiveDirectoryPolicyManager);
52 };
53
54 } // namespace policy
55
56 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_ACTIVE_DIRECTORY_POLICY_MANAGER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698