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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 str('canceledWallpaper')) { | 584 str('canceledWallpaper')) { |
585 self.showError_(chrome.runtime.lastError.message); | 585 self.showError_(chrome.runtime.lastError.message); |
586 } else { | 586 } else { |
587 self.onWallpaperChanged_(selectedItem, wallpaperURL); | 587 self.onWallpaperChanged_(selectedItem, wallpaperURL); |
588 } | 588 } |
589 }); | 589 }); |
590 WallpaperUtil.saveWallpaperInfo(wallpaperURL, selectedItem.layout, | 590 WallpaperUtil.saveWallpaperInfo(wallpaperURL, selectedItem.layout, |
591 selectedItem.source); | 591 selectedItem.source); |
592 self.wallpaperRequest_ = null; | 592 self.wallpaperRequest_ = null; |
593 }; | 593 }; |
594 var onFailure = function() { | 594 var onFailure = function(status) { |
595 self.progressManager_.hideProgressBar(selectedGridItem); | 595 self.progressManager_.hideProgressBar(selectedGridItem); |
596 self.showError_(str('downloadFailed')); | 596 self.showError_(str('downloadFailed')); |
597 self.wallpaperRequest_ = null; | 597 self.wallpaperRequest_ = null; |
598 }; | 598 }; |
599 WallpaperUtil.fetchURL(wallpaperURL, 'arraybuffer', onSuccess, | 599 WallpaperUtil.fetchURL(wallpaperURL, 'arraybuffer', onSuccess, |
600 onFailure, self.wallpaperRequest_); | 600 onFailure, self.wallpaperRequest_); |
601 }); | 601 }); |
602 break; | 602 break; |
603 default: | 603 default: |
604 console.error('Unsupported wallpaper source.'); | 604 console.error('Unsupported wallpaper source.'); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 } | 1091 } |
1092 this.wallpaperGrid_.dataModel = wallpapersDataModel; | 1092 this.wallpaperGrid_.dataModel = wallpapersDataModel; |
1093 if (selectedItem) { | 1093 if (selectedItem) { |
1094 this.wallpaperGrid_.selectedItem = selectedItem; | 1094 this.wallpaperGrid_.selectedItem = selectedItem; |
1095 this.wallpaperGrid_.activeItem = selectedItem; | 1095 this.wallpaperGrid_.activeItem = selectedItem; |
1096 } | 1096 } |
1097 } | 1097 } |
1098 }; | 1098 }; |
1099 | 1099 |
1100 })(); | 1100 })(); |
OLD | NEW |