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

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

Issue 10700058: Open/save dialog assumes the defaultPath parameter without '/' as a default file name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 years, 5 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 | chrome/browser/ui/views/select_file_dialog_extension.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 28749bc92f0daf6d1ed212ee2eb7be1aa701620d..fa4c18bb69fa4ef684dbd15ab16fef027dd379c0 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -19,9 +19,6 @@ function FileManager(dialogDom) {
this.params_ = location.search ?
JSON.parse(decodeURIComponent(location.search.substr(1))) :
{};
- if (this.params_.defaultPath && this.params_.defaultPath.indexOf('/') != 0)
- this.params_.defaultPath = '/' + this.params_.defaultPath;
-
this.listType_ = null;
this.showDelayTimeout_ = null;
@@ -1507,8 +1504,10 @@ FileManager.prototype = {
return;
if (!path) {
- this.directoryModel_.setupDefaultPath();
- return;
+ path = this.directoryModel_.getDefaultDirectory();
+ } else if (path.indexOf('/') == -1) {
+ // Path is a file name.
+ path = this.directoryModel_.getDefaultDirectory() + '/' + path;
}
// In the FULL_PAGE mode if the hash path points to a file we might have
« no previous file with comments | « no previous file | chrome/browser/ui/views/select_file_dialog_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698