Index: chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc |
=================================================================== |
--- chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc (revision 108979) |
+++ chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc (working copy) |
@@ -304,10 +304,21 @@ |
void ChangePictureOptionsHandler::OnDownloadSuccess(const SkBitmap& image) { |
// Profile image has been downloaded. |
- // TODO(ivankr): check if profile image is default image. |
+ VLOG(1) << "Download of profile image on change picture failed."; |
+ UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.ChangePicture", |
+ ProfileImageDownloader::kDownloadSuccess, |
+ ProfileImageDownloader::kDownloadResultsCount); |
std::string profile_image_data_url = web_ui_util::GetImageDataUrl(image); |
if (profile_image_data_url != profile_image_data_url_) { |
+ VLOG(1) << "Updating profile image for the user"; |
+ if (profile_image_data_url_ != chrome::kAboutBlankURL) { |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "UserImageDownloadResult.ChangePicture", |
+ ProfileImageDownloader::kDownloadSuccessChanged, |
+ ProfileImageDownloader::kDownloadResultsCount); |
+ } |
+ |
// Differs from the current profile image. |
profile_image_ = image; |
profile_image_data_url_ = profile_image_data_url; |
@@ -319,6 +330,20 @@ |
} |
} |
+void ChangePictureOptionsHandler::OnDownloadFailure() { |
+ VLOG(1) << "Download of profile image on change picture failed."; |
+ UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.ChangePicture", |
+ ProfileImageDownloader::kDownloadFailure, |
+ ProfileImageDownloader::kDownloadResultsCount); |
+} |
+ |
+void ChangePictureOptionsHandler::OnDownloadDefaultImage() { |
+ VLOG(1) << "User still has the default profile image."; |
+ UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.ChangePicture", |
+ ProfileImageDownloader::kDownloadDefault, |
+ ProfileImageDownloader::kDownloadResultsCount); |
+} |
+ |
void ChangePictureOptionsHandler::CheckCameraPresence() { |
CameraDetector::StartPresenceCheck( |
base::Bind(&ChangePictureOptionsHandler::OnCameraPresenceCheckDone, |