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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 if (command_line->HasSwitch(switches::kEnableCloudPolicyService)) { | 355 if (command_line->HasSwitch(switches::kEnableCloudPolicyService)) { |
356 #if defined(OS_CHROMEOS) | 356 #if defined(OS_CHROMEOS) |
357 scoped_ptr<CloudPolicyStore> store( | 357 scoped_ptr<CloudPolicyStore> store( |
358 new UserCloudPolicyStoreChromeOS( | 358 new UserCloudPolicyStoreChromeOS( |
359 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), | 359 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), |
360 policy_cache_file, token_cache_file)); | 360 policy_cache_file, token_cache_file)); |
361 user_cloud_policy_manager_.reset( | 361 user_cloud_policy_manager_.reset( |
362 new UserCloudPolicyManagerChromeOS(store.Pass(), | 362 new UserCloudPolicyManagerChromeOS(store.Pass(), |
363 wait_for_policy_fetch)); | 363 wait_for_policy_fetch)); |
364 user_cloud_policy_manager_->Init(); | 364 user_cloud_policy_manager_->Init(); |
365 user_cloud_policy_manager_->Initialize(g_browser_process->local_state(), | 365 user_cloud_policy_manager_->Connect(g_browser_process->local_state(), |
366 device_management_service_.get(), | 366 device_management_service_.get(), |
367 GetUserAffiliation(user_name)); | 367 GetUserAffiliation(user_name)); |
368 global_user_cloud_policy_provider_.SetDelegate( | 368 global_user_cloud_policy_provider_.SetDelegate( |
369 user_cloud_policy_manager_.get()); | 369 user_cloud_policy_manager_.get()); |
370 #endif | 370 #endif |
371 } else { | 371 } else { |
372 CloudPolicyCacheBase* user_policy_cache = NULL; | 372 CloudPolicyCacheBase* user_policy_cache = NULL; |
373 | 373 |
374 user_data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies()); | 374 user_data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies()); |
375 #if defined(OS_CHROMEOS) | 375 #if defined(OS_CHROMEOS) |
376 user_policy_cache = | 376 user_policy_cache = |
377 new CrosUserPolicyCache( | 377 new CrosUserPolicyCache( |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 return new AsyncPolicyProvider(loader.Pass()); | 691 return new AsyncPolicyProvider(loader.Pass()); |
692 } else { | 692 } else { |
693 return NULL; | 693 return NULL; |
694 } | 694 } |
695 #else | 695 #else |
696 return NULL; | 696 return NULL; |
697 #endif | 697 #endif |
698 } | 698 } |
699 | 699 |
700 } // namespace policy | 700 } // namespace policy |
OLD | NEW |