OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 return std::string(); | 195 return std::string(); |
196 } | 196 } |
197 | 197 |
198 void BrowserPolicyConnector::ResetDevicePolicy() { | 198 void BrowserPolicyConnector::ResetDevicePolicy() { |
199 #if defined(OS_CHROMEOS) | 199 #if defined(OS_CHROMEOS) |
200 if (device_cloud_policy_subsystem_.get()) | 200 if (device_cloud_policy_subsystem_.get()) |
201 device_cloud_policy_subsystem_->Reset(); | 201 device_cloud_policy_subsystem_->Reset(); |
202 #endif | 202 #endif |
203 } | 203 } |
204 | 204 |
205 void BrowserPolicyConnector::FetchDevicePolicy() { | 205 void BrowserPolicyConnector::FetchCloudPolicy() { |
206 #if defined(OS_CHROMEOS) | 206 #if defined(OS_CHROMEOS) |
207 if (device_data_store_.get()) { | 207 if (device_data_store_.get()) |
208 device_data_store_->NotifyDeviceTokenChanged(); | 208 device_data_store_->NotifyDeviceTokenChanged(); |
209 } | 209 if (user_data_store_.get()) |
210 user_data_store_->NotifyDeviceTokenChanged(); | |
210 #endif | 211 #endif |
211 } | 212 } |
212 | 213 |
213 void BrowserPolicyConnector::FetchUserPolicy() { | 214 void BrowserPolicyConnector::RefreshPolicies() { |
214 #if defined(OS_CHROMEOS) | 215 if (managed_platform_provider_.get()) |
215 if (user_data_store_.get()) { | 216 managed_cloud_provider_->RefreshPolicies(); |
216 user_data_store_->NotifyDeviceTokenChanged(); | 217 if (recommended_platform_provider_.get()) |
217 } | 218 recommended_cloud_provider_->RefreshPolicies(); |
218 #endif | 219 if (managed_cloud_provider_.get()) |
220 managed_cloud_provider_->RefreshPolicies(); | |
221 if (recommended_cloud_provider_.get()) | |
222 recommended_cloud_provider_->RefreshPolicies(); | |
Mattias Nissler (ping if slow)
2011/11/18 14:49:32
So here is where we have both cloud providers call
Joao da Silva
2011/11/18 15:39:18
Yes. The 2nd call will cancel the posting of DoWor
| |
219 } | 223 } |
220 | 224 |
221 void BrowserPolicyConnector::ScheduleServiceInitialization( | 225 void BrowserPolicyConnector::ScheduleServiceInitialization( |
222 int64 delay_milliseconds) { | 226 int64 delay_milliseconds) { |
223 if (user_cloud_policy_subsystem_.get()) { | 227 if (user_cloud_policy_subsystem_.get()) { |
224 user_cloud_policy_subsystem_-> | 228 user_cloud_policy_subsystem_-> |
225 ScheduleServiceInitialization(delay_milliseconds); | 229 ScheduleServiceInitialization(delay_milliseconds); |
226 } | 230 } |
227 #if defined(OS_CHROMEOS) | 231 #if defined(OS_CHROMEOS) |
228 if (device_cloud_policy_subsystem_.get()) { | 232 if (device_cloud_policy_subsystem_.get()) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 | 350 |
347 return CloudPolicyDataStore::USER_AFFILIATION_NONE; | 351 return CloudPolicyDataStore::USER_AFFILIATION_NONE; |
348 } | 352 } |
349 | 353 |
350 BrowserPolicyConnector::BrowserPolicyConnector() | 354 BrowserPolicyConnector::BrowserPolicyConnector() |
351 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 355 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
352 managed_platform_provider_.reset(CreateManagedPlatformProvider()); | 356 managed_platform_provider_.reset(CreateManagedPlatformProvider()); |
353 recommended_platform_provider_.reset(CreateRecommendedPlatformProvider()); | 357 recommended_platform_provider_.reset(CreateRecommendedPlatformProvider()); |
354 | 358 |
355 managed_cloud_provider_.reset(new CloudPolicyProviderImpl( | 359 managed_cloud_provider_.reset(new CloudPolicyProviderImpl( |
360 this, | |
356 GetChromePolicyDefinitionList(), | 361 GetChromePolicyDefinitionList(), |
357 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY)); | 362 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY)); |
358 recommended_cloud_provider_.reset(new CloudPolicyProviderImpl( | 363 recommended_cloud_provider_.reset(new CloudPolicyProviderImpl( |
364 this, | |
359 GetChromePolicyDefinitionList(), | 365 GetChromePolicyDefinitionList(), |
360 CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED)); | 366 CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED)); |
361 | 367 |
362 #if defined(OS_CHROMEOS) | 368 #if defined(OS_CHROMEOS) |
363 InitializeDevicePolicy(); | 369 InitializeDevicePolicy(); |
364 | 370 |
365 network_configuration_updater_.reset( | 371 network_configuration_updater_.reset( |
366 new NetworkConfigurationUpdater( | 372 new NetworkConfigurationUpdater( |
367 managed_cloud_provider_.get(), | 373 managed_cloud_provider_.get(), |
368 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | 374 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 491 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
486 } else { | 492 } else { |
487 return NULL; | 493 return NULL; |
488 } | 494 } |
489 #else | 495 #else |
490 return NULL; | 496 return NULL; |
491 #endif | 497 #endif |
492 } | 498 } |
493 | 499 |
494 } // namespace policy | 500 } // namespace policy |
OLD | NEW |