Commit cdf953e6 authored by Satoshi Niwa's avatar Satoshi Niwa Committed by Commit Bot

ARC file picker : Allow the user to select all files when MIME type conversion partially fails

https://screenshot.googleplex.com/Bov9fKoBQ6y.png

BUG=b:133848333
TEST=Open files app with unknown MIME type and check the bottom left dropdown in the file selector

Change-Id: I9c9f40ca623821e95f9e3d50a792413e3220d0d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638205
Commit-Queue: Satoshi Niwa <niwa@chromium.org>
Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665074}
parent a6245bb2
...@@ -143,8 +143,12 @@ void BuildFileTypeInfo(const mojom::SelectFilesRequestPtr& request, ...@@ -143,8 +143,12 @@ void BuildFileTypeInfo(const mojom::SelectFilesRequestPtr& request,
for (const std::string& mime_type : request->mime_types) { for (const std::string& mime_type : request->mime_types) {
std::vector<base::FilePath::StringType> extensions; std::vector<base::FilePath::StringType> extensions;
net::GetExtensionsForMimeType(mime_type, &extensions); net::GetExtensionsForMimeType(mime_type, &extensions);
if (!extensions.empty()) if (extensions.empty()) {
// Allow the user to select all files if MIME type conversion fails.
file_type_info->include_all_files = true;
} else {
file_type_info->extensions.push_back(extensions); file_type_info->extensions.push_back(extensions);
}
} }
} }
......
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