Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/photo/gallery.js |
| diff --git a/chrome/browser/resources/file_manager/js/photo/gallery.js b/chrome/browser/resources/file_manager/js/photo/gallery.js |
| index a27e5d43dd666f86443d3fb49485c3b7407e0edb..ae5ed4c6c3c5cdbaac2e9be032897c84230bf921 100644 |
| --- a/chrome/browser/resources/file_manager/js/photo/gallery.js |
| +++ b/chrome/browser/resources/file_manager/js/photo/gallery.js |
| @@ -137,7 +137,6 @@ Gallery.openStandalone = function(path, pageState, opt_callback) { |
| metadataCache: MetadataCache.createFull(), |
| pageState: pageState, |
| onClose: onClose, |
| - allowMosaic: true, /* For debugging purposes */ |
| displayStringFunction: strf |
| }; |
| Gallery.open(context, urls, selectedUrls); |
| @@ -159,6 +158,13 @@ Gallery.FADE_TIMEOUT = 3000; |
| Gallery.FIRST_FADE_TIMEOUT = 1000; |
| /** |
| + * Time until mosaic is initialized in the background. Used to make gallery |
| + * in the slide mode load faster. In miiliseconds. |
| + * @type {number}. |
|
yoshiki
2013/02/26 08:50:27
@const
mtomasz
2013/02/27 00:55:31
Done.
|
| + */ |
| +Gallery.MOSAIC_BACKGROUND_INIT_DELAY = 1000; |
| + |
| +/** |
| * Types of metadata Gallery uses (to query the metadata cache). |
| */ |
| Gallery.METADATA_TYPE = 'thumbnail|filesystem|media|streaming'; |
| @@ -259,15 +265,13 @@ Gallery.prototype.initDom_ = function() { |
| var onThumbnailError = this.context_.onThumbnailError || function() {}; |
| - if (this.context_.allowMosaic) { |
| - this.modeButton_ = util.createChild(this.toolbar_, 'button mode', 'button'); |
| - this.modeButton_.addEventListener('click', |
| - this.toggleMode_.bind(this, null)); |
| + this.modeButton_ = util.createChild(this.toolbar_, 'button mode', 'button'); |
| + this.modeButton_.addEventListener('click', |
| + this.toggleMode_.bind(this, null)); |
| - this.mosaicMode_ = new MosaicMode(content, |
| - this.dataModel_, this.selectionModel_, this.metadataCache_, |
| - this.toggleMode_.bind(this, null), onThumbnailError); |
| - } |
| + this.mosaicMode_ = new MosaicMode(content, |
| + this.dataModel_, this.selectionModel_, this.metadataCache_, |
| + this.toggleMode_.bind(this, null), onThumbnailError); |
| this.slideMode_ = new SlideMode(this.container_, content, |
| this.toolbar_, this.prompt_, |
| @@ -363,7 +367,8 @@ Gallery.prototype.load = function(urls, selectedUrls) { |
| } else { |
| this.setCurrentMode_(this.slideMode_); |
| var maybeLoadMosaic = function() { |
| - if (mosaic) mosaic.init(); |
| + if (mosaic) |
| + mosaic.init(); |
| cr.dispatchSimpleEvent(this, 'loaded'); |
| }.bind(this); |
| /* TODO: consider nice blow-up animation for the first image */ |