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

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

Issue 853653004: Gallery: Add items to GalleryDataModel before loading their metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 8 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
« no previous file with comments | « ui/file_manager/gallery/js/ribbon.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index 5451ebe6e04760eb9c3d3b2e019fd45e14ee6b7d..d492ed944099b2c4a66a0b2bf14b584739bb715f 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -992,8 +992,11 @@ SlideMode.prototype.itemLoaded_ = function(
return Math.round(number / (1000 * 1000));
};
- ImageUtil.metrics.recordSmallCount(ImageUtil.getMetricName('Size.MB'),
- toMillions(item.getMetadataItem().size));
+ var metadata = item.getMetadataItem();
+ if (metadata) {
+ ImageUtil.metrics.recordSmallCount(ImageUtil.getMetricName('Size.MB'),
+ toMillions(metadata.size));
+ }
var canvas = this.imageView_.getCanvas();
ImageUtil.metrics.recordSmallCount(ImageUtil.getMetricName('Size.MPix'),
« no previous file with comments | « ui/file_manager/gallery/js/ribbon.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698