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

Side by Side Diff: trunk/src/chrome/browser/chromeos/login/user_image_manager_impl.cc

Issue 260783002: Revert 267158 "CleanUp: Introduce UserInfo. Move session_state s..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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) 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/login/user_image_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_image_manager_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 851
852 void UserImageManagerImpl::TryToInitDownloadedProfileImage() { 852 void UserImageManagerImpl::TryToInitDownloadedProfileImage() {
853 const User* user = GetUser(); 853 const User* user = GetUser();
854 if (user->image_index() == User::kProfileImageIndex && 854 if (user->image_index() == User::kProfileImageIndex &&
855 downloaded_profile_image_.isNull() && 855 downloaded_profile_image_.isNull() &&
856 !user->image_is_stub()) { 856 !user->image_is_stub()) {
857 // Initialize the |downloaded_profile_image_| for the currently logged-in 857 // Initialize the |downloaded_profile_image_| for the currently logged-in
858 // user if it has not been initialized already, the user image is the 858 // user if it has not been initialized already, the user image is the
859 // profile image and the user image has been loaded successfully. 859 // profile image and the user image has been loaded successfully.
860 VLOG(1) << "Profile image initialized from disk."; 860 VLOG(1) << "Profile image initialized from disk.";
861 downloaded_profile_image_ = user->GetImage(); 861 downloaded_profile_image_ = user->image();
862 profile_image_url_ = user->image_url(); 862 profile_image_url_ = user->image_url();
863 } 863 }
864 } 864 }
865 865
866 bool UserImageManagerImpl::NeedProfileImage() const { 866 bool UserImageManagerImpl::NeedProfileImage() const {
867 const User* user = GetUser(); 867 const User* user = GetUser();
868 return IsUserLoggedInAndRegular() && 868 return IsUserLoggedInAndRegular() &&
869 (user->image_index() == User::kProfileImageIndex || 869 (user->image_index() == User::kProfileImageIndex ||
870 profile_image_requested_); 870 profile_image_requested_);
871 } 871 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 } 994 }
995 995
996 bool UserImageManagerImpl::IsUserLoggedInAndRegular() const { 996 bool UserImageManagerImpl::IsUserLoggedInAndRegular() const {
997 const User* user = GetUser(); 997 const User* user = GetUser();
998 if (!user) 998 if (!user)
999 return false; 999 return false;
1000 return user->is_logged_in() && user->GetType() == User::USER_TYPE_REGULAR; 1000 return user->is_logged_in() && user->GetType() == User::USER_TYPE_REGULAR;
1001 } 1001 }
1002 1002
1003 } // namespace chromeos 1003 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698