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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 std::string BrowserPolicyConnector::GetEnterpriseDomain() { | 189 std::string BrowserPolicyConnector::GetEnterpriseDomain() { |
190 #if defined(OS_CHROMEOS) | 190 #if defined(OS_CHROMEOS) |
191 if (install_attributes_.get()) | 191 if (install_attributes_.get()) |
192 return install_attributes_->GetDomain(); | 192 return install_attributes_->GetDomain(); |
193 #endif | 193 #endif |
194 | 194 |
195 return std::string(); | 195 return std::string(); |
196 } | 196 } |
197 | 197 |
198 void BrowserPolicyConnector::ResetDevicePolicy() { | 198 void BrowserPolicyConnector::ResetCloudPolicy() { |
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 if (user_cloud_policy_subsystem_.get()) |
| 203 user_cloud_policy_subsystem_->Reset(); |
202 #endif | 204 #endif |
203 } | 205 } |
204 | 206 |
205 void BrowserPolicyConnector::FetchDevicePolicy() { | 207 void BrowserPolicyConnector::FetchCloudPolicy() { |
206 #if defined(OS_CHROMEOS) | 208 #if defined(OS_CHROMEOS) |
207 if (device_data_store_.get()) { | 209 if (device_data_store_.get()) |
208 device_data_store_->NotifyDeviceTokenChanged(); | 210 device_data_store_->NotifyDeviceTokenChanged(); |
209 } | 211 if (user_data_store_.get()) |
| 212 user_data_store_->NotifyDeviceTokenChanged(); |
210 #endif | 213 #endif |
211 } | 214 } |
212 | 215 |
213 void BrowserPolicyConnector::FetchUserPolicy() { | |
214 #if defined(OS_CHROMEOS) | |
215 if (user_data_store_.get()) { | |
216 user_data_store_->NotifyDeviceTokenChanged(); | |
217 } | |
218 #endif | |
219 } | |
220 | |
221 void BrowserPolicyConnector::ScheduleServiceInitialization( | 216 void BrowserPolicyConnector::ScheduleServiceInitialization( |
222 int64 delay_milliseconds) { | 217 int64 delay_milliseconds) { |
223 if (user_cloud_policy_subsystem_.get()) { | 218 if (user_cloud_policy_subsystem_.get()) { |
224 user_cloud_policy_subsystem_-> | 219 user_cloud_policy_subsystem_-> |
225 ScheduleServiceInitialization(delay_milliseconds); | 220 ScheduleServiceInitialization(delay_milliseconds); |
226 } | 221 } |
227 #if defined(OS_CHROMEOS) | 222 #if defined(OS_CHROMEOS) |
228 if (device_cloud_policy_subsystem_.get()) { | 223 if (device_cloud_policy_subsystem_.get()) { |
229 device_cloud_policy_subsystem_-> | 224 device_cloud_policy_subsystem_-> |
230 ScheduleServiceInitialization(delay_milliseconds); | 225 ScheduleServiceInitialization(delay_milliseconds); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 341 |
347 return CloudPolicyDataStore::USER_AFFILIATION_NONE; | 342 return CloudPolicyDataStore::USER_AFFILIATION_NONE; |
348 } | 343 } |
349 | 344 |
350 BrowserPolicyConnector::BrowserPolicyConnector() | 345 BrowserPolicyConnector::BrowserPolicyConnector() |
351 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 346 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
352 managed_platform_provider_.reset(CreateManagedPlatformProvider()); | 347 managed_platform_provider_.reset(CreateManagedPlatformProvider()); |
353 recommended_platform_provider_.reset(CreateRecommendedPlatformProvider()); | 348 recommended_platform_provider_.reset(CreateRecommendedPlatformProvider()); |
354 | 349 |
355 managed_cloud_provider_.reset(new CloudPolicyProviderImpl( | 350 managed_cloud_provider_.reset(new CloudPolicyProviderImpl( |
| 351 this, |
356 GetChromePolicyDefinitionList(), | 352 GetChromePolicyDefinitionList(), |
357 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY)); | 353 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY)); |
358 recommended_cloud_provider_.reset(new CloudPolicyProviderImpl( | 354 recommended_cloud_provider_.reset(new CloudPolicyProviderImpl( |
| 355 this, |
359 GetChromePolicyDefinitionList(), | 356 GetChromePolicyDefinitionList(), |
360 CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED)); | 357 CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED)); |
361 | 358 |
362 #if defined(OS_CHROMEOS) | 359 #if defined(OS_CHROMEOS) |
363 InitializeDevicePolicy(); | 360 InitializeDevicePolicy(); |
364 | 361 |
365 network_configuration_updater_.reset( | 362 network_configuration_updater_.reset( |
366 new NetworkConfigurationUpdater( | 363 new NetworkConfigurationUpdater( |
367 managed_cloud_provider_.get(), | 364 managed_cloud_provider_.get(), |
368 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | 365 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"))); | 482 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
486 } else { | 483 } else { |
487 return NULL; | 484 return NULL; |
488 } | 485 } |
489 #else | 486 #else |
490 return NULL; | 487 return NULL; |
491 #endif | 488 #endif |
492 } | 489 } |
493 | 490 |
494 } // namespace policy | 491 } // namespace policy |
OLD | NEW |