[WebLayer] Match CCT's handling of http(s) URLs with external handlers
This CL changes WebLayer's intent launching logic to match that of CCT in the specific case of an http(s) URL with a non-default external handler. In this case CCT overrides ExternalNavigationHandler's default behavior of showing the intent picker to instead keep the navigation in the app. It is desired that WebLayer precisely match CCT here. The implementation is adapted from that in //chrome's CustomTabDelegateFactory. A couple notes: - Unlike //chrome, in //weblayer the check for whether the app has a default handler does not bother to exclude the embedder of WebLayer. The reason is that WebLayer is not embedded in apps that handle incoming intents. - The special-casing of the intent being for the client of CCT at [1] has no analogue in WebLayer (again, because WebLayer is not embedded in apps that handle incoming intents). Thus, there is no such corresponding check in WebLayer. To test: - Install the booking.com app on your device - Search for "hotel booking paris" in Google on WebLayer Shell - Click on the ad for booking.com that should result at the top - Observe that the booking.com app is launched - Via Android Settings, configure the booking.com's handling of support URLs to be "ask every time" - Repeat the above search in WebLayer Shell and observe that the navigation to booking.com stays in WebLayer Shell [1] https://source.chromium.org/chromium/chromium/src/+/master:chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java;l=119?q=CustomTabDelegateFactory&ss=chromium&originalUrl=https:%2F%2Fcs.chromium.org%2F Bug: 1085405 Change-Id: I2bec60967c5c2ef1638a927a33f7e21ba93ae58a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219494 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by:Peter Conn <peconn@chromium.org> Cr-Commit-Position: refs/heads/master@{#773134}
Showing
Please register or sign in to comment