DescriptionAdd support to mime types in Files app UI.
Before, file icons and types were only based on file extensions, without using
mime types.
This CL makes the FileTask.xxx methods use the optionally passed mime type,
which is used with priority. If not available, or not matching, then it
falls back to the file extension based solution.
Since now contentMimeType is requested for all files on the file list, one
change has been made. The call to chrome.fileManagerPrivate.getMimeType has
been removed from FileSystemMetadataProvider, as it's slow (may sniff).
Since now, contentMimeType is only fetched via getEntryProperties() private
API, and it never sniffs. So it's a best effort method.
TEST=1. Opened a video file with no extension from Downloads,
2. Images without extension show a correct icon on Drive (not Downloads).
BUG=446435
Committed: https://crrev.com/1143f7a9f3ada056c5ce7059a553dc6ec18f654f
Cr-Commit-Position: refs/heads/master@{#332792}
Patch Set 1 #Patch Set 2 : Quick fix for the audio player. #
Total comments: 12
Patch Set 3 : Addressed comments + fixed some bugs. #Patch Set 4 : Fixed browser tests. #Patch Set 5 : Fixed js unit tests. #Patch Set 6 : Fixed tests. #Messages
Total messages: 12 (2 generated)
|