Commit 1e2f3e41 authored by dgozman@chromium.org's avatar dgozman@chromium.org

[filebrowser] In Gallery, do not allow file names starting with dot.

BUG=chromium-os:23777
TEST=See bug.
Review URL: https://chromiumcodereview.appspot.com/9328041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120774 0039d316-1c4b-4281-b951-d872f2087c98
parent dab93a15
......@@ -1573,6 +1573,9 @@ bool FileDialogStringsFunction::RunImpl() {
SET_STRING(IDS_FILE_BROWSER, GALLERY_UNDO);
SET_STRING(IDS_FILE_BROWSER, GALLERY_REDO);
SET_STRING(IDS_FILE_BROWSER, GALLERY_FILE_EXISTS);
// Reusing the string, but with alias starting with GALLERY.
dict->SetString("GALLERY_FILE_HIDDEN_NAME",
l10n_util::GetStringUTF16(IDS_FILE_BROWSER_ERROR_HIDDEN_NAME));
SET_STRING(IDS_FILE_BROWSER, CONFIRM_OVERWRITE_FILE);
SET_STRING(IDS_FILE_BROWSER, FILE_ALREADY_EXISTS);
......
......@@ -336,6 +336,10 @@ Gallery.prototype.onFilenameEditKeydown_ = function() {
break;
case 13: // Enter
if (this.filenameEdit_.value && this.filenameEdit_.value[0] == '.') {
this.editor_.getPrompt().show('file_hidden_name', 5000);
break;
}
if (this.filenameEdit_.value) {
this.renameItem_(this.ribbon_.getSelectedItem(),
this.filenameEdit_.value);
......
......@@ -257,6 +257,8 @@ chrome.fileBrowserPrivate = {
GALLERY_UNDO: 'Undo',
GALLERY_REDO: 'Redo',
GALLERY_FILE_EXISTS: 'File already exists',
GALLERY_FILE_HIDDEN_NAME: 'Names starting with dot are reserved ' +
'for the system. Please choose another name.',
CONFIRM_OVERWRITE_FILE: 'A file named "$1" already exists. Do you want to replace it?',
FILE_ALREADY_EXISTS: 'The file named "$1" already exists. Please choose a different name.',
......
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