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

Unified Diff: trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js

Issue 151553003: Revert 248153 "[Files.app] Show dot files in the Drive volume." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/chrome/browser/resources/file_manager/foreground/js/directory_contents.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js
===================================================================
--- trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js (revision 248206)
+++ trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js (working copy)
@@ -44,13 +44,6 @@
* @private
*/
this.currentVolumeInfo_ = null;
-
- /**
- * Whether to show dot files in the non-Drive folder. Default: false.
- * @type {boolean}
- * @private
- */
- this.dotFilesHidden_ = false;
}
FileManager.prototype = {
@@ -916,7 +909,9 @@
this.dialogType == DialogType.SELECT_UPLOAD_FOLDER ||
this.dialogType == DialogType.SELECT_SAVEAS_FILE;
- this.fileFilter_ = new FileFilter(this.metadataCache_);
+ this.fileFilter_ = new FileFilter(
+ this.metadataCache_,
+ false /* Don't show dot files by default. */);
this.fileWatcher_ = new FileWatcher(this.metadataCache_);
this.fileWatcher_.addEventListener(
@@ -1320,32 +1315,6 @@
};
/**
- * Filters dot files if the setting is enabled and the current directory is
- * '/Downloads'.
- *
- * @return {boolean} True if the filter is enabled, false otherwise.
- * @private
- */
- FileManager.prototype.updateDotFilesFilter_ = function() {
- var enabled =
- this.dotFilesHidden_ &&
- this.currentVolumeInfo_ &&
- this.currentVolumeInfo_.volumeType !== util.VolumeType.DRIVE;
-
- if (enabled) {
- this.fileFilter_.addFilter(
- 'dot-file-hidden',
- function(entry) {
- return (entry.name.charAt(0) !== '.');
- });
- } else {
- this.fileFilter_.removeFilter('dot-file-hidden');
- }
-
- return enabled;
- };
-
- /**
* Resize details and thumb views to fit the new window size.
* @private
*/
@@ -2349,8 +2318,6 @@
'' /* selectionURL */,
'' /* opt_param */);
- this.updateDotFilesFilter_();
-
if (this.commandHandler)
this.commandHandler.updateAvailability();
@@ -2884,8 +2851,9 @@
switch (util.getKeyModifiers(event) + event.keyCode) {
case 'Ctrl-190': // Ctrl-. => Toggle filter files.
- this.dotFilesHidden_ = !this.dotFilesHidden_;
- this.updateDotFilesFilter_();
+ this.fileFilter_.setFilterHidden(
+ !this.fileFilter_.isFilterHiddenOn());
+ event.preventDefault();
return;
case '27': // Escape => Cancel dialog.
@@ -3352,7 +3320,7 @@
msg = str('ERROR_WHITESPACE_NAME');
} else if (/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(name)) {
msg = str('ERROR_RESERVED_NAME');
- } else if (this.updateDotFilesFilter_() && name[0] == '.') {
+ } else if (this.fileFilter_.isFilterHiddenOn() && name[0] == '.') {
msg = str('ERROR_HIDDEN_NAME');
}
« no previous file with comments | « trunk/src/chrome/browser/resources/file_manager/foreground/js/directory_contents.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698