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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/user_image_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chromeos/extensions/wallpaper_private_api.h" 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 class WallpaperSetWallpaperFunction::WallpaperDecoder 56 class WallpaperSetWallpaperFunction::WallpaperDecoder
57 : public ImageDecoder::Delegate { 57 : public ImageDecoder::Delegate {
58 public: 58 public:
59 explicit WallpaperDecoder( 59 explicit WallpaperDecoder(
60 scoped_refptr<WallpaperSetWallpaperFunction> function) 60 scoped_refptr<WallpaperSetWallpaperFunction> function)
61 : function_(function) { 61 : function_(function) {
62 } 62 }
63 63
64 void Start(const std::string& image_data) { 64 void Start(const std::string& image_data) {
65 image_decoder_ = new ImageDecoder(this, image_data); 65 image_decoder_ = new ImageDecoder(this, image_data,
66 ImageDecoder::ROBUST_JPEG_CODEC);
66 image_decoder_->Start(); 67 image_decoder_->Start();
67 } 68 }
68 69
69 void Cancel() { 70 void Cancel() {
70 cancel_flag_.Set(); 71 cancel_flag_.Set();
71 function_->SendResponse(false); 72 function_->SendResponse(false);
72 } 73 }
73 74
74 virtual void OnImageDecoded(const ImageDecoder* decoder, 75 virtual void OnImageDecoded(const ImageDecoder* decoder,
75 const SkBitmap& decoded_image) OVERRIDE { 76 const SkBitmap& decoded_image) OVERRIDE {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 chromeos::WallpaperInfo info = { 189 chromeos::WallpaperInfo info = {
189 file_name_, 190 file_name_,
190 layout_, 191 layout_,
191 chromeos::User::ONLINE, 192 chromeos::User::ONLINE,
192 base::Time::Now().LocalMidnight() 193 base::Time::Now().LocalMidnight()
193 }; 194 };
194 wallpaper_manager->SetUserWallpaperInfo(email_, info, is_persistent); 195 wallpaper_manager->SetUserWallpaperInfo(email_, info, is_persistent);
195 wallpaper_decoder_ = NULL; 196 wallpaper_decoder_ = NULL;
196 SendResponse(true); 197 SendResponse(true);
197 } 198 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/user_image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698