| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Scrollable thumbnail ribbon at the bottom of the Gallery in the Slide mode. | 8 * Scrollable thumbnail ribbon at the bottom of the Gallery in the Slide mode. |
| 9 * | 9 * |
| 10 * @param {Document} document Document. | 10 * @param {Document} document Document. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 * | 328 * |
| 329 * @param {Element} thumbnail Thumbnail element. | 329 * @param {Element} thumbnail Thumbnail element. |
| 330 * @param {string} url Image url. | 330 * @param {string} url Image url. |
| 331 * @param {Object} metadata Metadata. | 331 * @param {Object} metadata Metadata. |
| 332 * @private | 332 * @private |
| 333 */ | 333 */ |
| 334 Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) { | 334 Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) { |
| 335 new ThumbnailLoader(url, ThumbnailLoader.LoaderType.IMAGE, metadata).load( | 335 new ThumbnailLoader(url, ThumbnailLoader.LoaderType.IMAGE, metadata).load( |
| 336 thumbnail.querySelector('.image-wrapper'), | 336 thumbnail.querySelector('.image-wrapper'), |
| 337 ThumbnailLoader.FillMode.FILL /* fill */, | 337 ThumbnailLoader.FillMode.FILL /* fill */, |
| 338 ThumbnailLoader.OptimizationMode.NEVER_DISCARD, | 338 ThumbnailLoader.OptimizationMode.DISCARD_DETACHED, |
| 339 null /* success callback */, | 339 null /* success callback */, |
| 340 this.onThumbnailError_.bind(null, url)); | 340 this.onThumbnailError_.bind(null, url)); |
| 341 }; | 341 }; |
| 342 | 342 |
| 343 /** | 343 /** |
| 344 * Content change handler. | 344 * Content change handler. |
| 345 * | 345 * |
| 346 * @param {Event} event Event. | 346 * @param {Event} event Event. |
| 347 * @private | 347 * @private |
| 348 */ | 348 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 361 * @param {string} oldUrl Old url. | 361 * @param {string} oldUrl Old url. |
| 362 * @param {string} newUrl New url. | 362 * @param {string} newUrl New url. |
| 363 * @private | 363 * @private |
| 364 */ | 364 */ |
| 365 Ribbon.prototype.remapCache_ = function(oldUrl, newUrl) { | 365 Ribbon.prototype.remapCache_ = function(oldUrl, newUrl) { |
| 366 if (oldUrl != newUrl && (oldUrl in this.renderCache_)) { | 366 if (oldUrl != newUrl && (oldUrl in this.renderCache_)) { |
| 367 this.renderCache_[newUrl] = this.renderCache_[oldUrl]; | 367 this.renderCache_[newUrl] = this.renderCache_[oldUrl]; |
| 368 delete this.renderCache_[oldUrl]; | 368 delete this.renderCache_[oldUrl]; |
| 369 } | 369 } |
| 370 }; | 370 }; |
| OLD | NEW |