Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Object representing an image item (a photo). | 6 * Object representing an image item (a photo). |
| 7 * | 7 * |
| 8 * @param {!FileEntry} entry Image entry. | 8 * @param {!FileEntry} entry Image entry. |
| 9 * @param {!EntryLocation} locationInfo Entry location information. | 9 * @param {!EntryLocation} locationInfo Entry location information. |
| 10 * @param {MetadataItem} metadataItem | 10 * @param {MetadataItem} metadataItem |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 return Promise.reject(str('GALLERY_FILE_EXISTS')); | 433 return Promise.reject(str('GALLERY_FILE_EXISTS')); |
| 434 }, function() { | 434 }, function() { |
| 435 return new Promise( | 435 return new Promise( |
| 436 this.entry_.moveTo.bind(this.entry_, parentDirectory, newFileName)); | 436 this.entry_.moveTo.bind(this.entry_, parentDirectory, newFileName)); |
| 437 }.bind(this)); | 437 }.bind(this)); |
| 438 }.bind(this)); | 438 }.bind(this)); |
| 439 }.bind(this)).then(function(entry) { | 439 }.bind(this)).then(function(entry) { |
| 440 this.entry_ = entry; | 440 this.entry_ = entry; |
| 441 }.bind(this)); | 441 }.bind(this)); |
| 442 }; | 442 }; |
| 443 | |
| 444 /** | |
| 445 * The threshold size of an image in pixels, which we always use thumbnail | |
| 446 * image for slide-in animation above this. This is a hack to avoid an UI | |
| 447 * unresponsiveness when switching between images. | |
| 448 * | |
| 449 * @type{number} | |
| 450 */ | |
| 451 GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS = 4e3 * 3e3; | |
|
fukino
2017/01/13 02:50:33
nit: prefer 4000 * 3000 for easier read.
yamaguchi
2017/01/13 12:25:39
Done.
| |
| 452 | |
| 453 /** | |
| 454 * Whether the image requires long rendering time. | |
| 455 * | |
| 456 * @return {boolean} | |
| 457 */ | |
| 458 GalleryItem.prototype.requireLongRenderingTime = function() { | |
| 459 var numPixels = this.metadataItem_.imageHeight * | |
|
oka
2017/01/13 04:23:19
I think imageHeight can be undefined. Maybe it's b
yamaguchi
2017/01/13 12:25:39
Done.
| |
| 460 this.metadataItem_.imageWidth; | |
| 461 return numPixels > GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS; | |
| 462 }; | |
| OLD | NEW |