| 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/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 Loading... |
| 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->image(); | 861 downloaded_profile_image_ = user->GetImage(); |
| 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 Loading... |
| 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 |
| OLD | NEW |