Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: chrome/browser/chromeos/login/users/multi_profile_user_controller.cc

Issue 445353004: GetProfileByUser deprecated and renamed to GetProfileByUserUnsafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_change_registrar.h" 9 #include "base/prefs/pref_change_registrar.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // a PolicyCertService. His profile may have been tainted previously though 119 // a PolicyCertService. His profile may have been tainted previously though
120 // he didn't get a PolicyCertService created for this session. 120 // he didn't get a PolicyCertService created for this session.
121 return SetUserAllowedReason(reason, 121 return SetUserAllowedReason(reason,
122 NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED); 122 NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED);
123 } 123 }
124 124
125 // If the primary profile already has policy certificates installed but hasn't 125 // If the primary profile already has policy certificates installed but hasn't
126 // used them yet then it can become tainted at any time during this session; 126 // used them yet then it can become tainted at any time during this session;
127 // disable secondary profiles in this case too. 127 // disable secondary profiles in this case too.
128 Profile* primary_user_profile = 128 Profile* primary_user_profile =
129 primary_user ? ProfileHelper::Get()->GetProfileByUser(primary_user) 129 primary_user ? ProfileHelper::Get()->GetProfileByUserUnsafe(primary_user)
130 : NULL; 130 : NULL;
131 policy::PolicyCertService* service = 131 policy::PolicyCertService* service =
132 primary_user_profile ? policy::PolicyCertServiceFactory::GetForProfile( 132 primary_user_profile ? policy::PolicyCertServiceFactory::GetForProfile(
133 primary_user_profile) 133 primary_user_profile)
134 : NULL; 134 : NULL;
135 if (service && service->has_policy_certificates()) 135 if (service && service->has_policy_certificates())
136 return SetUserAllowedReason(reason, 136 return SetUserAllowedReason(reason,
137 NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED); 137 NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED);
138 138
139 // No user is allowed if the primary user policy forbids it. 139 // No user is allowed if the primary user policy forbids it.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } else { 225 } else {
226 const std::string behavior = 226 const std::string behavior =
227 prefs->GetString(prefs::kMultiProfileUserBehavior); 227 prefs->GetString(prefs::kMultiProfileUserBehavior);
228 SetCachedValue(user_email, behavior); 228 SetCachedValue(user_email, behavior);
229 } 229 }
230 230
231 CheckSessionUsers(); 231 CheckSessionUsers();
232 } 232 }
233 233
234 } // namespace chromeos 234 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698