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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.cc

Issue 10810073: [cros] Flip enable-html5-camera switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indentation fixes Created 8 years, 4 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 | Annotate | Revision Log
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/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 localized_strings->SetString("userImageScreenDescription", 60 localized_strings->SetString("userImageScreenDescription",
61 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT)); 61 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT));
62 localized_strings->SetString("takePhoto", 62 localized_strings->SetString("takePhoto",
63 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO)); 63 l10n_util::GetStringUTF16(IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO));
64 localized_strings->SetString("profilePhoto", 64 localized_strings->SetString("profilePhoto",
65 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO)); 65 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_PHOTO));
66 localized_strings->SetString("profilePhotoLoading", 66 localized_strings->SetString("profilePhotoLoading",
67 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO)); 67 l10n_util::GetStringUTF16(IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO));
68 localized_strings->SetString("okButtonText", 68 localized_strings->SetString("okButtonText",
69 l10n_util::GetStringUTF16(IDS_OK)); 69 l10n_util::GetStringUTF16(IDS_OK));
70 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHtml5Camera)) 70 if (!CommandLine::ForCurrentProcess()->
71 HasSwitch(switches::kDisableHtml5Camera)) {
71 localized_strings->SetString("cameraType", "webrtc"); 72 localized_strings->SetString("cameraType", "webrtc");
72 else 73 } else {
73 localized_strings->SetString("cameraType", "old"); 74 localized_strings->SetString("cameraType", "old");
75 }
74 } 76 }
75 77
76 void UserImageScreenHandler::Initialize() { 78 void UserImageScreenHandler::Initialize() {
77 ListValue image_urls; 79 ListValue image_urls;
78 for (int i = 0; i < kDefaultImagesCount; ++i) { 80 for (int i = 0; i < kDefaultImagesCount; ++i) {
79 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); 81 image_urls.Append(new StringValue(GetDefaultImageUrl(i)));
80 } 82 }
81 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages", 83 web_ui()->CallJavascriptFunction("oobe.UserImageScreen.setUserImages",
82 image_urls); 84 image_urls);
83 85
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 134 }
133 135
134 void UserImageScreenHandler::ShowCameraError() { 136 void UserImageScreenHandler::ShowCameraError() {
135 } 137 }
136 138
137 void UserImageScreenHandler::ShowCameraInitializing() { 139 void UserImageScreenHandler::ShowCameraInitializing() {
138 } 140 }
139 141
140 void UserImageScreenHandler::CheckCameraPresence() { 142 void UserImageScreenHandler::CheckCameraPresence() {
141 // For WebRTC, camera presence checked is done on JS side. 143 // For WebRTC, camera presence checked is done on JS side.
142 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHtml5Camera)) 144 if (!CommandLine::ForCurrentProcess()->
145 HasSwitch(switches::kDisableHtml5Camera)) {
143 return; 146 return;
147 }
144 CameraDetector::StartPresenceCheck( 148 CameraDetector::StartPresenceCheck(
145 base::Bind(&UserImageScreenHandler::OnCameraPresenceCheckDone, 149 base::Bind(&UserImageScreenHandler::OnCameraPresenceCheckDone,
146 weak_factory_.GetWeakPtr())); 150 weak_factory_.GetWeakPtr()));
147 } 151 }
148 152
149 bool UserImageScreenHandler::IsCapturing() const { 153 bool UserImageScreenHandler::IsCapturing() const {
150 return false; 154 return false;
151 } 155 }
152 156
153 void UserImageScreenHandler::RegisterMessages() { 157 void UserImageScreenHandler::RegisterMessages() {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 user_photo_ = gfx::ImageSkia(decoded_image); 293 user_photo_ = gfx::ImageSkia(decoded_image);
290 if (screen_ && accept_photo_after_decoding_) 294 if (screen_ && accept_photo_after_decoding_)
291 screen_->OnPhotoTaken(user_photo_); 295 screen_->OnPhotoTaken(user_photo_);
292 } 296 }
293 297
294 void UserImageScreenHandler::OnDecodeImageFailed(const ImageDecoder* decoder) { 298 void UserImageScreenHandler::OnDecodeImageFailed(const ImageDecoder* decoder) {
295 NOTREACHED() << "Failed to decode PNG image from WebUI"; 299 NOTREACHED() << "Failed to decode PNG image from WebUI";
296 } 300 }
297 301
298 } // namespace chromeos 302 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698