| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/profile_policy_connector.h" | 5 #include "chrome/browser/policy/profile_policy_connector.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/policy/browser_policy_connector.h" | 12 #include "chrome/browser/policy/browser_policy_connector.h" |
| 13 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" | 13 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" |
| 14 #include "chrome/browser/policy/configuration_policy_provider.h" | 14 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 15 #include "chrome/browser/policy/forwarding_policy_provider.h" | 15 #include "chrome/browser/policy/forwarding_policy_provider.h" |
| 16 #include "chrome/browser/policy/policy_service_impl.h" | 16 #include "chrome/browser/policy/policy_service_impl.h" |
| 17 #include "chrome/browser/policy/policy_transformations.h" | 17 #include "chrome/browser/policy/policy_transformations.h" |
| 18 | 18 |
| 19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 20 #include "chrome/browser/chromeos/login/user.h" | 20 #include "chrome/browser/chromeos/login/user.h" |
| 21 #include "chrome/browser/chromeos/login/user_manager.h" | 21 #include "chrome/browser/chromeos/login/user_manager.h" |
| 22 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 22 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" | 23 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" |
| 23 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" | 24 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" |
| 24 #endif | 25 #endif |
| 25 | 26 |
| 26 namespace policy { | 27 namespace policy { |
| 27 | 28 |
| 28 ProfilePolicyConnector::ProfilePolicyConnector() | 29 ProfilePolicyConnector::ProfilePolicyConnector() |
| 29 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 30 : is_primary_user_(false) | 31 : is_primary_user_(false) |
| 31 #endif | 32 #endif |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 BrowserPolicyConnector* connector = | 54 BrowserPolicyConnector* connector = |
| 54 g_browser_process->browser_policy_connector(); | 55 g_browser_process->browser_policy_connector(); |
| 55 | 56 |
| 56 if (connector->GetPlatformProvider()) { | 57 if (connector->GetPlatformProvider()) { |
| 57 forwarding_policy_provider_.reset( | 58 forwarding_policy_provider_.reset( |
| 58 new ForwardingPolicyProvider(connector->GetPlatformProvider())); | 59 new ForwardingPolicyProvider(connector->GetPlatformProvider())); |
| 59 forwarding_policy_provider_->Init(schema_registry); | 60 forwarding_policy_provider_->Init(schema_registry); |
| 60 providers.push_back(forwarding_policy_provider_.get()); | 61 providers.push_back(forwarding_policy_provider_.get()); |
| 61 } | 62 } |
| 62 | 63 |
| 64 #if defined(OS_CHROMEOS) |
| 65 if (connector->GetDeviceCloudPolicyManager()) |
| 66 providers.push_back(connector->GetDeviceCloudPolicyManager()); |
| 67 #endif |
| 68 |
| 63 if (user_cloud_policy_manager) | 69 if (user_cloud_policy_manager) |
| 64 providers.push_back(user_cloud_policy_manager); | 70 providers.push_back(user_cloud_policy_manager); |
| 65 | 71 |
| 66 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 67 if (!user) { | 73 if (!user) { |
| 68 DCHECK(schema_registry); | 74 DCHECK(schema_registry); |
| 69 // This case occurs for the signin profile. | 75 // This case occurs for the signin profile. |
| 70 special_user_policy_provider_.reset( | 76 special_user_policy_provider_.reset( |
| 71 new LoginProfilePolicyProvider(connector->GetPolicyService())); | 77 new LoginProfilePolicyProvider(connector->GetPolicyService())); |
| 72 special_user_policy_provider_->Init(schema_registry); | 78 special_user_policy_provider_->Init(schema_registry); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 connector->GetDeviceLocalAccountPolicyService(); | 126 connector->GetDeviceLocalAccountPolicyService(); |
| 121 if (!device_local_account_policy_service) | 127 if (!device_local_account_policy_service) |
| 122 return; | 128 return; |
| 123 special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider( | 129 special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider( |
| 124 username, device_local_account_policy_service)); | 130 username, device_local_account_policy_service)); |
| 125 special_user_policy_provider_->Init(schema_registry); | 131 special_user_policy_provider_->Init(schema_registry); |
| 126 } | 132 } |
| 127 #endif | 133 #endif |
| 128 | 134 |
| 129 } // namespace policy | 135 } // namespace policy |
| OLD | NEW |