Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 public CloudPolicyStore::Observer, | 42 public CloudPolicyStore::Observer, |
| 43 public ComponentCloudPolicyService::Delegate { | 43 public ComponentCloudPolicyService::Delegate { |
| 44 public: | 44 public: |
| 45 // |task_runner| is the runner for policy refresh tasks. | 45 // |task_runner| is the runner for policy refresh tasks. |
| 46 // |file_task_runner| is used for file operations. Currently this must be the | 46 // |file_task_runner| is used for file operations. Currently this must be the |
| 47 // FILE BrowserThread. | 47 // FILE BrowserThread. |
| 48 // |io_task_runner| is used for network IO. Currently this must be the IO | 48 // |io_task_runner| is used for network IO. Currently this must be the IO |
| 49 // BrowserThread. | 49 // BrowserThread. |
| 50 CloudPolicyManager( | 50 CloudPolicyManager( |
| 51 const PolicyNamespaceKey& policy_ns_key, | 51 const PolicyNamespaceKey& policy_ns_key, |
| 52 const std::string& verification_key_hash, | |
|
Mattias Nissler (ping if slow)
2014/01/27 13:52:13
Does this make sense here? The class itself doesn'
Andrew T Wilson (Slow)
2014/01/30 17:10:31
Yeah, I had this idea that CPM would be the holder
| |
| 52 CloudPolicyStore* cloud_policy_store, | 53 CloudPolicyStore* cloud_policy_store, |
| 53 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 54 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
| 54 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, | 55 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, |
| 55 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | 56 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); |
| 56 virtual ~CloudPolicyManager(); | 57 virtual ~CloudPolicyManager(); |
| 57 | 58 |
| 58 CloudPolicyCore* core() { return &core_; } | 59 CloudPolicyCore* core() { return &core_; } |
| 59 const CloudPolicyCore* core() const { return &core_; } | 60 const CloudPolicyCore* core() const { return &core_; } |
| 60 | 61 |
| 61 // ConfigurationPolicyProvider: | 62 // ConfigurationPolicyProvider: |
| 62 virtual void Shutdown() OVERRIDE; | 63 virtual void Shutdown() OVERRIDE; |
| 63 virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE; | 64 virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE; |
| 64 virtual void RefreshPolicies() OVERRIDE; | 65 virtual void RefreshPolicies() OVERRIDE; |
| 65 | 66 |
| 66 // CloudPolicyStore::Observer: | 67 // CloudPolicyStore::Observer: |
| 67 virtual void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) OVERRIDE; | 68 virtual void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) OVERRIDE; |
| 68 virtual void OnStoreError(CloudPolicyStore* cloud_policy_store) OVERRIDE; | 69 virtual void OnStoreError(CloudPolicyStore* cloud_policy_store) OVERRIDE; |
| 69 | 70 |
| 70 // ComponentCloudPolicyService::Delegate: | 71 // ComponentCloudPolicyService::Delegate: |
| 71 virtual void OnComponentCloudPolicyUpdated() OVERRIDE; | 72 virtual void OnComponentCloudPolicyUpdated() OVERRIDE; |
| 72 | 73 |
| 74 // Identifier for which verification key this chrome instance uses. | |
| 75 const std::string& verification_key_hash() { return verification_key_hash_; } | |
| 76 | |
| 73 protected: | 77 protected: |
| 74 // Check whether fully initialized and if so, publish policy by calling | 78 // Check whether fully initialized and if so, publish policy by calling |
| 75 // ConfigurationPolicyStore::UpdatePolicy(). | 79 // ConfigurationPolicyStore::UpdatePolicy(). |
| 76 void CheckAndPublishPolicy(); | 80 void CheckAndPublishPolicy(); |
| 77 | 81 |
| 78 void CreateComponentCloudPolicyService( | 82 void CreateComponentCloudPolicyService( |
| 79 const base::FilePath& policy_cache_path, | 83 const base::FilePath& policy_cache_path, |
| 80 const scoped_refptr<net::URLRequestContextGetter>& request_context); | 84 const scoped_refptr<net::URLRequestContextGetter>& request_context); |
| 81 | 85 |
| 82 void ClearAndDestroyComponentCloudPolicyService(); | 86 void ClearAndDestroyComponentCloudPolicyService(); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 96 // Completion handler for policy refresh operations. | 100 // Completion handler for policy refresh operations. |
| 97 void OnRefreshComplete(bool success); | 101 void OnRefreshComplete(bool success); |
| 98 | 102 |
| 99 CloudPolicyCore core_; | 103 CloudPolicyCore core_; |
| 100 scoped_ptr<ComponentCloudPolicyService> component_policy_service_; | 104 scoped_ptr<ComponentCloudPolicyService> component_policy_service_; |
| 101 | 105 |
| 102 // Whether there's a policy refresh operation pending, in which case all | 106 // Whether there's a policy refresh operation pending, in which case all |
| 103 // policy update notifications are deferred until after it completes. | 107 // policy update notifications are deferred until after it completes. |
| 104 bool waiting_for_policy_refresh_; | 108 bool waiting_for_policy_refresh_; |
| 105 | 109 |
| 110 // Identifier for which signing key is supported by this instance of Chrome. | |
| 111 std::string verification_key_hash_; | |
| 112 | |
| 106 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 113 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
| 107 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; | 114 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; |
| 108 | 115 |
| 109 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); | 116 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); |
| 110 }; | 117 }; |
| 111 | 118 |
| 112 } // namespace policy | 119 } // namespace policy |
| 113 | 120 |
| 114 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ | 121 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
| OLD | NEW |