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/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 122 if (chromeos::ProfileHelper::IsSigninProfile(profile)) |
123 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); | 123 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); |
124 | 124 |
125 // |user| should never be NULL except for the signin profile. This object is | 125 // |user| should never be NULL except for the signin profile. This object is |
126 // created as part of the Profile creation, which happens right after | 126 // created as part of the Profile creation, which happens right after |
127 // sign-in. The just-signed-in User is the active user during that time. | 127 // sign-in. The just-signed-in User is the active user during that time. |
128 user_manager::User* user = | 128 user_manager::User* user = |
129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
130 CHECK(user); | 130 CHECK(user); |
131 | 131 |
132 // Only USER_TYPE_REGULAR users have user cloud policy. | 132 // Only USER_TYPE_REGULAR and USER_TYPE_REGULAR_SUPERVISED users have user |
133 // USER_TYPE_RETAIL_MODE, USER_TYPE_KIOSK_APP, USER_TYPE_GUEST and | 133 // cloud policy. USER_TYPE_RETAIL_MODE, USER_TYPE_KIOSK_APP, USER_TYPE_GUEST |
134 // USER_TYPE_SUPERVISED are not signed in and can't authenticate the | 134 // and USER_TYPE_SUPERVISED are not signed in and can't authenticate the |
135 // policy registration. | 135 // policy registration. |
136 // USER_TYPE_PUBLIC_ACCOUNT gets its policy from the | 136 // USER_TYPE_PUBLIC_ACCOUNT gets its policy from the |
137 // DeviceLocalAccountPolicyService. | 137 // DeviceLocalAccountPolicyService. |
138 // Non-managed domains will be skipped by the below check | 138 // Non-managed domains will be skipped by the below check |
139 const std::string& username = user->email(); | 139 const std::string& username = user->email(); |
140 if (user->GetType() != user_manager::USER_TYPE_REGULAR || | 140 if (!user->IsRegular() || |
141 BrowserPolicyConnector::IsNonEnterpriseUser(username)) { | 141 BrowserPolicyConnector::IsNonEnterpriseUser(username)) { |
142 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); | 142 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); |
143 } | 143 } |
144 | 144 |
145 policy::BrowserPolicyConnectorChromeOS* connector = | 145 policy::BrowserPolicyConnectorChromeOS* connector = |
146 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 146 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
147 UserAffiliation affiliation = connector->GetUserAffiliation(username); | 147 UserAffiliation affiliation = connector->GetUserAffiliation(username); |
148 const bool is_affiliated_user = affiliation == USER_AFFILIATION_MANAGED; | 148 const bool is_affiliated_user = affiliation == USER_AFFILIATION_MANAGED; |
149 const bool is_browser_restart = | 149 const bool is_browser_restart = |
150 command_line->HasSwitch(chromeos::switches::kLoginUser); | 150 command_line->HasSwitch(chromeos::switches::kLoginUser); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( | 253 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( |
254 content::BrowserContext* context) { | 254 content::BrowserContext* context) { |
255 return false; | 255 return false; |
256 } | 256 } |
257 | 257 |
258 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 258 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
259 content::BrowserContext* context) {} | 259 content::BrowserContext* context) {} |
260 | 260 |
261 } // namespace policy | 261 } // namespace policy |
OLD | NEW |