Commit 9eb75108 authored by Alex Lau's avatar Alex Lau Committed by Commit Bot

Only display "Show all Play folders" for My files and subdirectories.

Currently this is shown for all roots.

Bug: 875380
Test: Tested on kevin.
Change-Id: Ied92804c5a3936d458b38e84daf973c5928b3534
Reviewed-on: https://chromium-review.googlesource.com/1186206Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Commit-Queue: Alex Lau <alexlau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585724}
parent 67d49a62
......@@ -831,9 +831,16 @@ CommandHandler.COMMANDS_['toggle-hidden-android-folders'] =
* @param {!CommandHandlerDeps} fileManager CommandHandlerDeps to use.
*/
canExecute: function(event, fileManager) {
event.canExecute =
var hasAndroidFilesVolumeInfo =
!!fileManager.volumeManager.getCurrentProfileVolumeInfo(
VolumeManagerCommon.VolumeType.ANDROID_FILES);
var currentRootType = fileManager.directoryModel.getCurrentRootType();
var isInMyFiles =
currentRootType == VolumeManagerCommon.RootType.MY_FILES ||
currentRootType == VolumeManagerCommon.RootType.DOWNLOADS ||
currentRootType == VolumeManagerCommon.RootType.CROSTINI ||
currentRootType == VolumeManagerCommon.RootType.ANDROID_FILES;
event.canExecute = hasAndroidFilesVolumeInfo && isInMyFiles;
event.command.setHidden(!event.canExecute);
event.command.checked =
fileManager.fileFilter.isAllAndroidFoldersVisible();
......
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