OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 base::RefCountedBytes* original_data, | 229 base::RefCountedBytes* original_data, |
230 base::RefCountedBytes* thumbnail_data) { | 230 base::RefCountedBytes* thumbnail_data) { |
231 BinaryValue* original_result = BinaryValue::CreateWithCopiedBuffer( | 231 BinaryValue* original_result = BinaryValue::CreateWithCopiedBuffer( |
232 reinterpret_cast<const char*>(original_data->front()), | 232 reinterpret_cast<const char*>(original_data->front()), |
233 original_data->size()); | 233 original_data->size()); |
234 BinaryValue* thumbnail_result = BinaryValue::CreateWithCopiedBuffer( | 234 BinaryValue* thumbnail_result = BinaryValue::CreateWithCopiedBuffer( |
235 reinterpret_cast<const char*>(thumbnail_data->front()), | 235 reinterpret_cast<const char*>(thumbnail_data->front()), |
236 thumbnail_data->size()); | 236 thumbnail_data->size()); |
237 | 237 |
238 if (params_->details.thumbnail) { | 238 if (params_->details.thumbnail) { |
239 SetResult(thumbnail_result); | 239 SetResult(base::WrapUnique(thumbnail_result)); |
Lei Zhang
2016/05/19 07:21:33
#include ptr_util.h and <memory> ?
dcheng
2016/05/19 07:34:25
Done, though <memory> is in the 'associated' heade
| |
240 SendResponse(true); | 240 SendResponse(true); |
241 } | 241 } |
242 | 242 |
243 // Inform the native Wallpaper Picker Application that the current wallpaper | 243 // Inform the native Wallpaper Picker Application that the current wallpaper |
244 // has been modified by a third party application. | 244 // has been modified by a third party application. |
245 if (extension()->id() != extension_misc::kWallpaperManagerId) { | 245 if (extension()->id() != extension_misc::kWallpaperManagerId) { |
246 Profile* profile = Profile::FromBrowserContext(browser_context()); | 246 Profile* profile = Profile::FromBrowserContext(browser_context()); |
247 extensions::EventRouter* event_router = | 247 extensions::EventRouter* event_router = |
248 extensions::EventRouter::Get(profile); | 248 extensions::EventRouter::Get(profile); |
249 std::unique_ptr<base::ListValue> event_args(new base::ListValue()); | 249 std::unique_ptr<base::ListValue> event_args(new base::ListValue()); |
(...skipping 27 matching lines...) Expand all Loading... | |
277 const std::string& response) { | 277 const std::string& response) { |
278 if (success) { | 278 if (success) { |
279 params_->details.data.reset( | 279 params_->details.data.reset( |
280 new std::vector<char>(response.begin(), response.end())); | 280 new std::vector<char>(response.begin(), response.end())); |
281 StartDecode(*params_->details.data); | 281 StartDecode(*params_->details.data); |
282 } else { | 282 } else { |
283 SetError(response); | 283 SetError(response); |
284 SendResponse(false); | 284 SendResponse(false); |
285 } | 285 } |
286 } | 286 } |
OLD | NEW |