Chromium Code Reviews| 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 65d012ff2b42fc2a541101782b7be95f58bd8dfc..a2032d530c22d188fc8ddb90efb5c01b3a30416e 100644 |
| --- a/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js |
| +++ b/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js |
| @@ -460,16 +460,27 @@ ThumbnailLoader.prototype.loadDetachedImage = function(callback) { |
| this.metadata_.filesystem && |
| this.metadata_.filesystem.modificationTime && |
| this.metadata_.filesystem.modificationTime.getTime(); |
| + var loader_options = { |
|
mtomasz
2017/02/16 08:53:41
nit: camelCase for variable names in JS.
yamaguchi
2017/02/16 14:01:18
Done.
|
| + maxWidth: ThumbnailLoader.THUMBNAIL_MAX_WIDTH, |
| + maxHeight: ThumbnailLoader.THUMBNAIL_MAX_HEIGHT, |
| + cache: true, |
| + priority: this.priority_, |
| + timestamp: modificationTime |
| + }; |
| + if (this.metadata_ && this.metadata_.media && |
| + this.metadata_.media.imageTransform) { |
| + loader_options.image_transform = this.metadata_.media.imageTransform; |
| + } |
| + // Comsume the transform parameter to avoid duplicated transformation in |
| + // getImage(). |
| + // TODO(yamaguchi): remove this line when we move the image transformation |
| + // logic out of this class. |
| + this.transform_ = undefined; |
| + |
| this.taskId_ = ImageLoaderClient.loadToImage( |
| this.thumbnailUrl_, |
| this.image_, |
| - { |
| - maxWidth: ThumbnailLoader.THUMBNAIL_MAX_WIDTH, |
| - maxHeight: ThumbnailLoader.THUMBNAIL_MAX_HEIGHT, |
| - cache: true, |
| - priority: this.priority_, |
| - timestamp: modificationTime |
| - }, |
| + loader_options, |
| function() {}, |
| function() { |
| this.image_.onerror(new Event('load-error')); |