Commit f10ef154 authored by Naoki Fukino's avatar Naoki Fukino Committed by Commit Bot

Files app: Hide Download folder inside Play files.

"Play files/Download" is an alias to Chrome OS's Downloads volume.
It is convenient in Android file picker, but can be confusing in
Chrome OS Files app.
This CL hides the 'Play files/Download" only in Chrome OS Files app.

Bug: 848661
Test: Manually tested on arc-enabled Kevin.

Change-Id: I6c9bed8ff7f72b7c1fe6b2abe1c6194f8eeb3b6d
Reviewed-on: https://chromium-review.googlesource.com/1166922
Commit-Queue: Naoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581834}
parent fdc7de4c
...@@ -429,6 +429,7 @@ function FileFilter(metadataModel) { ...@@ -429,6 +429,7 @@ function FileFilter(metadataModel) {
*/ */
this.lastHostedFilesDisabled_ = null; this.lastHostedFilesDisabled_ = null;
this.hideAndroidDownload();
chrome.fileManagerPrivate.onPreferencesChanged.addListener( chrome.fileManagerPrivate.onPreferencesChanged.addListener(
this.onPreferencesChanged_.bind(this)); this.onPreferencesChanged_.bind(this));
this.onPreferencesChanged_(); this.onPreferencesChanged_();
...@@ -534,6 +535,23 @@ FileFilter.prototype.isAllAndroidFoldersVisible = function() { ...@@ -534,6 +535,23 @@ FileFilter.prototype.isAllAndroidFoldersVisible = function() {
return !('android_hidden' in this.filters_); return !('android_hidden' in this.filters_);
}; };
/**
* Sets up a filter to hide /Download directory in 'Play files' volume.
*
* "Play files/Download" is an alias to Chrome OS's Downloads volume. It is
* convenient in Android file picker, but can be confusing in Chrome OS Files
* app. This function adds a filter to hide the Android's /Download.
*/
FileFilter.prototype.hideAndroidDownload = function() {
this.addFilter('android_download', entry => {
if (entry.filesystem && entry.filesystem.name === 'android_files' &&
entry.fullPath === '/Download') {
return false;
}
return true;
});
};
/** /**
* @param {Entry} entry File entry. * @param {Entry} entry File entry.
* @return {boolean} True if the file should be shown, false otherwise. * @return {boolean} True if the file should be shown, false otherwise.
......
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