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 "chrome/browser/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 | 301 |
302 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 302 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
303 if (!command_line->HasSwitch(chromeos::switches::kDisableLocalAccounts)) { | 303 if (!command_line->HasSwitch(chromeos::switches::kDisableLocalAccounts)) { |
304 device_local_account_policy_service_.reset( | 304 device_local_account_policy_service_.reset( |
305 new DeviceLocalAccountPolicyService( | 305 new DeviceLocalAccountPolicyService( |
306 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), | 306 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), |
307 chromeos::DeviceSettingsService::Get(), | 307 chromeos::DeviceSettingsService::Get(), |
308 chromeos::CrosSettings::Get(), | 308 chromeos::CrosSettings::Get(), |
309 GetBackgroundTaskRunner(), | 309 GetBackgroundTaskRunner(), |
310 GetBackgroundTaskRunner(), | 310 GetBackgroundTaskRunner())); |
311 GetBackgroundTaskRunner(), | |
312 content::BrowserThread::GetMessageLoopProxyForThread( | |
313 content::BrowserThread::IO), | |
314 request_context)); | |
315 device_local_account_policy_service_->Connect( | 311 device_local_account_policy_service_->Connect( |
316 device_management_service_.get()); | 312 device_management_service_.get()); |
317 } | 313 } |
318 | 314 |
319 GetAppPackUpdater(); | 315 GetAppPackUpdater(); |
320 | 316 |
321 SetTimezoneIfPolicyAvailable(); | 317 SetTimezoneIfPolicyAvailable(); |
322 #endif | 318 #endif |
323 | 319 |
324 policy_statistics_collector_.reset( | 320 policy_statistics_collector_.reset( |
(...skipping 30 matching lines...) Expand all Loading... |
355 #if defined(OS_CHROMEOS) | 351 #if defined(OS_CHROMEOS) |
356 // The AppPackUpdater may be observing the |device_cloud_policy_subsystem_|. | 352 // The AppPackUpdater may be observing the |device_cloud_policy_subsystem_|. |
357 // Delete it first. | 353 // Delete it first. |
358 app_pack_updater_.reset(); | 354 app_pack_updater_.reset(); |
359 | 355 |
360 network_configuration_updater_.reset(); | 356 network_configuration_updater_.reset(); |
361 | 357 |
362 if (device_cloud_policy_manager_) | 358 if (device_cloud_policy_manager_) |
363 device_cloud_policy_manager_->Shutdown(); | 359 device_cloud_policy_manager_->Shutdown(); |
364 if (device_local_account_policy_service_) | 360 if (device_local_account_policy_service_) |
365 device_local_account_policy_service_->Shutdown(); | 361 device_local_account_policy_service_->Disconnect(); |
366 global_user_cloud_policy_provider_.Shutdown(); | 362 global_user_cloud_policy_provider_.Shutdown(); |
367 #endif | 363 #endif |
368 | 364 |
369 device_management_service_.reset(); | 365 device_management_service_.reset(); |
370 | 366 |
371 request_context_ = NULL; | 367 request_context_ = NULL; |
372 } | 368 } |
373 | 369 |
374 PolicyService* BrowserPolicyConnector::GetPolicyService() { | 370 PolicyService* BrowserPolicyConnector::GetPolicyService() { |
375 if (!policy_service_) { | 371 if (!policy_service_) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return new AsyncPolicyProvider(loader.Pass()); | 590 return new AsyncPolicyProvider(loader.Pass()); |
595 } else { | 591 } else { |
596 return NULL; | 592 return NULL; |
597 } | 593 } |
598 #else | 594 #else |
599 return NULL; | 595 return NULL; |
600 #endif | 596 #endif |
601 } | 597 } |
602 | 598 |
603 } // namespace policy | 599 } // namespace policy |
OLD | NEW |