Commit 812e171a authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Add AndroidManifest.xml intent-filters for bundled exchanges file

We are implementing "Navigation to Bundled Exchanges".
Design doc:
https://docs.google.com/document/d/1Bulrd7E1lFZyPfRFIXP3vNMOM9FX-kWJOCxMOeR8pAQ/view#
Demo movie: https://www.youtube.com/watch?v=rs-3R0ji6dA

To open the Bundled Exchanges files on Android from other applications, we need
to add intent-filters in AndroidManifest.xml.

The first intent-filter is for the applications which can't detect the
"application/webbundle" mime type. (eg: Open .wbn file from "Internal Storage"
in Files app.) We use pathPattern to capture the ".wbn" file extension. But due
to the strange behavior of intent filter's pathPattern [1], we need to have
multiple patters to load the .wbn files under folders which name contains ".".
[1] https://stackoverflow.com/questions/51912180/strange-intent-filter-pathpattern-behaviour

The second intent-filter is for the applications which can detect the
"application/webbundle" mime type. (eg: Download the Bundled Exchanges file with
"content-type: application/webbundle" header, and open the file from "Download"
category in Files app.)

We don't have plan to ship this feature in Beta and Stable yet.
So this CL uses "{% if channel in ['dev', 'canary', 'default'] %}" not to change
the AndroidManifest.xml for Beta and Stable.

Bug: 995177
Change-Id: I754ca1c74f5bc56d17462cde9d5bd764671c849b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811405Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701296}
parent 9e8f539c
......@@ -300,6 +300,29 @@ by a child template that "extends" this file.
{{ self.mhtml_view_intent_shared_filter_body() }}
<data android:mimeType="*/*"/>
</intent-filter>
<!-- Bundled HTTP Exchanges (.wbn) support -->
{% if channel in ['dev', 'canary', 'default'] %}
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern="/.*\\.wbn" />
<data android:pathPattern="/.*\\..*\\.wbn" />
<data android:pathPattern="/.*\\..*\\..*\\.wbn" />
<data android:pathPattern="/.*\\..*\\..*\\..*\\.wbn" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="application/webbundle" />
</intent-filter>
{% endif %}
<intent-filter>
<action android:name="android.intent.action.MEDIA_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
......
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