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 "chrome/browser/chromeos/login/default_user_images.h" | 8 #include "chrome/browser/chromeos/login/default_user_images.h" |
9 #include "chrome/browser/chromeos/login/login_utils.h" | 9 #include "chrome/browser/chromeos/login/login_utils.h" |
10 #include "chrome/browser/chromeos/login/screen_observer.h" | 10 #include "chrome/browser/chromeos/login/screen_observer.h" |
11 #include "chrome/browser/chromeos/login/user_manager.h" | 11 #include "chrome/browser/chromeos/login/user_manager.h" |
12 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | |
13 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/common/notification_service.h" | 13 #include "content/common/notification_service.h" |
15 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
16 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
17 | 16 |
18 namespace chromeos { | 17 namespace chromeos { |
19 | 18 |
20 namespace { | 19 namespace { |
21 | 20 |
22 // The resolution of the picture we want to get from the camera. | 21 // The resolution of the picture we want to get from the camera. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 UserManager* user_manager = UserManager::Get(); | 57 UserManager* user_manager = UserManager::Get(); |
59 std::string logged_in_user = user_manager->logged_in_user().email(); | 58 std::string logged_in_user = user_manager->logged_in_user().email(); |
60 int selected_image_index = | 59 int selected_image_index = |
61 user_manager->GetUserDefaultImageIndex(logged_in_user); | 60 user_manager->GetUserDefaultImageIndex(logged_in_user); |
62 // The image must have been assigned by UserManager on new user login but | 61 // The image must have been assigned by UserManager on new user login but |
63 // under some circumstances (i.e. the data is not written to Local State | 62 // under some circumstances (i.e. the data is not written to Local State |
64 // or the file was corrupt) -1 could still be returned. | 63 // or the file was corrupt) -1 could still be returned. |
65 if (selected_image_index == -1) | 64 if (selected_image_index == -1) |
66 selected_image_index = 0; | 65 selected_image_index = 0; |
67 actor_->SelectImage(selected_image_index); | 66 actor_->SelectImage(selected_image_index); |
68 | |
69 WizardAccessibilityHelper::GetInstance()->MaybeSpeak( | |
70 l10n_util::GetStringUTF8(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT).c_str(), | |
71 false, true); | |
72 } | 67 } |
73 | 68 |
74 void UserImageScreen::Hide() { | 69 void UserImageScreen::Hide() { |
75 camera_controller_.Stop(); | 70 camera_controller_.Stop(); |
76 if (actor_) | 71 if (actor_) |
77 actor_->Hide(); | 72 actor_->Hide(); |
78 } | 73 } |
79 | 74 |
80 void UserImageScreen::OnCaptureSuccess() { | 75 void UserImageScreen::OnCaptureSuccess() { |
81 if (!actor_) | 76 if (!actor_) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return; | 143 return; |
149 | 144 |
150 bool is_screen_locked = *Details<bool>(details).ptr(); | 145 bool is_screen_locked = *Details<bool>(details).ptr(); |
151 if (is_screen_locked) | 146 if (is_screen_locked) |
152 StopCamera(); | 147 StopCamera(); |
153 else if (actor_ && actor_->IsCapturing()) | 148 else if (actor_ && actor_->IsCapturing()) |
154 StartCamera(); | 149 StartCamera(); |
155 } | 150 } |
156 | 151 |
157 } // namespace chromeos | 152 } // namespace chromeos |
| 153 |
OLD | NEW |