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/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 std::vector<ConfigurationPolicyProvider*> providers; | 52 std::vector<ConfigurationPolicyProvider*> providers; |
53 | 53 |
54 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
55 UserCloudPolicyManagerChromeOS* cloud_policy_manager = | 55 UserCloudPolicyManagerChromeOS* cloud_policy_manager = |
56 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile_); | 56 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile_); |
57 if (cloud_policy_manager) | 57 if (cloud_policy_manager) |
58 providers.push_back(cloud_policy_manager); | 58 providers.push_back(cloud_policy_manager); |
59 | 59 |
60 bool allow_trusted_certs_from_policy = false; | 60 bool allow_trusted_certs_from_policy = false; |
61 chromeos::User* user = NULL; | 61 chromeos::User* user = NULL; |
62 if (chromeos::ProfileHelper::IsSigninProfile(profile_)) { | 62 if (profile_->IsLoginProfile()) { |
63 special_user_policy_provider_.reset(new LoginProfilePolicyProvider( | 63 special_user_policy_provider_.reset(new LoginProfilePolicyProvider( |
64 connector->GetPolicyService())); | 64 connector->GetPolicyService())); |
65 special_user_policy_provider_->Init(); | 65 special_user_policy_provider_->Init(); |
66 } else { | 66 } else { |
67 // |user| should never be NULL except for the signin profile. | 67 // |user| should never be NULL except for the signin profile. |
68 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 68 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
69 user = user_manager->GetUserByProfile(profile_); | 69 user = user_manager->GetUserByProfile(profile_); |
70 CHECK(user); | 70 CHECK(user); |
71 std::string username = user->email(); | 71 std::string username = user->email(); |
72 is_primary_user_ = | 72 is_primary_user_ = |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 connector->GetDeviceLocalAccountPolicyService(); | 168 connector->GetDeviceLocalAccountPolicyService(); |
169 if (!device_local_account_policy_service) | 169 if (!device_local_account_policy_service) |
170 return; | 170 return; |
171 special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider( | 171 special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider( |
172 username, device_local_account_policy_service)); | 172 username, device_local_account_policy_service)); |
173 special_user_policy_provider_->Init(); | 173 special_user_policy_provider_->Init(); |
174 } | 174 } |
175 #endif | 175 #endif |
176 | 176 |
177 } // namespace policy | 177 } // namespace policy |
OLD | NEW |