Commit 88818bd7 authored by rginda@chromium.org's avatar rginda@chromium.org

file manager: disable "Save" and "New Folder" buttons in the media/ directory

BUG=chromium-os:15464
TEST=manual testing in chromeos-chrome on linux

Review URL: http://codereview.chromium.org/7069029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86748 0039d316-1c4b-4281-b951-d872f2087c98
parent c0797f01
...@@ -1486,7 +1486,13 @@ FileManager.prototype = { ...@@ -1486,7 +1486,13 @@ FileManager.prototype = {
if (this.selection.leadEntry && this.selection.leadEntry.isFile) if (this.selection.leadEntry && this.selection.leadEntry.isFile)
this.filenameInput_.value = this.selection.leadEntry.name; this.filenameInput_.value = this.selection.leadEntry.name;
if (this.currentDirEntry_.fullPath == '/' ||
this.currentDirEntry_.fullPath == MEDIA_DIRECTORY) {
// Nothing can be saved in to the root or media/ directories.
selectable = false;
} else {
selectable = !!this.filenameInput_.value; selectable = !!this.filenameInput_.value;
}
} else if (this.dialogType_ == FileManager.DialogType.FULL_PAGE) { } else if (this.dialogType_ == FileManager.DialogType.FULL_PAGE) {
// No "select" buttons on the full page UI. // No "select" buttons on the full page UI.
selectable = true; selectable = true;
...@@ -1532,8 +1538,10 @@ FileManager.prototype = { ...@@ -1532,8 +1538,10 @@ FileManager.prototype = {
location.href); location.href);
} }
// New folder should never be enabled in the root directory. // New folder should never be enabled in the root or media/ directories.
this.newFolderButton_.disabled = this.currentDirEntry_.fullPath == '/'; this.newFolderButton_.disabled =
(this.currentDirEntry_.fullPath == '/' ||
this.currentDirEntry_.fullPath == MEDIA_DIRECTORY);
this.document_.title = this.currentDirEntry_.fullPath; this.document_.title = this.currentDirEntry_.fullPath;
this.rescanDirectory_(); this.rescanDirectory_();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment