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 '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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 Gallery.prototype.updateButtons_ = function() { | 880 Gallery.prototype.updateButtons_ = function() { |
881 if (this.modeButton_) { | 881 if (this.modeButton_) { |
882 var oppositeMode = | 882 var oppositeMode = |
883 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : | 883 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : |
884 this.slideMode_; | 884 this.slideMode_; |
885 this.modeButton_.title = str(oppositeMode.getTitle()); | 885 this.modeButton_.title = str(oppositeMode.getTitle()); |
886 } | 886 } |
887 }; | 887 }; |
888 | 888 |
889 window.addEventListener('load', function() { | 889 window.addEventListener('load', function() { |
890 var entries = window.launchData.items.map( | 890 Promise.all([ |
891 function(item) { return item.entry; }); | 891 window.backgroundComponentsPromise, |
892 window.backgroundComponent. | 892 window.launchData.entriesPromise |
893 then(function(inBackgroundComponent) { | 893 ]).then(function(args) { |
894 window.loadTimeData.data = inBackgroundComponent.stringData; | 894 var backgroundComponents = args[0]; |
895 var gallery = new Gallery(inBackgroundComponent.volumeManager); | 895 var entries = args[1]; |
896 gallery.load(entries, entries); | 896 window.loadTimeData.data = backgroundComponents.stringData; |
897 }). | 897 var gallery = new Gallery(backgroundComponents.volumeManager); |
898 catch(function(error) { | 898 gallery.load(entries.allEntries, entries.selectedEntries); |
899 console.error(error.stack || error); | 899 }).catch(function(error) { |
900 }); | 900 console.error(error.stack || error); |
| 901 }); |
901 }); | 902 }); |
OLD | NEW |