Index: ui/file_manager/gallery/js/gallery_item.js |
diff --git a/ui/file_manager/gallery/js/gallery_item.js b/ui/file_manager/gallery/js/gallery_item.js |
index 6d87f3ea692973a0fe5d86e704513e2a04707b0c..65641ebf176c9119b9a4f8de7067b60a551f2daa 100644 |
--- a/ui/file_manager/gallery/js/gallery_item.js |
+++ b/ui/file_manager/gallery/js/gallery_item.js |
@@ -8,6 +8,7 @@ |
* @param {!FileEntry} entry Image entry. |
* @param {!EntryLocation} locationInfo Entry location information. |
* @param {!Object} metadata Metadata for the entry. |
+ * @param {!MetadataItem} metadataItem |
* @param {!MetadataCache} metadataCache Metadata cache instance. |
* @param {!MetadataModel} metadataModel File system metadata. |
* @param {boolean} original Whether the entry is original or edited. |
@@ -15,8 +16,8 @@ |
* @struct |
*/ |
Gallery.Item = function( |
- entry, locationInfo, metadata, metadataCache, metadataModel, |
- original) { |
+ entry, locationInfo, metadata, metadataItem, metadataCache, |
+ metadataModel, original) { |
/** |
* @type {!FileEntry} |
* @private |
@@ -36,6 +37,11 @@ Gallery.Item = function( |
this.metadata_ = Object.preventExtensions(metadata); |
/** |
+ * @type {!MetadataItem} |
+ */ |
+ this.metadataItem_ = metadataItem; |
+ |
+ /** |
* @type {!MetadataCache} |
* @private |
* @const |
@@ -100,24 +106,10 @@ Gallery.Item.prototype.getLocationInfo = function() { |
Gallery.Item.prototype.getMetadata = function() { return this.metadata_; }; |
/** |
- * Obtains the latest media metadata. |
- * |
- * This is a heavy operation since it forces to load the image data to obtain |
- * the metadata. |
- * @return {!Promise} Promise to be fulfilled with fetched metadata. |
+ * @return {!MetadataItem} Metadata. |
*/ |
-Gallery.Item.prototype.getFetchedMedia = function() { |
- return new Promise(function(fulfill, reject) { |
- this.metadataCache_.getLatest( |
- [this.entry_], |
- 'fetchedMedia', |
- function(metadata) { |
- if (metadata[0]) |
- fulfill(metadata[0]); |
- else |
- reject('Failed to load metadata.'); |
- }); |
- }.bind(this)); |
+Gallery.Item.prototype.getMetadataItem = function() { |
+ return this.metadataItem_; |
}; |
/** |