| 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 <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 14 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 15 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 15 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 16 #include "components/policy/core/common/cloud/component_cloud_policy_service.h" | 16 #include "components/policy/core/common/cloud/component_cloud_policy_service.h" |
| 17 #include "components/policy/core/common/configuration_policy_provider.h" | 17 #include "components/policy/core/common/configuration_policy_provider.h" |
| 18 #include "components/policy/policy_export.h" | 18 #include "components/policy/policy_export.h" |
| 19 #include "components/prefs/pref_member.h" | 19 #include "components/prefs/pref_member.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class FilePath; | 22 class FilePath; |
| 23 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const CloudPolicyService* service() const { return core_.service(); } | 98 const CloudPolicyService* service() const { return core_.service(); } |
| 99 ComponentCloudPolicyService* component_policy_service() const { | 99 ComponentCloudPolicyService* component_policy_service() const { |
| 100 return component_policy_service_.get(); | 100 return component_policy_service_.get(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 // Completion handler for policy refresh operations. | 104 // Completion handler for policy refresh operations. |
| 105 void OnRefreshComplete(bool success); | 105 void OnRefreshComplete(bool success); |
| 106 | 106 |
| 107 CloudPolicyCore core_; | 107 CloudPolicyCore core_; |
| 108 scoped_ptr<ComponentCloudPolicyService> component_policy_service_; | 108 std::unique_ptr<ComponentCloudPolicyService> component_policy_service_; |
| 109 | 109 |
| 110 // Whether there's a policy refresh operation pending, in which case all | 110 // Whether there's a policy refresh operation pending, in which case all |
| 111 // policy update notifications are deferred until after it completes. | 111 // policy update notifications are deferred until after it completes. |
| 112 bool waiting_for_policy_refresh_; | 112 bool waiting_for_policy_refresh_; |
| 113 | 113 |
| 114 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 114 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
| 115 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; | 115 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); | 117 DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace policy | 120 } // namespace policy |
| 121 | 121 |
| 122 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ | 122 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_MANAGER_H_ |
| OLD | NEW |