OLD | NEW |
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 Loading... |
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 Loading... |
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 })(); |
OLD | NEW |