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

Side by Side Diff: chrome/browser/resources/file_manager/js/photo/ribbon.js

Issue 12304013: Introduce Image loader extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 5 /**
6 * Scrollable thumbnail ribbon at the bottom of the Gallery in the Slide mode. 6 * Scrollable thumbnail ribbon at the bottom of the Gallery in the Slide mode.
7 * 7 *
8 * @param {Document} document Document. 8 * @param {Document} document Document.
9 * @param {MetadataCache} metadataCache MetadataCache instance. 9 * @param {MetadataCache} metadataCache MetadataCache instance.
10 * @param {cr.ui.ArrayDataModel} dataModel Data model. 10 * @param {cr.ui.ArrayDataModel} dataModel Data model.
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 * 326 *
327 * @param {Element} thumbnail Thumbnail element. 327 * @param {Element} thumbnail Thumbnail element.
328 * @param {string} url Image url. 328 * @param {string} url Image url.
329 * @param {Object} metadata Metadata. 329 * @param {Object} metadata Metadata.
330 * @private 330 * @private
331 */ 331 */
332 Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) { 332 Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) {
333 new ThumbnailLoader(url, ThumbnailLoader.LoaderType.IMAGE, metadata).load( 333 new ThumbnailLoader(url, ThumbnailLoader.LoaderType.IMAGE, metadata).load(
334 thumbnail.querySelector('.image-wrapper'), 334 thumbnail.querySelector('.image-wrapper'),
335 ThumbnailLoader.FillMode.FILL /* fill */, 335 ThumbnailLoader.FillMode.FILL /* fill */,
336 ThumbnailLoader.OptimizationMode.NEVER_DISCARD,
336 null /* success callback */, 337 null /* success callback */,
337 this.onThumbnailError_.bind(null, url)); 338 this.onThumbnailError_.bind(null, url));
338 }; 339 };
339 340
340 /** 341 /**
341 * Content change handler. 342 * Content change handler.
342 * 343 *
343 * @param {Event} event Event. 344 * @param {Event} event Event.
344 * @private 345 * @private
345 */ 346 */
(...skipping 12 matching lines...) Expand all
358 * @param {string} oldUrl Old url. 359 * @param {string} oldUrl Old url.
359 * @param {string} newUrl New url. 360 * @param {string} newUrl New url.
360 * @private 361 * @private
361 */ 362 */
362 Ribbon.prototype.remapCache_ = function(oldUrl, newUrl) { 363 Ribbon.prototype.remapCache_ = function(oldUrl, newUrl) {
363 if (oldUrl != newUrl && (oldUrl in this.renderCache_)) { 364 if (oldUrl != newUrl && (oldUrl in this.renderCache_)) {
364 this.renderCache_[newUrl] = this.renderCache_[oldUrl]; 365 this.renderCache_[newUrl] = this.renderCache_[oldUrl];
365 delete this.renderCache_[oldUrl]; 366 delete this.renderCache_[oldUrl];
366 } 367 }
367 }; 368 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698