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

Side by Side Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js

Issue 23820003: Fixed JS Console Error in the Wallpaper Picker App when selecting a custom wallpaper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wallpaper-escape-fix
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 /** 5 /**
6 * WallpaperManager constructor. 6 * WallpaperManager constructor.
7 * 7 *
8 * WallpaperManager objects encapsulate the functionality of the wallpaper 8 * WallpaperManager objects encapsulate the functionality of the wallpaper
9 * manager extension. 9 * manager extension.
10 * 10 *
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 /** 611 /**
612 * Set attributions of wallpaper with given URL. If URL is not valid, clear 612 * Set attributions of wallpaper with given URL. If URL is not valid, clear
613 * the attributions. 613 * the attributions.
614 * @param {{baseURL: string, dynamicURL: string, layout: string, 614 * @param {{baseURL: string, dynamicURL: string, layout: string,
615 * author: string, authorWebsite: string, availableOffline: boolean}} 615 * author: string, authorWebsite: string, availableOffline: boolean}}
616 * selectedItem selected wallpaper item in grid. 616 * selectedItem selected wallpaper item in grid.
617 * @private 617 * @private
618 */ 618 */
619 WallpaperManager.prototype.setWallpaperAttribution_ = function(selectedItem) { 619 WallpaperManager.prototype.setWallpaperAttribution_ = function(selectedItem) {
620 if (selectedItem) { 620 if (selectedItem && selectedItem.source != 'ADDNEW') {
621 $('author-name').textContent = selectedItem.author; 621 $('author-name').textContent = selectedItem.author;
622 $('author-website').textContent = $('author-website').href = 622 $('author-website').textContent = $('author-website').href =
623 selectedItem.authorWebsite; 623 selectedItem.authorWebsite;
624 chrome.wallpaperPrivate.getThumbnail(selectedItem.baseURL, 624 chrome.wallpaperPrivate.getThumbnail(selectedItem.baseURL,
625 selectedItem.source, 625 selectedItem.source,
626 function(data) { 626 function(data) {
627 var img = $('attribute-image'); 627 var img = $('attribute-image');
628 if (data) { 628 if (data) {
629 var blob = new Blob([new Int8Array(data)], {'type' : 'image\/png'}); 629 var blob = new Blob([new Int8Array(data)], {'type' : 'image\/png'});
630 img.src = window.URL.createObjectURL(blob); 630 img.src = window.URL.createObjectURL(blob);
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 } 1006 }
1007 } 1007 }
1008 } 1008 }
1009 this.wallpaperGrid_.dataModel = wallpapersDataModel; 1009 this.wallpaperGrid_.dataModel = wallpapersDataModel;
1010 this.wallpaperGrid_.selectedItem = selectedItem; 1010 this.wallpaperGrid_.selectedItem = selectedItem;
1011 this.wallpaperGrid_.activeItem = selectedItem; 1011 this.wallpaperGrid_.activeItem = selectedItem;
1012 } 1012 }
1013 }; 1013 };
1014 1014
1015 })(); 1015 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698