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_image_screen.h" | 5 #include "chrome/browser/chromeos/login/user_image_screen.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/chromeos/login/default_user_images.h" | 9 #include "chrome/browser/chromeos/login/default_user_images.h" |
10 #include "chrome/browser/chromeos/login/login_utils.h" | 10 #include "chrome/browser/chromeos/login/login_utils.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 else if (actor_ && actor_->IsCapturing()) | 180 else if (actor_ && actor_->IsCapturing()) |
181 StartCamera(); | 181 StartCamera(); |
182 } | 182 } |
183 | 183 |
184 void UserImageScreen::OnDownloadSuccess(const SkBitmap& image) { | 184 void UserImageScreen::OnDownloadSuccess(const SkBitmap& image) { |
185 DCHECK(profile_image_load_start_time_.is_null()); | 185 DCHECK(profile_image_load_start_time_.is_null()); |
186 | 186 |
187 base::TimeDelta delta = base::Time::Now() - profile_image_load_start_time_; | 187 base::TimeDelta delta = base::Time::Now() - profile_image_load_start_time_; |
188 VLOG(1) << "Profile image download time: " << delta.InSecondsF(); | 188 VLOG(1) << "Profile image download time: " << delta.InSecondsF(); |
189 UMA_HISTOGRAM_TIMES("UserImage.FirstTimeProfileImageDownload", delta); | 189 UMA_HISTOGRAM_TIMES("UserImage.FirstTimeProfileImageDownload", delta); |
| 190 UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.NewUser", |
| 191 ProfileImageDownloader::kDownloadSuccess, |
| 192 ProfileImageDownloader::kDownloadResultsCount); |
190 | 193 |
191 // TODO(avayvod): Check for the default image. | |
192 if (actor_) | 194 if (actor_) |
193 actor_->AddProfileImage(image); | 195 actor_->AddProfileImage(image); |
194 } | 196 } |
195 | 197 |
| 198 void UserImageScreen::OnDownloadFailure() { |
| 199 VLOG(1) << "Download of profile image for new user failed."; |
| 200 UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.NewUser", |
| 201 ProfileImageDownloader::kDownloadFailure, |
| 202 ProfileImageDownloader::kDownloadResultsCount); |
| 203 } |
| 204 |
| 205 void UserImageScreen::OnDownloadDefaultImage() { |
| 206 VLOG(1) << "New user has the default profile image."; |
| 207 UMA_HISTOGRAM_ENUMERATION("UserImageDownloadResult.NewUser", |
| 208 ProfileImageDownloader::kDownloadDefault, |
| 209 ProfileImageDownloader::kDownloadResultsCount); |
| 210 } |
| 211 |
196 } // namespace chromeos | 212 } // namespace chromeos |
OLD | NEW |