Commit 5d4b4102 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[directorytree] Use FSP and DOCUMENT_PROVIDERS generic icons if needed

The iconSet property of most volume types is empty, but we expect that
third party volumes (ANDROID_FILES, DOCUMENT_PROVIDERS and File System
Providers) should provide icons in their respective iconSets.

CL:2032469 added a shouldProvideIcons() helper to volume manager so we
can detect these volumes. ANDROID_FILES is done (CL:1945958) and noted
File System Providers and DOCUMENT_PROVIDERS were still todo.

In this change, use the shouldProvideIcons() helper to detect the File
System Providers and DOCUMENT_PROVIDERS that provide no icons, and use
a generic icon for these volumes instead.

files-ng only: this to avoid drawing a dull gray box for these volumes
in files-ng if they provide no icons.

Bug: 992819
Change-Id: Ia2b4c6caf70d3b8250acc8d9706f476a486199ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089178Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747474}
parent 4435387c
...@@ -1178,6 +1178,10 @@ class VolumeItem extends DirectoryItem { ...@@ -1178,6 +1178,10 @@ class VolumeItem extends DirectoryItem {
util.iconSetToCSSBackgroundImageValue(volumeInfo.iconSet); util.iconSetToCSSBackgroundImageValue(volumeInfo.iconSet);
if (backgroundImage !== 'none') { if (backgroundImage !== 'none') {
icon.setAttribute('style', 'background-image: ' + backgroundImage); icon.setAttribute('style', 'background-image: ' + backgroundImage);
} else if (directorytree.FILES_NG_ENABLED) {
if (VolumeManagerCommon.shouldProvideIcons(volumeInfo.volumeType)) {
icon.setAttribute('use-generic-provided-icon', '');
}
} }
icon.setAttribute('volume-type-icon', volumeInfo.volumeType); icon.setAttribute('volume-type-icon', volumeInfo.volumeType);
......
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