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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 void BrowserPolicyConnector::InitializeDevicePolicy() { | 406 void BrowserPolicyConnector::InitializeDevicePolicy() { |
407 #if defined(OS_CHROMEOS) | 407 #if defined(OS_CHROMEOS) |
408 // Throw away the old backend. | 408 // Throw away the old backend. |
409 device_cloud_policy_subsystem_.reset(); | 409 device_cloud_policy_subsystem_.reset(); |
410 device_data_store_.reset(); | 410 device_data_store_.reset(); |
411 | 411 |
412 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 412 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
413 if (command_line->HasSwitch(switches::kEnableDevicePolicy)) { | 413 if (command_line->HasSwitch(switches::kEnableDevicePolicy)) { |
414 device_data_store_.reset(CloudPolicyDataStore::CreateForDevicePolicies()); | 414 device_data_store_.reset(CloudPolicyDataStore::CreateForDevicePolicies()); |
415 chromeos::CryptohomeLibrary* cryptohome = NULL; | 415 chromeos::CryptohomeLibrary* cryptohome = |
416 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) | 416 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); |
417 cryptohome = chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); | |
418 install_attributes_.reset(new EnterpriseInstallAttributes(cryptohome)); | 417 install_attributes_.reset(new EnterpriseInstallAttributes(cryptohome)); |
419 DevicePolicyCache* device_policy_cache = | 418 DevicePolicyCache* device_policy_cache = |
420 new DevicePolicyCache(device_data_store_.get(), | 419 new DevicePolicyCache(device_data_store_.get(), |
421 install_attributes_.get()); | 420 install_attributes_.get()); |
422 | 421 |
423 managed_cloud_provider_->AppendCache(device_policy_cache); | 422 managed_cloud_provider_->AppendCache(device_policy_cache); |
424 recommended_cloud_provider_->AppendCache(device_policy_cache); | 423 recommended_cloud_provider_->AppendCache(device_policy_cache); |
425 | 424 |
426 device_cloud_policy_subsystem_.reset(new CloudPolicySubsystem( | 425 device_cloud_policy_subsystem_.reset(new CloudPolicySubsystem( |
427 device_data_store_.get(), | 426 device_data_store_.get(), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 484 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
486 } else { | 485 } else { |
487 return NULL; | 486 return NULL; |
488 } | 487 } |
489 #else | 488 #else |
490 return NULL; | 489 return NULL; |
491 #endif | 490 #endif |
492 } | 491 } |
493 | 492 |
494 } // namespace policy | 493 } // namespace policy |
OLD | NEW |