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

Side by Side Diff: ui/file_manager/gallery/js/image_editor/image_view.js

Issue 831833004: Files.app: Stop to use drive thumbnail for cached files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * The overlay displaying the image. 6 * The overlay displaying the image.
7 * 7 *
8 * @param {!HTMLElement} container The container element. 8 * @param {!HTMLElement} container The container element.
9 * @param {!Viewport} viewport The viewport. 9 * @param {!Viewport} viewport The viewport.
10 * @constructor 10 * @constructor
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 * @return {ImageView.LoadTarget} Load target. 143 * @return {ImageView.LoadTarget} Load target.
144 */ 144 */
145 ImageView.getLoadTarget = function(item, effect) { 145 ImageView.getLoadTarget = function(item, effect) {
146 if (item.contentImage) 146 if (item.contentImage)
147 return ImageView.LoadTarget.CACHED_MAIN_IMAGE; 147 return ImageView.LoadTarget.CACHED_MAIN_IMAGE;
148 if (item.screenImage) 148 if (item.screenImage)
149 return ImageView.LoadTarget.CACHED_THUMBNAIL; 149 return ImageView.LoadTarget.CACHED_THUMBNAIL;
150 150
151 // Only show thumbnails if there is no effect or the effect is Slide. 151 // Only show thumbnails if there is no effect or the effect is Slide.
152 var metadata = item.getMetadata(); 152 var metadata = item.getMetadata();
153 var thumbnailLoader = new ThumbnailLoader(
154 item.getEntry(), ThumbnailLoader.LoaderType.CANVAS, item.getMetadata());
153 if ((effect instanceof ImageView.Effect.None || 155 if ((effect instanceof ImageView.Effect.None ||
154 effect instanceof ImageView.Effect.Slide) && 156 effect instanceof ImageView.Effect.Slide) &&
155 ThumbnailLoader.hasThumbnailInMetadata(metadata)) { 157 thumbnailLoader.getLoadTarget() !==
158 ThumbnailLoader.LoadTarget.FILE_ENTRY) {
156 return ImageView.LoadTarget.THUMBNAIL; 159 return ImageView.LoadTarget.THUMBNAIL;
157 } 160 }
158 161
159 return ImageView.LoadTarget.MAIN_IMAGE; 162 return ImageView.LoadTarget.MAIN_IMAGE;
160 }; 163 };
161 164
162 ImageView.prototype = {__proto__: ImageBuffer.Overlay.prototype}; 165 ImageView.prototype = {__proto__: ImageBuffer.Overlay.prototype};
163 166
164 /** 167 /**
165 * @override 168 * @override
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 }; 974 };
972 975
973 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; 976 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype };
974 977
975 /** 978 /**
976 * @override 979 * @override
977 */ 980 */
978 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { 981 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) {
979 return viewport.getInverseTransformForRotatedImage(this.orientation_); 982 return viewport.getInverseTransformForRotatedImage(this.orientation_);
980 }; 983 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698