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

Unified Diff: chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc

Issue 8497006: Merge 107584 - [cros] Don't succeed if user has default profile picture. Merge 108860 - [cros] Fi... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698