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/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 Loading... | |
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, true); |
Mihai Parparita -not on Chrome
2012/08/28 23:39:40
Drive-by nit: boolean parameters like this make co
oshima
2012/08/29 00:02:48
While I agree with the issue with the boolean,
DE
Emmanuel Saint-loubert-Bié
2012/08/29 00:52:52
Yes good idea. I will do that
| |
66 image_decoder_->Start(); | 66 image_decoder_->Start(); |
67 } | 67 } |
68 | 68 |
69 void Cancel() { | 69 void Cancel() { |
70 cancel_flag_.Set(); | 70 cancel_flag_.Set(); |
71 function_->SendResponse(false); | 71 function_->SendResponse(false); |
72 } | 72 } |
73 | 73 |
74 virtual void OnImageDecoded(const ImageDecoder* decoder, | 74 virtual void OnImageDecoded(const ImageDecoder* decoder, |
75 const SkBitmap& decoded_image) OVERRIDE { | 75 const SkBitmap& decoded_image) OVERRIDE { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 chromeos::WallpaperInfo info = { | 188 chromeos::WallpaperInfo info = { |
189 file_name_, | 189 file_name_, |
190 layout_, | 190 layout_, |
191 chromeos::User::ONLINE, | 191 chromeos::User::ONLINE, |
192 base::Time::Now().LocalMidnight() | 192 base::Time::Now().LocalMidnight() |
193 }; | 193 }; |
194 wallpaper_manager->SetUserWallpaperInfo(email_, info, is_persistent); | 194 wallpaper_manager->SetUserWallpaperInfo(email_, info, is_persistent); |
195 wallpaper_decoder_ = NULL; | 195 wallpaper_decoder_ = NULL; |
196 SendResponse(true); | 196 SendResponse(true); |
197 } | 197 } |
OLD | NEW |