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

Unified Diff: ui/file_manager/gallery/js/image_editor/image_view.js

Issue 976713004: Add thumbnailMetadataItem to GalleryItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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/image_editor/image_view.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_view.js b/ui/file_manager/gallery/js/image_editor/image_view.js
index 9cd4989831f1b6820110efcefbbe3b3c5f0a90ba..05fa32d6f0975ad9b82a7e0ac5709886972112b9 100644
--- a/ui/file_manager/gallery/js/image_editor/image_view.js
+++ b/ui/file_manager/gallery/js/image_editor/image_view.js
@@ -152,9 +152,10 @@ ImageView.getLoadTarget = function(item, effect) {
return ImageView.LoadTarget.CACHED_THUMBNAIL;
// Only show thumbnails if there is no effect or the effect is Slide.
- var metadata = item.getMetadata();
var thumbnailLoader = new ThumbnailLoader(
- item.getEntry(), ThumbnailLoader.LoaderType.CANVAS, item.getMetadata());
+ item.getEntry(),
+ ThumbnailLoader.LoaderType.CANVAS,
+ item.getThumbnailMetadataItem());
if ((effect instanceof ImageView.Effect.None ||
effect instanceof ImageView.Effect.Slide) &&
thumbnailLoader.getLoadTarget() !==
@@ -350,7 +351,6 @@ ImageView.prototype.cancelLoad = function() {
ImageView.prototype.load =
function(item, effect, displayCallback, loadCallback) {
var entry = item.getEntry();
- var metadata = item.getMetadata() || {};
if (!(effect instanceof ImageView.Effect.None)) {
// Skip effects when reloading repeatedly very quickly.
@@ -389,7 +389,7 @@ ImageView.prototype.load =
var thumbnailLoader = new ThumbnailLoader(
entry,
ThumbnailLoader.LoaderType.CANVAS,
- metadata);
+ item.getThumbnailMetadataItem());
thumbnailLoader.loadDetachedImage(function(success) {
displayThumbnail(
ImageView.LoadType.IMAGE_FILE,
@@ -485,7 +485,7 @@ ImageView.prototype.load =
loadType, Object.keys(ImageView.LoadType).length);
if (loadType === ImageView.LoadType.ERROR &&
- !navigator.onLine && !metadata.external.present) {
+ !navigator.onLine && !item.getMetadataItem().present) {
loadType = ImageView.LoadType.OFFLINE;
}
if (loadCallback) loadCallback(loadType, animationDuration, opt_error);

Powered by Google App Engine
This is Rietveld 408576698