| 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/avatar/user_image_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/avatar/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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 | 740 |
| 741 bool UserImageManagerImpl::NeedsProfilePicture() const { | 741 bool UserImageManagerImpl::NeedsProfilePicture() const { |
| 742 return downloading_profile_image_; | 742 return downloading_profile_image_; |
| 743 } | 743 } |
| 744 | 744 |
| 745 int UserImageManagerImpl::GetDesiredImageSideLength() const { | 745 int UserImageManagerImpl::GetDesiredImageSideLength() const { |
| 746 return GetCurrentUserImageSize(); | 746 return GetCurrentUserImageSize(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 Profile* UserImageManagerImpl::GetBrowserProfile() { | 749 Profile* UserImageManagerImpl::GetBrowserProfile() { |
| 750 return ProfileHelper::Get()->GetProfileByUser(GetUser()); | 750 return ProfileHelper::Get()->GetProfileByUserUnsafe(GetUser()); |
| 751 } | 751 } |
| 752 | 752 |
| 753 std::string UserImageManagerImpl::GetCachedPictureURL() const { | 753 std::string UserImageManagerImpl::GetCachedPictureURL() const { |
| 754 return profile_image_url_.spec(); | 754 return profile_image_url_.spec(); |
| 755 } | 755 } |
| 756 | 756 |
| 757 void UserImageManagerImpl::OnProfileDownloadSuccess( | 757 void UserImageManagerImpl::OnProfileDownloadSuccess( |
| 758 ProfileDownloader* downloader) { | 758 ProfileDownloader* downloader) { |
| 759 // Ensure that the |profile_downloader_| is deleted when this method returns. | 759 // Ensure that the |profile_downloader_| is deleted when this method returns. |
| 760 scoped_ptr<ProfileDownloader> profile_downloader( | 760 scoped_ptr<ProfileDownloader> profile_downloader( |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 | 1019 |
| 1020 bool UserImageManagerImpl::IsUserLoggedInAndRegular() const { | 1020 bool UserImageManagerImpl::IsUserLoggedInAndRegular() const { |
| 1021 const user_manager::User* user = GetUser(); | 1021 const user_manager::User* user = GetUser(); |
| 1022 if (!user) | 1022 if (!user) |
| 1023 return false; | 1023 return false; |
| 1024 return user->is_logged_in() && | 1024 return user->is_logged_in() && |
| 1025 user->GetType() == user_manager::USER_TYPE_REGULAR; | 1025 user->GetType() == user_manager::USER_TYPE_REGULAR; |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 } // namespace chromeos | 1028 } // namespace chromeos |
| OLD | NEW |