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

Side by Side Diff: chrome/browser/chromeos/login/user_image_screen.cc

Issue 10454044: Added support for animated/nonanimated user image. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small fixes to comments. Created 8 years, 6 months 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 unified diff | Download patch
OLDNEW
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/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
15 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
16 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
17 #include "grit/theme_resources.h" 18 #include "grit/theme_resources.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
20 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/gfx/image/image_skia.h" 22 #include "ui/gfx/image/image_skia.h"
22 23
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 actor_->ShowCameraInitializing(); 104 actor_->ShowCameraInitializing();
104 camera_controller_.Start(); 105 camera_controller_.Start();
105 } 106 }
106 107
107 void UserImageScreen::StopCamera() { 108 void UserImageScreen::StopCamera() {
108 camera_controller_.Stop(); 109 camera_controller_.Stop();
109 } 110 }
110 111
111 void UserImageScreen::OnPhotoTaken(const gfx::ImageSkia& image) { 112 void UserImageScreen::OnPhotoTaken(const gfx::ImageSkia& image) {
112 UserManager* user_manager = UserManager::Get(); 113 UserManager* user_manager = UserManager::Get();
113 user_manager->SaveUserImage(user_manager->GetLoggedInUser().email(), image); 114 user_manager->SaveUserImage(user_manager->GetLoggedInUser().email(),
115 UserImage(image));
114 116
115 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); 117 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED);
116 118
117 UMA_HISTOGRAM_ENUMERATION("UserImage.FirstTimeChoice", 119 UMA_HISTOGRAM_ENUMERATION("UserImage.FirstTimeChoice",
118 kHistogramImageFromCamera, 120 kHistogramImageFromCamera,
119 kHistogramImagesCount); 121 kHistogramImagesCount);
120 } 122 }
121 123
122 void UserImageScreen::OnProfileImageSelected() { 124 void UserImageScreen::OnProfileImageSelected() {
123 UserManager* user_manager = UserManager::Get(); 125 UserManager* user_manager = UserManager::Get();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (actor_) 174 if (actor_)
173 actor_->OnProfileImageAbsent(); 175 actor_->OnProfileImageAbsent();
174 break; 176 break;
175 } 177 }
176 default: 178 default:
177 NOTREACHED(); 179 NOTREACHED();
178 } 180 }
179 } 181 }
180 182
181 } // namespace chromeos 183 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698