| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() { |
| 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', |
| 600 onFailure, self.wallpaperRequest_); | 600 onSuccess, onFailure, function() {}, |
| 601 self.wallpaperRequest_); |
| 601 }); | 602 }); |
| 602 break; | 603 break; |
| 603 default: | 604 default: |
| 604 console.error('Unsupported wallpaper source.'); | 605 console.error('Unsupported wallpaper source.'); |
| 605 } | 606 } |
| 606 }; | 607 }; |
| 607 | 608 |
| 608 /* | 609 /* |
| 609 * Removes the oldest custom wallpaper. If the oldest one is set as current | 610 * Removes the oldest custom wallpaper. If the oldest one is set as current |
| 610 * wallpaper, removes the second oldest one to free some space. This should | 611 * wallpaper, removes the second oldest one to free some space. This should |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 } | 1092 } |
| 1092 this.wallpaperGrid_.dataModel = wallpapersDataModel; | 1093 this.wallpaperGrid_.dataModel = wallpapersDataModel; |
| 1093 if (selectedItem) { | 1094 if (selectedItem) { |
| 1094 this.wallpaperGrid_.selectedItem = selectedItem; | 1095 this.wallpaperGrid_.selectedItem = selectedItem; |
| 1095 this.wallpaperGrid_.activeItem = selectedItem; | 1096 this.wallpaperGrid_.activeItem = selectedItem; |
| 1096 } | 1097 } |
| 1097 } | 1098 } |
| 1098 }; | 1099 }; |
| 1099 | 1100 |
| 1100 })(); | 1101 })(); |
| OLD | NEW |