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

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: Created 8 years, 6 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 | no next file » | 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 4b66f4c7a9d6ce9948d02e8789d32c29eb1e58ac..a54de57b1bc9b8d90a1bc43dfe82ffd1bdd527d3 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)
dgozman 2012/07/02 12:38:47 Sometimes save-as dialog is called with 'drive/fol
- this.params_.defaultPath = '/' + this.params_.defaultPath;
-
this.listType_ = null;
this.showDelayTimeout_ = null;
@@ -1074,10 +1071,10 @@ FileManager.prototype = {
// Hack goes below, since we don't receive beforepaste event, but receive
// beforecut and beforecopy events.
case 'paste':
- return this.isRenamingInProgress()
- ? this.document_.queryCommandEnabled(commandId)
- : (!!this.fileTransferController_ &&
- this.fileTransferController_.queryPasteCommandEnabled());
+ return this.isRenamingInProgress() ?
+ this.document_.queryCommandEnabled(commandId) :
+ (!!this.fileTransferController_ &&
+ this.fileTransferController_.queryPasteCommandEnabled());
case 'rename':
return (// Initialized to the point where we have a current directory
@@ -1089,11 +1086,11 @@ FileManager.prototype = {
this.selection.totalCount == 1);
case 'delete':
- return (this.isRenamingInProgress()
- ? this.document_.queryCommandEnabled(commandId)
- : !readonly &&
- this.selection &&
- this.selection.totalCount > 0);
+ return (this.isRenamingInProgress() ?
+ this.document_.queryCommandEnabled(commandId) :
+ !readonly &&
+ this.selection &&
+ this.selection.totalCount > 0);
case 'newfolder':
return !readonly &&
@@ -1484,8 +1481,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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698