| 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" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (!user) { | 103 if (!user) { |
| 104 DCHECK(schema_registry); | 104 DCHECK(schema_registry); |
| 105 // This case occurs for the signin profile. | 105 // This case occurs for the signin profile. |
| 106 special_user_policy_provider_.reset( | 106 special_user_policy_provider_.reset( |
| 107 new LoginProfilePolicyProvider(connector->GetPolicyService())); | 107 new LoginProfilePolicyProvider(connector->GetPolicyService())); |
| 108 } else { | 108 } else { |
| 109 // |user| should never be NULL except for the signin profile. | 109 // |user| should never be NULL except for the signin profile. |
| 110 is_primary_user_ = | 110 is_primary_user_ = |
| 111 user == user_manager::UserManager::Get()->GetPrimaryUser(); | 111 user == user_manager::UserManager::Get()->GetPrimaryUser(); |
| 112 special_user_policy_provider_ = DeviceLocalAccountPolicyProvider::Create( | 112 special_user_policy_provider_ = DeviceLocalAccountPolicyProvider::Create( |
| 113 user->email(), | 113 user->GetUserID(), |
| 114 connector->GetDeviceLocalAccountPolicyService()); | 114 connector->GetDeviceLocalAccountPolicyService()); |
| 115 } | 115 } |
| 116 if (special_user_policy_provider_) { | 116 if (special_user_policy_provider_) { |
| 117 special_user_policy_provider_->Init(schema_registry); | 117 special_user_policy_provider_->Init(schema_registry); |
| 118 providers.push_back(special_user_policy_provider_.get()); | 118 providers.push_back(special_user_policy_provider_.get()); |
| 119 } | 119 } |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 policy_service_.reset(new PolicyServiceImpl(providers)); | 122 policy_service_.reset(new PolicyServiceImpl(providers)); |
| 123 | 123 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 BrowserPolicyConnectorChromeOS* connector = | 176 BrowserPolicyConnectorChromeOS* connector = |
| 177 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 177 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 178 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name)) | 178 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name)) |
| 179 return false; | 179 return false; |
| 180 #endif | 180 #endif |
| 181 | 181 |
| 182 return true; | 182 return true; |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace policy | 185 } // namespace policy |
| OLD | NEW |