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

Side by Side Diff: chrome/browser/chromeos/login/screens/user_image_screen.cc

Issue 445353004: GetProfileByUser deprecated and renamed to GetProfileByUserUnsafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/screens/user_image_screen.h" 5 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 UserImageSyncObserver* UserImageScreen::GetSyncObserver() { 261 UserImageSyncObserver* UserImageScreen::GetSyncObserver() {
262 return GetUserImageManager()->GetSyncObserver(); 262 return GetUserImageManager()->GetSyncObserver();
263 } 263 }
264 264
265 void UserImageScreen::Show() { 265 void UserImageScreen::Show() {
266 if (!actor_) 266 if (!actor_)
267 return; 267 return;
268 268
269 DCHECK(!policy_registrar_); 269 DCHECK(!policy_registrar_);
270 Profile* profile = ProfileHelper::Get()->GetProfileByUser(GetUser()); 270 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(GetUser());
271 if (profile) { 271 if (profile) {
272 policy::PolicyService* policy_service = 272 policy::PolicyService* policy_service =
273 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> 273 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)->
274 policy_service(); 274 policy_service();
275 if (policy_service->GetPolicies( 275 if (policy_service->GetPolicies(
276 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, 276 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME,
277 std::string())) 277 std::string()))
278 .Get(policy::key::kUserAvatarImage)) { 278 .Get(policy::key::kUserAvatarImage)) {
279 // If the user image is managed by policy, skip the screen because the 279 // If the user image is managed by policy, skip the screen because the
280 // user is not allowed to override a policy-set image. 280 // user is not allowed to override a policy-set image.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 void UserImageScreen::ExitScreen() { 384 void UserImageScreen::ExitScreen() {
385 policy_registrar_.reset(); 385 policy_registrar_.reset();
386 sync_timer_.reset(); 386 sync_timer_.reset();
387 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) 387 if (UserImageSyncObserver* sync_observer = GetSyncObserver())
388 sync_observer->RemoveObserver(this); 388 sync_observer->RemoveObserver(this);
389 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); 389 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED);
390 } 390 }
391 391
392 } // namespace chromeos 392 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/saml/saml_browsertest.cc ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698