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

Side by Side Diff: ui/file_manager/gallery/js/gallery.js

Issue 294593003: Gallery.app: Re-open Gallery.app when the new entries are opened. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « ui/file_manager/gallery/js/background.js ('k') | ui/file_manager/gallery/manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * Called from the main frame when unloading. 8 * Called from the main frame when unloading.
9 * @param {boolean=} opt_exiting True if the app is exiting. 9 * @param {boolean=} opt_exiting True if the app is exiting.
10 */ 10 */
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 */ 853 */
854 Gallery.prototype.updateButtons_ = function() { 854 Gallery.prototype.updateButtons_ = function() {
855 if (this.modeButton_) { 855 if (this.modeButton_) {
856 var oppositeMode = 856 var oppositeMode =
857 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : 857 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ :
858 this.slideMode_; 858 this.slideMode_;
859 this.modeButton_.title = str(oppositeMode.getTitle()); 859 this.modeButton_.title = str(oppositeMode.getTitle());
860 } 860 }
861 }; 861 };
862 862
863 window.addEventListener('load', function() { 863 /**
864 Promise.all([ 864 * Singleton gallery.
865 window.backgroundComponentsPromise, 865 * @type {Gallery}
866 window.launchData.entriesPromise 866 */
867 ]).then(function(args) { 867 var gallery = null;
868 var backgroundComponents = args[0]; 868
869 var entries = args[1]; 869 /**
870 window.loadTimeData.data = backgroundComponents.stringData; 870 * Initialize the window.
871 var gallery = new Gallery(backgroundComponents.volumeManager); 871 * @param {Object} backgroundComponents Background components.
872 gallery.load(entries.allEntries, entries.selectedEntries); 872 */
873 }).catch(function(error) { 873 window.initialize = function(backgroundComponents) {
874 console.error(error.stack || error); 874 window.loadTimeData.data = backgroundComponents.stringData;
875 }); 875 gallery = new Gallery(backgroundComponents.volumeManager);
876 }); 876 };
877
878 /**
879 * Loads entries.
880 */
881 window.loadEntries = function(entries, selectedEntries) {
882 gallery.load(entries, selectedEntries);
883 };
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/js/background.js ('k') | ui/file_manager/gallery/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698