OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * The overlay displaying the image. | 8 * The overlay displaying the image. |
9 * | 9 * |
10 * @param {HTMLElement} container The container element. | 10 * @param {HTMLElement} container The container element. |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 374 } |
375 | 375 |
376 if (loadType !== ImageView.LOAD_TYPE_ERROR && | 376 if (loadType !== ImageView.LOAD_TYPE_ERROR && |
377 loadType !== ImageView.LOAD_TYPE_CACHED_SCREEN) { | 377 loadType !== ImageView.LOAD_TYPE_CACHED_SCREEN) { |
378 ImageUtil.metrics.recordInterval(ImageUtil.getMetricName('DisplayTime')); | 378 ImageUtil.metrics.recordInterval(ImageUtil.getMetricName('DisplayTime')); |
379 } | 379 } |
380 ImageUtil.metrics.recordEnum(ImageUtil.getMetricName('LoadMode'), | 380 ImageUtil.metrics.recordEnum(ImageUtil.getMetricName('LoadMode'), |
381 loadType, ImageView.LOAD_TYPE_TOTAL); | 381 loadType, ImageView.LOAD_TYPE_TOTAL); |
382 | 382 |
383 if (loadType === ImageView.LOAD_TYPE_ERROR && | 383 if (loadType === ImageView.LOAD_TYPE_ERROR && |
384 !navigator.onLine && metadata.streaming) { | 384 !navigator.onLine && !metadata.drive.present) { |
385 // |streaming| is set only when the file is not locally cached. | |
386 loadType = ImageView.LOAD_TYPE_OFFLINE; | 385 loadType = ImageView.LOAD_TYPE_OFFLINE; |
387 } | 386 } |
388 if (loadCallback) loadCallback(loadType, animationDuration, opt_error); | 387 if (loadCallback) loadCallback(loadType, animationDuration, opt_error); |
389 } | 388 } |
390 }; | 389 }; |
391 | 390 |
392 /** | 391 /** |
393 * Prefetches an image. | 392 * Prefetches an image. |
394 * @param {Gallery.Item} item The image item. | 393 * @param {Gallery.Item} item The image item. |
395 * @param {number} delay Image load delay in ms. | 394 * @param {number} delay Image load delay in ms. |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 }; | 832 }; |
834 | 833 |
835 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; | 834 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; |
836 | 835 |
837 /** | 836 /** |
838 * @override | 837 * @override |
839 */ | 838 */ |
840 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { | 839 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { |
841 return viewport.getInverseTransformForRotatedImage(this.orientation_); | 840 return viewport.getInverseTransformForRotatedImage(this.orientation_); |
842 }; | 841 }; |
OLD | NEW |