Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Issue 1158923004: Add support to mime types in Files app UI. (Closed)

Created:
5 years, 6 months ago by mtomasz
Modified:
5 years, 6 months ago
Reviewers:
yawano
CC:
chromium-reviews, tfarina, rginda+watch_chromium.org, mtomasz+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -141 lines) Patch
M ui/file_manager/audio_player/manifest.json View 1 1 chunk +0 lines, -3 lines 0 comments Download
M ui/file_manager/file_manager/common/js/file_type.js View 1 2 5 chunks +108 lines, -55 lines 0 comments Download
M ui/file_manager/file_manager/common/js/importer_common.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/file_manager/file_manager/foreground/js/directory_contents.js View 3 chunks +11 lines, -4 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/list_thumbnail_loader_unittest.js View 1 2 3 4 5 1 chunk +8 lines, -1 line 0 comments Download
M ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata_provider.js View 2 chunks +6 lines, -18 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata_provider_unittest.js View 1 2 3 4 3 chunks +0 lines, -26 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/metadata/thumbnail_model.js View 2 chunks +3 lines, -1 line 0 comments Download
M ui/file_manager/file_manager/foreground/js/thumbnail_loader.js View 2 chunks +5 lines, -2 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/ui/file_grid.js View 1 2 5 chunks +19 lines, -6 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/ui/file_table.js View 1 2 3 chunks +13 lines, -6 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/ui/list_container.js View 1 chunk +1 line, -0 lines 0 comments Download
M ui/file_manager/gallery/js/gallery_util.js View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/file_manager/integration_tests/file_manager/open_image_files.js View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M ui/file_manager/integration_tests/gallery/open_image_files.js View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M ui/file_manager/integration_tests/gallery/slide_mode.js View 1 2 3 4 5 2 chunks +1 line, -5 lines 0 comments Download
M ui/file_manager/integration_tests/test_util.js View 1 2 3 4 5 2 chunks +10 lines, -6 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
mtomasz
This basically works, but audio player and video player have to be fixed.
5 years, 6 months ago (2015-06-03 10:45:43 UTC) #1
mtomasz
@yawano: PTAL. Thanks!
5 years, 6 months ago (2015-06-03 10:57:46 UTC) #3
yawano
https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js File ui/file_manager/file_manager/common/js/file_type.js (right): https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js#newcode90 ui/file_manager/file_manager/common/js/file_type.js:90: mimePattern: /video\/3gpp/i nit: 3gpp -> 3gp. https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js#newcode245 ui/file_manager/file_manager/common/js/file_type.js:245: mimePattern: ...
5 years, 6 months ago (2015-06-03 11:59:09 UTC) #4
mtomasz
https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js File ui/file_manager/file_manager/common/js/file_type.js (right): https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js#newcode90 ui/file_manager/file_manager/common/js/file_type.js:90: mimePattern: /video\/3gpp/i On 2015/06/03 11:59:09, yawano wrote: > nit: ...
5 years, 6 months ago (2015-06-04 02:52:27 UTC) #5
yawano
lgtm! https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js File ui/file_manager/file_manager/common/js/file_type.js (right): https://codereview.chromium.org/1158923004/diff/20001/ui/file_manager/file_manager/common/js/file_type.js#newcode90 ui/file_manager/file_manager/common/js/file_type.js:90: mimePattern: /video\/3gpp/i On 2015/06/04 02:52:27, mtomasz wrote: > ...
5 years, 6 months ago (2015-06-04 03:29:41 UTC) #6
mtomasz
@yawano: I made some more fixes to tests. PTAL. Thanks.
5 years, 6 months ago (2015-06-04 04:39:18 UTC) #7
yawano
On 2015/06/04 04:39:18, mtomasz wrote: > @yawano: I made some more fixes to tests. PTAL. ...
5 years, 6 months ago (2015-06-04 04:47:47 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1158923004/100001
5 years, 6 months ago (2015-06-04 06:42:58 UTC) #10
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 6 months ago (2015-06-04 06:46:54 UTC) #11
commit-bot: I haz the power
5 years, 6 months ago (2015-06-04 06:47:47 UTC) #12
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/1143f7a9f3ada056c5ce7059a553dc6ec18f654f
Cr-Commit-Position: refs/heads/master@{#332792}

Powered by Google App Engine
This is Rietveld 408576698