| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/policy/profile_policy_connector_factory.h" | 5 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (user_cloud_policy_manager) { | 144 if (user_cloud_policy_manager) { |
| 145 policy_provider = user_cloud_policy_manager; | 145 policy_provider = user_cloud_policy_manager; |
| 146 policy_store = user_cloud_policy_manager->core()->store(); | 146 policy_store = user_cloud_policy_manager->core()->store(); |
| 147 } | 147 } |
| 148 #endif // defined(OS_CHROMEOS) | 148 #endif // defined(OS_CHROMEOS) |
| 149 | 149 |
| 150 std::unique_ptr<ProfilePolicyConnector> connector( | 150 std::unique_ptr<ProfilePolicyConnector> connector( |
| 151 new ProfilePolicyConnector()); | 151 new ProfilePolicyConnector()); |
| 152 | 152 |
| 153 if (test_providers_.empty()) { | 153 if (test_providers_.empty()) { |
| 154 connector->Init(user, schema_registry, policy_provider, policy_store); | 154 connector->Init(user, schema_registry, policy_provider, policy_store, |
| 155 force_immediate_load); |
| 155 } else { | 156 } else { |
| 156 PolicyServiceImpl::Providers providers; | 157 PolicyServiceImpl::Providers providers; |
| 157 providers.push_back(test_providers_.front()); | 158 providers.push_back(test_providers_.front()); |
| 158 test_providers_.pop_front(); | 159 test_providers_.pop_front(); |
| 159 std::unique_ptr<PolicyService> service(new PolicyServiceImpl(providers)); | 160 std::unique_ptr<PolicyService> service(new PolicyServiceImpl(providers)); |
| 160 connector->InitForTesting(std::move(service)); | 161 connector->InitForTesting(std::move(service)); |
| 161 } | 162 } |
| 162 | 163 |
| 163 connectors_[context] = connector.get(); | 164 connectors_[context] = connector.get(); |
| 164 return connector; | 165 return connector; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 186 | 187 |
| 187 bool ProfilePolicyConnectorFactory::HasTestingFactory( | 188 bool ProfilePolicyConnectorFactory::HasTestingFactory( |
| 188 content::BrowserContext* context) { | 189 content::BrowserContext* context) { |
| 189 return false; | 190 return false; |
| 190 } | 191 } |
| 191 | 192 |
| 192 void ProfilePolicyConnectorFactory::CreateServiceNow( | 193 void ProfilePolicyConnectorFactory::CreateServiceNow( |
| 193 content::BrowserContext* context) {} | 194 content::BrowserContext* context) {} |
| 194 | 195 |
| 195 } // namespace policy | 196 } // namespace policy |
| OLD | NEW |