| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_manager.h" | 5 #include "chrome/browser/chromeos/login/user_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 | 825 |
| 826 // UserManager should be accessed only on UI thread. | 826 // UserManager should be accessed only on UI thread. |
| 827 BrowserThread::PostTask( | 827 BrowserThread::PostTask( |
| 828 BrowserThread::UI, | 828 BrowserThread::UI, |
| 829 FROM_HERE, | 829 FROM_HERE, |
| 830 base::Bind(&UserManager::UpdateOwnership, | 830 base::Bind(&UserManager::UpdateOwnership, |
| 831 base::Unretained(this), | 831 base::Unretained(this), |
| 832 is_owner)); | 832 is_owner)); |
| 833 } | 833 } |
| 834 | 834 |
| 835 int UserManager::GetDesiredImageSideLength() { | 835 int UserManager::GetDesiredImageSideLength() const { |
| 836 return login::kUserImageSize; | 836 return login::kUserImageSize; |
| 837 } | 837 } |
| 838 | 838 |
| 839 Profile* UserManager::GetBrowserProfile() { | 839 Profile* UserManager::GetBrowserProfile() { |
| 840 return ProfileManager::GetDefaultProfile(); | 840 return ProfileManager::GetDefaultProfile(); |
| 841 } | 841 } |
| 842 | 842 |
| 843 bool UserManager::ShouldUseOAuthRefreshToken() { | 843 bool UserManager::ShouldUseOAuthRefreshToken() const { |
| 844 return false; | 844 return false; |
| 845 } | 845 } |
| 846 | 846 |
| 847 std::string UserManager::GetCachedPictureURL() const { |
| 848 // Currently the profile picture URL is not cached on ChromeOS. |
| 849 return std::string(); |
| 850 } |
| 851 |
| 847 void UserManager::OnDownloadComplete(ProfileDownloader* downloader, | 852 void UserManager::OnDownloadComplete(ProfileDownloader* downloader, |
| 848 bool success) { | 853 bool success) { |
| 849 ProfileDownloadResult result; | 854 ProfileDownloadResult result; |
| 850 std::string time_histogram_name; | 855 std::string time_histogram_name; |
| 851 if (!success) { | 856 if (!success) { |
| 852 result = kDownloadFailure; | 857 result = kDownloadFailure; |
| 853 time_histogram_name = kProfileDownloadFailureTime; | 858 time_histogram_name = kProfileDownloadFailureTime; |
| 854 } else if (downloader->GetProfilePicture().isNull()) { | 859 } else if (downloader->GetProfilePicture().isNull()) { |
| 855 result = kDownloadDefault; | 860 result = kDownloadDefault; |
| 856 time_histogram_name = kProfileDownloadDefaultTime; | 861 time_histogram_name = kProfileDownloadDefaultTime; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 | 911 |
| 907 User* UserManager::CreateUser(const std::string& email) const { | 912 User* UserManager::CreateUser(const std::string& email) const { |
| 908 User* user = new User(email); | 913 User* user = new User(email); |
| 909 user->set_oauth_token_status(GetUserOAuthStatus(email)); | 914 user->set_oauth_token_status(GetUserOAuthStatus(email)); |
| 910 // Used to determine whether user's display name is unique. | 915 // Used to determine whether user's display name is unique. |
| 911 ++display_name_count_[user->GetDisplayName()]; | 916 ++display_name_count_[user->GetDisplayName()]; |
| 912 return user; | 917 return user; |
| 913 } | 918 } |
| 914 | 919 |
| 915 } // namespace chromeos | 920 } // namespace chromeos |
| OLD | NEW |