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

Unified Diff: ui/file_manager/gallery/js/gallery_item.js

Issue 2678723002: Compile several targets in Gallery in gyp v2. (Closed)
Patch Set: Rebased. Created 3 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/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 358bb93fd9d66e99f38cec0c52afd0727c5e6c21..75aa5e740b637bd9c6c0dd787e84fae278d7ebfd 100644
--- a/ui/file_manager/gallery/js/gallery_item.js
+++ b/ui/file_manager/gallery/js/gallery_item.js
@@ -60,6 +60,14 @@ function GalleryItem(
};
/**
+ * Types of metadata Gallery uses (to query the metadata cache).
+ * @const
+ * @type {!Array<string>}
+ */
+GalleryItem.PREFETCH_PROPERTY_NAMES =
+ ['imageWidth', 'imageHeight', 'imageRotation', 'size', 'present'];
+
+/**
* @return {!FileEntry} Image entry.
*/
GalleryItem.prototype.getEntry = function() { return this.entry_; };
@@ -261,7 +269,7 @@ GalleryItem.prototype.getCopyName = function(dirEntry) {
*/
GalleryItem.prototype.saveToFile = function(
volumeManager, metadataModel, fallbackDir, canvas, overwrite, callback) {
- ImageUtil.metrics.startInterval(ImageUtil.getMetricName('SaveTime'));
+ metrics.startInterval(ImageUtil.getMetricName('SaveTime'));
var saveResultRecorded = false;
Promise.all([this.getEntryToWrite_(overwrite, fallbackDir, volumeManager),
@@ -304,9 +312,9 @@ GalleryItem.prototype.saveToFile = function(
locationInfo = this.locationInfo_;
}
- ImageUtil.metrics.recordEnum(ImageUtil.getMetricName('SaveResult'), 1, 2);
+ metrics.recordEnum(ImageUtil.getMetricName('SaveResult'), 1, 2);
saveResultRecorded = true;
- ImageUtil.metrics.recordInterval(ImageUtil.getMetricName('SaveTime'));
+ metrics.recordInterval(ImageUtil.getMetricName('SaveTime'));
this.entry_ = fileEntry;
this.locationInfo_ = locationInfo;
@@ -314,7 +322,7 @@ GalleryItem.prototype.saveToFile = function(
// Updates the metadata.
metadataModel.notifyEntriesChanged([this.entry_]);
Promise.all([
- metadataModel.get([this.entry_], Gallery.PREFETCH_PROPERTY_NAMES),
+ metadataModel.get([this.entry_], GalleryItem.PREFETCH_PROPERTY_NAMES),
new ThumbnailModel(metadataModel).get([this.entry_])
]).then(function(metadataLists) {
this.metadataItem_ = metadataLists[0][0];
@@ -328,7 +336,7 @@ GalleryItem.prototype.saveToFile = function(
console.error('Error saving from gallery', this.entry_.name, error);
if (!saveResultRecorded)
- ImageUtil.metrics.recordEnum(ImageUtil.getMetricName('SaveResult'), 0, 2);
+ metrics.recordEnum(ImageUtil.getMetricName('SaveResult'), 0, 2);
callback(false);
}.bind(this));
« no previous file with comments | « ui/file_manager/gallery/js/gallery_data_model.js ('k') | ui/file_manager/gallery/js/gallery_item_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698