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

Unified Diff: ui/file_manager/gallery/js/gallery.js

Issue 282523002: Use resolveIsolatedEntries in the separated new Gallery.app. (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
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 6024be7109f0cab28d1e899891be87afaf1ed230..536422716acb88a0cb57eaff83b6c82617d247a8 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -887,15 +887,16 @@ Gallery.prototype.updateButtons_ = function() {
};
window.addEventListener('load', function() {
- var entries = window.launchData.items.map(
- function(item) { return item.entry; });
- window.backgroundComponent.
- then(function(inBackgroundComponent) {
- window.loadTimeData.data = inBackgroundComponent.stringData;
- var gallery = new Gallery(inBackgroundComponent.volumeManager);
- gallery.load(entries, entries);
- }).
- catch(function(error) {
- console.error(error.stack || error);
- });
+ Promise.all([
+ window.backgroundComponentPromise,
+ window.launchData.entriesPromise
+ ]).then(function(args) {
+ var backgroundComponent = args[0];
mtomasz 2014/05/16 03:29:21 nit: backgroundComponents?
hirono 2014/05/16 04:12:48 Done.
+ var entries = args[1];
+ window.loadTimeData.data = backgroundComponent.stringData;
+ var gallery = new Gallery(backgroundComponent.volumeManager);
+ gallery.load(entries.allEntries, entries.selectedEntries);
+ }).catch(function(error) {
+ console.error(error.stack || error);
+ });
});

Powered by Google App Engine
This is Rietveld 408576698