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/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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO)); | 58 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO)); |
59 localized_strings->SetString("profilePhotoLoading", | 59 localized_strings->SetString("profilePhotoLoading", |
60 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO)); | 60 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO)); |
61 localized_strings->SetString("okButtonText", | 61 localized_strings->SetString("okButtonText", |
62 l10n_util::GetStringUTF16(IDS_OK)); | 62 l10n_util::GetStringUTF16(IDS_OK)); |
63 } | 63 } |
64 | 64 |
65 void UserImageScreenHandler::Initialize() { | 65 void UserImageScreenHandler::Initialize() { |
66 ListValue image_urls; | 66 ListValue image_urls; |
67 for (int i = 0; i < kDefaultImagesCount; ++i) { | 67 for (int i = 0; i < kDefaultImagesCount; ++i) { |
68 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); | 68 DictionaryValue* dict = new DictionaryValue(); |
| 69 dict->Set("url", new StringValue(GetDefaultImageUrl(i))); |
| 70 dict->Set("title", new StringValue(GetDefaultImageDescription(i))); |
| 71 image_urls.Append(dict); |
69 } | 72 } |
70 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages", | 73 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages", |
71 image_urls); | 74 image_urls); |
72 | 75 |
73 if (selected_image_ != User::kInvalidImageIndex) | 76 if (selected_image_ != User::kInvalidImageIndex) |
74 SelectImage(selected_image_); | 77 SelectImage(selected_image_); |
75 | 78 |
76 if (profile_picture_data_url_ != chrome::kAboutBlankURL) | 79 if (profile_picture_data_url_ != chrome::kAboutBlankURL) |
77 SendProfileImage(profile_picture_data_url_); | 80 SendProfileImage(profile_picture_data_url_); |
78 else if (profile_picture_absent_) | 81 else if (profile_picture_absent_) |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 243 } |
241 | 244 |
242 void UserImageScreenHandler::OnCameraPresenceCheckDone() { | 245 void UserImageScreenHandler::OnCameraPresenceCheckDone() { |
243 base::FundamentalValue present_value( | 246 base::FundamentalValue present_value( |
244 CameraDetector::camera_presence() == CameraDetector::kCameraPresent); | 247 CameraDetector::camera_presence() == CameraDetector::kCameraPresent); |
245 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setCameraPresent", | 248 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setCameraPresent", |
246 present_value); | 249 present_value); |
247 } | 250 } |
248 | 251 |
249 } // namespace chromeos | 252 } // namespace chromeos |
OLD | NEW |