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 #include "components/policy/core/common/cloud/cloud_policy_manager.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 CloudPolicyClient* client) { | 112 CloudPolicyClient* client) { |
113 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 113 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
114 // Init() must have been called. | 114 // Init() must have been called. |
115 CHECK(schema_registry()); | 115 CHECK(schema_registry()); |
116 // Called at most once. | 116 // Called at most once. |
117 CHECK(!component_policy_service_); | 117 CHECK(!component_policy_service_); |
118 // The core can't be connected yet. | 118 // The core can't be connected yet. |
119 // See the comments on ComponentCloudPolicyService for the details. | 119 // See the comments on ComponentCloudPolicyService for the details. |
120 CHECK(!core()->client()); | 120 CHECK(!core()->client()); |
121 | 121 |
122 if (CommandLine::ForCurrentProcess()->HasSwitch( | 122 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
123 switches::kDisableComponentCloudPolicy) || | 123 switches::kDisableComponentCloudPolicy) || |
124 policy_cache_path.empty()) { | 124 policy_cache_path.empty()) { |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 // TODO(joaodasilva): Move the |file_task_runner_| to the blocking pool. | 128 // TODO(joaodasilva): Move the |file_task_runner_| to the blocking pool. |
129 // Currently it's not possible because the ComponentCloudPolicyStore is | 129 // Currently it's not possible because the ComponentCloudPolicyStore is |
130 // NonThreadSafe and doesn't support getting calls from different threads. | 130 // NonThreadSafe and doesn't support getting calls from different threads. |
131 scoped_ptr<ResourceCache> resource_cache( | 131 scoped_ptr<ResourceCache> resource_cache( |
132 new ResourceCache(policy_cache_path, file_task_runner_)); | 132 new ResourceCache(policy_cache_path, file_task_runner_)); |
(...skipping 17 matching lines...) Expand all Loading... |
150 } | 150 } |
151 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 151 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
152 } | 152 } |
153 | 153 |
154 void CloudPolicyManager::OnRefreshComplete(bool success) { | 154 void CloudPolicyManager::OnRefreshComplete(bool success) { |
155 waiting_for_policy_refresh_ = false; | 155 waiting_for_policy_refresh_ = false; |
156 CheckAndPublishPolicy(); | 156 CheckAndPublishPolicy(); |
157 } | 157 } |
158 | 158 |
159 } // namespace policy | 159 } // namespace policy |
OLD | NEW |