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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/gallery.js
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index cdfd52bd398170b2ffcb5a46ff7d7c87cb6a812b..23c64d6a8dec133d6e88bf29582b79229580b8df 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -860,17 +860,24 @@ Gallery.prototype.updateButtons_ = function() {
}
};
-window.addEventListener('load', function() {
- Promise.all([
- window.backgroundComponentsPromise,
- window.launchData.entriesPromise
- ]).then(function(args) {
- var backgroundComponents = args[0];
- var entries = args[1];
- window.loadTimeData.data = backgroundComponents.stringData;
- var gallery = new Gallery(backgroundComponents.volumeManager);
- gallery.load(entries.allEntries, entries.selectedEntries);
- }).catch(function(error) {
- console.error(error.stack || error);
- });
-});
+/**
+ * Singleton gallery.
+ * @type {Gallery}
+ */
+var gallery = null;
+
+/**
+ * Initialize the window.
+ * @param {Object} backgroundComponents Background components.
+ */
+window.initialize = function(backgroundComponents) {
+ window.loadTimeData.data = backgroundComponents.stringData;
+ gallery = new Gallery(backgroundComponents.volumeManager);
+};
+
+/**
+ * Loads entries.
+ */
+window.loadEntries = function(entries, selectedEntries) {
+ gallery.load(entries, selectedEntries);
+};
« 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