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/ui/webui/chromeos/login/user_image_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 selected_image_(UserManager::User::kInvalidImageIndex), | 36 selected_image_(UserManager::User::kInvalidImageIndex), |
37 profile_picture_data_url_(chrome::kAboutBlankURL), | 37 profile_picture_data_url_(chrome::kAboutBlankURL), |
38 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 38 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
39 } | 39 } |
40 | 40 |
41 UserImageScreenHandler::~UserImageScreenHandler() { | 41 UserImageScreenHandler::~UserImageScreenHandler() { |
42 } | 42 } |
43 | 43 |
44 void UserImageScreenHandler::GetLocalizedStrings( | 44 void UserImageScreenHandler::GetLocalizedStrings( |
45 DictionaryValue *localized_strings) { | 45 DictionaryValue *localized_strings) { |
| 46 // TODO(ivankr): string should be renamed to something like |
| 47 // IDS_USER_IMAGE_SCREEN_TITLE (currently used for Take Photo dialog). |
46 localized_strings->SetString("userImageScreenTitle", | 48 localized_strings->SetString("userImageScreenTitle", |
47 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TITLE)); | 49 l10n_util::GetStringUTF16(IDS_OOBE_PICTURE)); |
48 localized_strings->SetString("userImageScreenDescription", | 50 localized_strings->SetString("userImageScreenDescription", |
49 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT)); | 51 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT)); |
50 localized_strings->SetString("takePhoto", | 52 localized_strings->SetString("takePhoto", |
51 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO)); | 53 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO)); |
52 localized_strings->SetString("profilePhoto", | 54 localized_strings->SetString("profilePhoto", |
53 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO)); | 55 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO)); |
54 localized_strings->SetString("profilePhotoLoading", | 56 localized_strings->SetString("profilePhotoLoading", |
55 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO)); | 57 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO)); |
56 localized_strings->SetString("okButtonText", | 58 localized_strings->SetString("okButtonText", |
57 l10n_util::GetStringUTF16(IDS_OK)); | 59 l10n_util::GetStringUTF16(IDS_OK)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 212 } |
211 | 213 |
212 void UserImageScreenHandler::OnCameraPresenceCheckDone() { | 214 void UserImageScreenHandler::OnCameraPresenceCheckDone() { |
213 base::FundamentalValue present_value( | 215 base::FundamentalValue present_value( |
214 CameraDetector::camera_presence() == CameraDetector::kCameraPresent); | 216 CameraDetector::camera_presence() == CameraDetector::kCameraPresent); |
215 web_ui_->CallJavascriptFunction("oobe.UserImageScreen.setCameraPresent", | 217 web_ui_->CallJavascriptFunction("oobe.UserImageScreen.setCameraPresent", |
216 present_value); | 218 present_value); |
217 } | 219 } |
218 | 220 |
219 } // namespace chromeos | 221 } // namespace chromeos |
OLD | NEW |