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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 8770028: cros: Defer file selection callback until the window closes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | chrome/browser/ui/views/extensions/extension_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index f9aaffd3bbe18c44db3e4a5d30cccd5e259fe5fc..d260e21710d9fc06df1d01933cadefb9cf652391 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -3703,40 +3703,40 @@ FileManager.prototype = {
};
/**
- * Handle a click of the cancel button. Closes the window. Does not return.
+ * Handle a click of the cancel button. Closes the window.
* TODO(jamescook): Make unload handler work automatically, crbug.com/104811
*
* @param {Event} event The click event.
*/
FileManager.prototype.onCancel_ = function(event) {
- this.onUnload_();
- // Closes the window and does not return.
chrome.fileBrowserPrivate.cancelDialog();
+ this.onUnload_();
+ window.close();
};
/**
- * Selects a file. Closes the window. Does not return.
+ * Selects a file. Closes the window.
* TODO(jamescook): Make unload handler work automatically, crbug.com/104811
*
* @param {string} fileUrl The filename as a URL.
* @param {number} filterIndex The integer file filter index.
*/
FileManager.prototype.selectFile_ = function(fileUrl, filterIndex) {
- this.onUnload_();
- // Closes the window and does not return.
chrome.fileBrowserPrivate.selectFile(fileUrl, filterIndex);
+ this.onUnload_();
+ window.close();
};
/**
- * Selects multiple files. Closes the window. Does not return.
+ * Selects multiple files. Closes the window.
* TODO(jamescook): Make unload handler work automatically, crbug.com/104811
*
* @param {Array.<string>} fileUrls Array of filename URLs.
*/
FileManager.prototype.selectFiles_ = function(fileUrls) {
- this.onUnload_();
- // Closes the window and does not return.
chrome.fileBrowserPrivate.selectFiles(fileUrls);
+ this.onUnload_();
+ window.close();
};
/**
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698