OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/login/users/multi_profile_user_controller.h" | 5 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller_dele
gate.h" | 10 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller_dele
gate.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 92 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
93 CHECK(user_manager); | 93 CHECK(user_manager); |
94 | 94 |
95 const user_manager::User* user = user_manager->GetPrimaryUser(); | 95 const user_manager::User* user = user_manager->GetPrimaryUser(); |
96 if (!user) | 96 if (!user) |
97 return ALLOWED; | 97 return ALLOWED; |
98 | 98 |
99 // Don't allow any secondary profiles if the primary profile is tainted. | 99 // Don't allow any secondary profiles if the primary profile is tainted. |
100 if (policy::PolicyCertServiceFactory::UsedPolicyCertificates(user->email())) { | 100 if (policy::PolicyCertServiceFactory::UsedPolicyCertificates(user->email())) { |
101 // Check directly in local_state before checking if the primary user has | 101 // Check directly in local_state before checking if the primary user has |
102 // a PolicyCertService. His profile may have been tainted previously though | 102 // a PolicyCertService. Their profile may have been tainted previously |
103 // he didn't get a PolicyCertService created for this session. | 103 // though they didn't get a PolicyCertService created for this session. |
104 return NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED; | 104 return NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED; |
105 } | 105 } |
106 | 106 |
107 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); | 107 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); |
108 if (!profile) | 108 if (!profile) |
109 return ALLOWED; | 109 return ALLOWED; |
110 | 110 |
111 // If the primary profile already has policy certificates installed but | 111 // If the primary profile already has policy certificates installed but |
112 // hasn't used them yet then it can become tainted at any time during this | 112 // hasn't used them yet then it can become tainted at any time during this |
113 // session disable secondary profiles in this case too. | 113 // session disable secondary profiles in this case too. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } else { | 232 } else { |
233 const std::string behavior = | 233 const std::string behavior = |
234 prefs->GetString(prefs::kMultiProfileUserBehavior); | 234 prefs->GetString(prefs::kMultiProfileUserBehavior); |
235 SetCachedValue(user_email, behavior); | 235 SetCachedValue(user_email, behavior); |
236 } | 236 } |
237 | 237 |
238 CheckSessionUsers(); | 238 CheckSessionUsers(); |
239 } | 239 } |
240 | 240 |
241 } // namespace chromeos | 241 } // namespace chromeos |
OLD | NEW |