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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 layout, | 857 layout, |
858 generateThumbnail, | 858 generateThumbnail, |
859 fileName, | 859 fileName, |
860 success, | 860 success, |
861 failure) { | 861 failure) { |
862 var self = this; | 862 var self = this; |
863 var onFinished = function(opt_thumbnail) { | 863 var onFinished = function(opt_thumbnail) { |
864 if (chrome.runtime.lastError != undefined) { | 864 if (chrome.runtime.lastError != undefined) { |
865 self.showError_(chrome.runtime.lastError.message); | 865 self.showError_(chrome.runtime.lastError.message); |
866 $('set-wallpaper-layout').disabled = true; | 866 $('set-wallpaper-layout').disabled = true; |
| 867 failure(); |
867 } else { | 868 } else { |
868 success(opt_thumbnail); | 869 success(opt_thumbnail); |
869 } | 870 } |
870 }; | 871 }; |
871 | 872 |
872 chrome.wallpaperPrivate.setCustomWallpaper(wallpaper, layout, | 873 chrome.wallpaperPrivate.setCustomWallpaper(wallpaper, layout, |
873 generateThumbnail, | 874 generateThumbnail, |
874 fileName, onFinished); | 875 fileName, onFinished); |
875 }; | 876 }; |
876 | 877 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 } | 1018 } |
1018 } | 1019 } |
1019 } | 1020 } |
1020 this.wallpaperGrid_.dataModel = wallpapersDataModel; | 1021 this.wallpaperGrid_.dataModel = wallpapersDataModel; |
1021 this.wallpaperGrid_.selectedItem = selectedItem; | 1022 this.wallpaperGrid_.selectedItem = selectedItem; |
1022 this.wallpaperGrid_.activeItem = selectedItem; | 1023 this.wallpaperGrid_.activeItem = selectedItem; |
1023 } | 1024 } |
1024 }; | 1025 }; |
1025 | 1026 |
1026 })(); | 1027 })(); |
OLD | NEW |