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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc

Issue 10892023: Force avatar and wallpaper decoding to use robust JPEG. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reordered. Created 8 years, 3 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/options/chromeos/change_picture_options_handle r.h" 5 #include "chrome/browser/ui/webui/options/chromeos/change_picture_options_handle r.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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 std::string mime_type, charset, raw_data; 193 std::string mime_type, charset, raw_data;
194 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data)) 194 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data))
195 NOTREACHED(); 195 NOTREACHED();
196 DCHECK_EQ("image/png", mime_type); 196 DCHECK_EQ("image/png", mime_type);
197 197
198 user_photo_ = gfx::ImageSkia(); 198 user_photo_ = gfx::ImageSkia();
199 user_photo_data_url_ = image_url; 199 user_photo_data_url_ = image_url;
200 200
201 if (image_decoder_.get()) 201 if (image_decoder_.get())
202 image_decoder_->set_delegate(NULL); 202 image_decoder_->set_delegate(NULL);
203 image_decoder_ = new ImageDecoder(this, raw_data); 203 image_decoder_ = new ImageDecoder(this, raw_data,
204 ImageDecoder::ROBUST_JPEG_CODEC);
204 image_decoder_->Start(); 205 image_decoder_->Start();
205 } 206 }
206 207
207 void ChangePictureOptionsHandler::HandlePageInitialized( 208 void ChangePictureOptionsHandler::HandlePageInitialized(
208 const base::ListValue* args) { 209 const base::ListValue* args) {
209 DCHECK(args && args->empty()); 210 DCHECK(args && args->empty());
210 211
211 if (CommandLine::ForCurrentProcess()-> 212 if (CommandLine::ForCurrentProcess()->
212 HasSwitch(switches::kDisableHtml5Camera)) { 213 HasSwitch(switches::kDisableHtml5Camera)) {
213 // If no camera presence check has been performed in this session, 214 // If no camera presence check has been performed in this session,
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 OnPhotoAccepted(user_photo_); 442 OnPhotoAccepted(user_photo_);
442 } 443 }
443 444
444 void ChangePictureOptionsHandler::OnDecodeImageFailed( 445 void ChangePictureOptionsHandler::OnDecodeImageFailed(
445 const ImageDecoder* decoder) { 446 const ImageDecoder* decoder) {
446 NOTREACHED() << "Failed to decode PNG image from WebUI"; 447 NOTREACHED() << "Failed to decode PNG image from WebUI";
447 } 448 }
448 449
449 } // namespace options 450 } // namespace options
450 } // namespace chromeos 451 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.cc ('k') | chrome/common/chrome_utility_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698