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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (!CommandLine::ForCurrentProcess()-> | 70 if (!CommandLine::ForCurrentProcess()-> |
71 HasSwitch(switches::kDisableHtml5Camera)) { | 71 HasSwitch(switches::kDisableHtml5Camera)) { |
72 localized_strings->SetString("cameraType", "webrtc"); | 72 localized_strings->SetString("cameraType", "webrtc"); |
73 } else { | 73 } else { |
74 localized_strings->SetString("cameraType", "old"); | 74 localized_strings->SetString("cameraType", "old"); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 void UserImageScreenHandler::Initialize() { | 78 void UserImageScreenHandler::Initialize() { |
79 ListValue image_urls; | 79 ListValue image_urls; |
80 for (int i = 0; i < kDefaultImagesCount; ++i) { | 80 for (int i = kFirstDefaultImageIndex; i < kDefaultImagesCount; ++i) { |
81 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); | 81 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); |
82 } | 82 } |
83 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages", | 83 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages", |
84 image_urls); | 84 image_urls); |
85 | 85 |
86 if (selected_image_ != User::kInvalidImageIndex) | 86 if (selected_image_ != User::kInvalidImageIndex) |
87 SelectImage(selected_image_); | 87 SelectImage(selected_image_); |
88 | 88 |
89 if (profile_picture_data_url_ != chrome::kAboutBlankURL) | 89 if (profile_picture_data_url_ != chrome::kAboutBlankURL) |
90 SendProfileImage(profile_picture_data_url_); | 90 SendProfileImage(profile_picture_data_url_); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 user_photo_ = gfx::ImageSkia(decoded_image); | 293 user_photo_ = gfx::ImageSkia(decoded_image); |
294 if (screen_ && accept_photo_after_decoding_) | 294 if (screen_ && accept_photo_after_decoding_) |
295 screen_->OnPhotoTaken(user_photo_); | 295 screen_->OnPhotoTaken(user_photo_); |
296 } | 296 } |
297 | 297 |
298 void UserImageScreenHandler::OnDecodeImageFailed(const ImageDecoder* decoder) { | 298 void UserImageScreenHandler::OnDecodeImageFailed(const ImageDecoder* decoder) { |
299 NOTREACHED() << "Failed to decode PNG image from WebUI"; | 299 NOTREACHED() << "Failed to decode PNG image from WebUI"; |
300 } | 300 } |
301 | 301 |
302 } // namespace chromeos | 302 } // namespace chromeos |
OLD | NEW |