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

Unified Diff: ui/file_manager/file_manager/foreground/js/thumbnail_loader.js

Issue 912783002: Integrate ListThumbnailLoader to list view and grid view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failed test case. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
diff --git a/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js b/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
index 83d3b391649c95c01529d11b29bd548b7ad45c6e..2d6aaff509455dbac35c4e79ed958ac4da47ccf3 100644
--- a/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
+++ b/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
@@ -252,7 +252,7 @@ ThumbnailLoader.prototype.load = function(box, fillMode, opt_optimizationMode,
* which is resolved when data url is fetched.
*/
ThumbnailLoader.prototype.loadAsDataUrl = function() {
- return new Promise(function(resolve) {
+ return new Promise(function(resolve, reject) {
// Load by using ImageLoaderClient.
var modificationTime = this.metadata_ &&
this.metadata_.filesystem &&
@@ -260,7 +260,12 @@ ThumbnailLoader.prototype.loadAsDataUrl = function() {
this.metadata_.filesystem.modificationTime.getTime();
ImageLoaderClient.getInstance().load(
this.thumbnailUrl_,
- resolve,
+ function(result) {
+ if (result.status === 'success')
+ resolve(result);
+ else
+ reject(result);
+ },
{
maxWidth: ThumbnailLoader.THUMBNAIL_MAX_WIDTH,
maxHeight: ThumbnailLoader.THUMBNAIL_MAX_HEIGHT,
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/main_scripts.js ('k') | ui/file_manager/file_manager/foreground/js/ui/file_grid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698