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

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

Issue 959643003: [Gallery] Add reload feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 | « no previous file | ui/file_manager/gallery/js/gallery.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/background.js
diff --git a/ui/file_manager/gallery/js/background.js b/ui/file_manager/gallery/js/background.js
index 3203297ae8a5917bd77862261a45fca541d6b2ba..5644ec9a209b939f57479393ced4b9bd3d0b8a3b 100644
--- a/ui/file_manager/gallery/js/background.js
+++ b/ui/file_manager/gallery/js/background.js
@@ -23,6 +23,13 @@ var windowCreateOptions = {
var background = new BackgroundBase();
+/**
+ * Wrapper of gallery window.
+ * @type {SingletonAppWindowWrapper}
+ */
+var gallery = new SingletonAppWindowWrapper('gallery.html',
+ windowCreateOptions);
+
// Initializes the strings. This needs for the volume manager.
var loadTimeDataPromise = new Promise(function(fulfill, reject) {
chrome.fileManagerPrivate.getStrings(function(stringData) {
@@ -76,17 +83,6 @@ function onLaunched(launchData) {
}
/**
- * Returns a function to generate an ID for window.
- * @type {function():string} Function which returns an unique id.
- */
-var generateWindowId = (function() {
- var seq = 0;
- return function() {
- return 'GALLERY_' + seq++;
- };
-})();
-
-/**
* Opens gallery window.
* @param {!Array.<string>} urls List of URL to show.
* @param {boolean} reopen True if reopen, false otherwise.
@@ -101,14 +97,8 @@ function openGalleryWindow(urls, reopen) {
if (urls.length === 0)
return Promise.reject('No file to open.');
- var windowId = generateWindowId();
-
// Opens a window.
return new Promise(function(fulfill, reject) {
- var gallery = new AppWindowWrapper('gallery.html',
- windowId,
- windowCreateOptions);
-
gallery.launch(
{urls: urls},
reopen,
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/gallery.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698