Chromium Code Reviews| Index: ui/file_manager/gallery/js/image_editor/image_util.js |
| diff --git a/ui/file_manager/gallery/js/image_editor/image_util.js b/ui/file_manager/gallery/js/image_editor/image_util.js |
| index 83f4d63261d937c727007ff22e4b0e1fdbe31424..305439882407a20779b755a82230c716b322a0ee 100644 |
| --- a/ui/file_manager/gallery/js/image_editor/image_util.js |
| +++ b/ui/file_manager/gallery/js/image_editor/image_util.js |
| @@ -427,11 +427,19 @@ ImageUtil.setClass = function(element, className, on) { |
| * account. |
| * |
| * @param {!HTMLDocument} document Owner document. |
| + * @param {!MetadataModel} metadataModel |
| * @constructor |
| * @struct |
| */ |
| -ImageUtil.ImageLoader = function(document) { |
| +ImageUtil.ImageLoader = function(document, metadataModel) { |
| this.document_ = document; |
| + |
| + /** |
| + * @private {!MetadataModel} |
| + * @const |
| + */ |
| + this.metadataModel_ = metadataModel; |
| + |
| this.image_ = new Image(); |
| this.generation_ = 0; |
| @@ -510,14 +518,11 @@ ImageUtil.ImageLoader.prototype.load = function(item, callback, opt_delay) { |
| this.image_.onload = function() { |
| this.image_.onerror = null; |
| this.image_.onload = null; |
| - item.getFetchedMedia().then(function(fetchedMediaMetadata) { |
| - if (fetchedMediaMetadata.imageTransform) |
| - onTransform(this.image_, fetchedMediaMetadata.imageTransform); |
| - else |
| - onTransform(this.image_); |
| - }.bind(this)).catch(function(error) { |
| - console.error(error.stack || error); |
| - }); |
| + this.metadataModel_.get([entry], ['contentThumbnailTransform']).then( |
|
yawano
2015/03/03 04:14:50
Isn't this contentImageTransform instead of conten
hirono
2015/03/04 05:07:04
Good catch. Done.
|
| + function(metadataItems) { |
| + onTransform( |
| + this.image_, metadataItems[0].contentThumbnailTransform); |
| + }.bind(this)); |
| }.bind(this); |
| // The error callback has an optional error argument, which in case of a |