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 #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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "components/policy/core/common/cloud/cloud_policy_service.h" | 13 #include "components/policy/core/common/cloud/cloud_policy_service.h" |
| 14 #include "components/policy/core/common/policy_bundle.h" | 14 #include "components/policy/core/common/policy_bundle.h" |
| 15 #include "components/policy/core/common/policy_map.h" | 15 #include "components/policy/core/common/policy_map.h" |
| 16 #include "components/policy/core/common/policy_switches.h" | 16 #include "components/policy/core/common/policy_switches.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 18 | 18 |
| 19 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 19 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 20 #include "components/policy/core/common/cloud/resource_cache.h" | 20 #include "components/policy/core/common/cloud/resource_cache.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace policy { | 23 namespace policy { |
| 24 | 24 |
| 25 CloudPolicyManager::CloudPolicyManager( | 25 CloudPolicyManager::CloudPolicyManager( |
| 26 const PolicyNamespaceKey& policy_ns_key, | 26 const std::string& policy_type, |
| 27 CloudPolicyStore* cloud_policy_store, | 27 CloudPolicyStore* cloud_policy_store, |
| 28 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 28 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
| 29 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, | 29 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, |
| 30 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) | 30 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) |
| 31 : core_(policy_ns_key, cloud_policy_store, task_runner), | 31 : core_(policy_type, "", cloud_policy_store, task_runner), |
|
Mattias Nissler (ping if slow)
2014/11/27 08:34:10
std::string() instead of ""?
Joao da Silva
2014/11/27 12:19:31
Done.
| |
| 32 waiting_for_policy_refresh_(false), | 32 waiting_for_policy_refresh_(false), |
| 33 file_task_runner_(file_task_runner), | 33 file_task_runner_(file_task_runner), |
| 34 io_task_runner_(io_task_runner) { | 34 io_task_runner_(io_task_runner) { |
| 35 store()->AddObserver(this); | 35 store()->AddObserver(this); |
| 36 | 36 |
| 37 // If the underlying store is already initialized, publish the loaded | 37 // If the underlying store is already initialized, publish the loaded |
| 38 // policy. Otherwise, request a load now. | 38 // policy. Otherwise, request a load now. |
| 39 if (store()->is_initialized()) | 39 if (store()->is_initialized()) |
| 40 CheckAndPublishPolicy(); | 40 CheckAndPublishPolicy(); |
| 41 else | 41 else |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 } | 144 } |
| 145 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 145 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 146 } | 146 } |
| 147 | 147 |
| 148 void CloudPolicyManager::OnRefreshComplete(bool success) { | 148 void CloudPolicyManager::OnRefreshComplete(bool success) { |
| 149 waiting_for_policy_refresh_ = false; | 149 waiting_for_policy_refresh_ = false; |
| 150 CheckAndPublishPolicy(); | 150 CheckAndPublishPolicy(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace policy | 153 } // namespace policy |
| OLD | NEW |