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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_tree.js

Issue 410843002: Files.app: Hide fake entries for the save dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 | ui/file_manager/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: ui/file_manager/file_manager/foreground/js/directory_tree.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_tree.js b/ui/file_manager/file_manager/foreground/js/directory_tree.js
index f6ed3edb9a9714e819bea87c385613e3bdf5c444..a689242c98aaaacd383259dea833949c7849feb5 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_tree.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_tree.js
@@ -412,12 +412,13 @@ function DirectoryTree() {}
* @param {DirectoryModel} directoryModel Current DirectoryModel.
* @param {VolumeManagerWrapper} volumeManager VolumeManager of the system.
* @param {MetadataCache} metadataCache Shared MetadataCache instance.
+ * @param {boolean} fakeEntriesVisible True if it should show the fakeEntries.
*/
DirectoryTree.decorate = function(
- el, directoryModel, volumeManager, metadataCache) {
+ el, directoryModel, volumeManager, metadataCache, fakeEntriesVisible) {
el.__proto__ = DirectoryTree.prototype;
(/** @type {DirectoryTree} */ el).decorate(
- directoryModel, volumeManager, metadataCache);
+ directoryModel, volumeManager, metadataCache, fakeEntriesVisible);
};
DirectoryTree.prototype = {
@@ -494,9 +495,10 @@ DirectoryTree.prototype.searchAndSelectByEntry = function(entry) {
* @param {DirectoryModel} directoryModel Current DirectoryModel.
* @param {VolumeManagerWrapper} volumeManager VolumeManager of the system.
* @param {MetadataCache} metadataCache Shared MetadataCache instance.
+ * @param {boolean} fakeEntriesVisible True if it should show the fakeEntries.
*/
DirectoryTree.prototype.decorate = function(
- directoryModel, volumeManager, metadataCache) {
+ directoryModel, volumeManager, metadataCache, fakeEntriesVisible) {
cr.ui.Tree.prototype.decorate.call(this);
this.sequence_ = 0;
@@ -526,6 +528,13 @@ DirectoryTree.prototype.decorate = function(
this.scrollBar_ = MainPanelScrollBar();
this.scrollBar_.initialize(this.parentNode, this);
+
+ /**
+ * Flag to show fake entries in the tree.
+ * @type {boolean}
+ * @private
+ */
+ this.fakeEntriesVisible_ = fakeEntriesVisible;
};
/**
@@ -573,8 +582,10 @@ DirectoryTree.prototype.updateSubDirectories = function(
};
// Add fakes (if any).
- for (var key in this.currentVolumeInfo_.fakeEntries) {
- this.entries_.push(this.currentVolumeInfo_.fakeEntries[key]);
+ if (this.fakeEntriesVisible_) {
+ for (var key in this.currentVolumeInfo_.fakeEntries) {
+ this.entries_.push(this.currentVolumeInfo_.fakeEntries[key]);
+ }
}
// If the display root is not available yet, then redraw anyway with what
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698