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

Unified Diff: trunk/src/chrome/browser/resources/file_manager/foreground/js/directory_contents.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 | « no previous file | trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js » ('j') | 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/directory_contents.js
===================================================================
--- trunk/src/chrome/browser/resources/file_manager/foreground/js/directory_contents.js (revision 248206)
+++ trunk/src/chrome/browser/resources/file_manager/foreground/js/directory_contents.js (working copy)
@@ -323,10 +323,11 @@
* When filters are changed, a 'changed' event is fired.
*
* @param {MetadataCache} metadataCache Metadata cache service.
+ * @param {boolean} showHidden If files starting with '.' are shown.
* @constructor
* @extends {cr.EventTarget}
*/
-function FileFilter(metadataCache) {
+function FileFilter(metadataCache, showHidden) {
/**
* @type {MetadataCache}
* @private
@@ -338,6 +339,7 @@
* @private
*/
this.filters_ = {};
+ this.setFilterHidden(!showHidden);
// Do not show entries marked as 'deleted'.
this.addFilter('deleted', function(entry) {
@@ -370,6 +372,27 @@
};
/**
+ * @param {boolean} value If do not show hidden files.
+ */
+FileFilter.prototype.setFilterHidden = function(value) {
+ if (value) {
+ this.addFilter(
+ 'hidden',
+ function(entry) { return entry.name.substr(0, 1) !== '.'; }
+ );
+ } else {
+ this.removeFilter('hidden');
+ }
+};
+
+/**
+ * @return {boolean} If the files with names starting with "." are not shown.
+ */
+FileFilter.prototype.isFilterHiddenOn = function() {
+ return 'hidden' in this.filters_;
+};
+
+/**
* @param {Entry} entry File entry.
* @return {boolean} True if the file should be shown, false otherwise.
*/
« no previous file with comments | « no previous file | trunk/src/chrome/browser/resources/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698