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

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

Issue 7069029: file manager: disable "Save" and "New Folder" buttons in the media/ directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 58f073b438f73afce8ad6d815d8c15475e59ac37..6ef815f5fd120962ab75a4708b45a064efa43f3e 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -1486,7 +1486,13 @@ FileManager.prototype = {
if (this.selection.leadEntry && this.selection.leadEntry.isFile)
this.filenameInput_.value = this.selection.leadEntry.name;
- selectable = !!this.filenameInput_.value;
+ 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;
+ }
} else if (this.dialogType_ == FileManager.DialogType.FULL_PAGE) {
// No "select" buttons on the full page UI.
selectable = true;
@@ -1532,8 +1538,10 @@ FileManager.prototype = {
location.href);
}
- // New folder should never be enabled in the root directory.
- this.newFolderButton_.disabled = this.currentDirEntry_.fullPath == '/';
+ // New folder should never be enabled in the root or media/ directories.
+ this.newFolderButton_.disabled =
+ (this.currentDirEntry_.fullPath == '/' ||
+ this.currentDirEntry_.fullPath == MEDIA_DIRECTORY);
this.document_.title = this.currentDirEntry_.fullPath;
this.rescanDirectory_();
« 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