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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_api.cc

Issue 1986583002: Fix the browser crash when changing wallpaper with chrome.wallpaper API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address bshe@'s comment. Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/wallpaper/test.js » ('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 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
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());
250 event_args->Append(original_result); 250 event_args->Append(original_result);
251 event_args->Append(thumbnail_result); 251 event_args->Append(thumbnail_result->DeepCopy());
252 event_args->Append(new base::StringValue( 252 event_args->Append(new base::StringValue(
253 extensions::api::wallpaper::ToString(params_->details.layout))); 253 extensions::api::wallpaper::ToString(params_->details.layout)));
254 // Setting wallpaper from right click menu in 'Files' app is a feature that 254 // Setting wallpaper from right click menu in 'Files' app is a feature that
255 // was implemented in crbug.com/578935. Since 'Files' app is a built-in v1 255 // was implemented in crbug.com/578935. Since 'Files' app is a built-in v1
256 // app in ChromeOS, we should treat it slightly differently with other third 256 // app in ChromeOS, we should treat it slightly differently with other third
257 // party apps: the wallpaper set by the 'Files' app should still be syncable 257 // party apps: the wallpaper set by the 'Files' app should still be syncable
258 // and it should not appear in the wallpaper grid in the Wallpaper Picker. 258 // and it should not appear in the wallpaper grid in the Wallpaper Picker.
259 // But we should not display the 'wallpaper-set-by-mesage' since it might 259 // But we should not display the 'wallpaper-set-by-mesage' since it might
260 // introduce confusion as shown in crbug.com/599407. 260 // introduce confusion as shown in crbug.com/599407.
261 event_args->Append(new base::StringValue( 261 event_args->Append(new base::StringValue(
(...skipping 15 matching lines...) Expand all
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/wallpaper/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698