Chromium Code Reviews| 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 |