| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/accessibility/accessibility_util.h" | 9 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 10 #include "chrome/browser/chromeos/login/default_user_images.h" | 10 #include "chrome/browser/chromeos/login/default_user_images.h" |
| 11 #include "chrome/browser/chromeos/login/login_utils.h" | 11 #include "chrome/browser/chromeos/login/login_utils.h" |
| 12 #include "chrome/browser/chromeos/login/screen_observer.h" | 12 #include "chrome/browser/chromeos/login/screen_observer.h" |
| 13 #include "chrome/browser/chromeos/login/user_image.h" |
| 13 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 14 #include "chrome/browser/chromeos/login/wizard_controller.h" | 15 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
| 19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/gfx/image/image_skia.h" | 23 #include "ui/gfx/image/image_skia.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 actor_->ShowCameraInitializing(); | 109 actor_->ShowCameraInitializing(); |
| 109 camera_controller_.Start(); | 110 camera_controller_.Start(); |
| 110 } | 111 } |
| 111 | 112 |
| 112 void UserImageScreen::StopCamera() { | 113 void UserImageScreen::StopCamera() { |
| 113 camera_controller_.Stop(); | 114 camera_controller_.Stop(); |
| 114 } | 115 } |
| 115 | 116 |
| 116 void UserImageScreen::OnPhotoTaken(const gfx::ImageSkia& image) { | 117 void UserImageScreen::OnPhotoTaken(const gfx::ImageSkia& image) { |
| 117 UserManager* user_manager = UserManager::Get(); | 118 UserManager* user_manager = UserManager::Get(); |
| 118 user_manager->SaveUserImage(user_manager->GetLoggedInUser().email(), image); | 119 user_manager->SaveUserImage(user_manager->GetLoggedInUser().email(), |
| 120 UserImage(image)); |
| 119 | 121 |
| 120 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); | 122 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); |
| 121 | 123 |
| 122 UMA_HISTOGRAM_ENUMERATION("UserImage.FirstTimeChoice", | 124 UMA_HISTOGRAM_ENUMERATION("UserImage.FirstTimeChoice", |
| 123 kHistogramImageFromCamera, | 125 kHistogramImageFromCamera, |
| 124 kHistogramImagesCount); | 126 kHistogramImagesCount); |
| 125 } | 127 } |
| 126 | 128 |
| 127 void UserImageScreen::OnProfileImageSelected() { | 129 void UserImageScreen::OnProfileImageSelected() { |
| 128 UserManager* user_manager = UserManager::Get(); | 130 UserManager* user_manager = UserManager::Get(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (actor_) | 180 if (actor_) |
| 179 actor_->OnProfileImageAbsent(); | 181 actor_->OnProfileImageAbsent(); |
| 180 break; | 182 break; |
| 181 } | 183 } |
| 182 default: | 184 default: |
| 183 NOTREACHED(); | 185 NOTREACHED(); |
| 184 } | 186 } |
| 185 } | 187 } |
| 186 | 188 |
| 187 } // namespace chromeos | 189 } // namespace chromeos |
| OLD | NEW |