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

Issue 1091253008: Fix an issue that external protocol in subframes are not handled on Android (Closed)

Created:
5 years, 8 months ago by qinmin
Modified:
5 years, 6 months ago
CC:
chromium-reviews, davidben+watch_chromium.org, cbentzel+watch_chromium.org, tburkard+watch_chromium.org, tfarina, jam, gavinp+prer_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, android-webview-reviews_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix an issue that external protocol in subframes are not handled on Android On android, an InterceptNavigationResourceThrottle is used to intercept all the UrlRequests. However, this throttle only works if the resource type is main frame. As a result, any external protocols embedded in subframes cannot launch other intents. This change addresses the above issue by: 1. revive the ExternalProtocolHandler code path on android so that subframe requests will be handled. 2. passing transition type to ExternalProtocolHandler so android implementation can decide whether to show intent picker. 3. Adding back ExternalProtocolObserver on android, use the common code path to prevent intent from launching without gesture. BUG=364522 Committed: https://crrev.com/7573e42dc9fcb20f31f980d5f1fa8125719ce0f0 Cr-Commit-Position: refs/heads/master@{#328570}

Patch Set 1 #

Total comments: 1

Patch Set 2 : only handle request from subframes #

Patch Set 3 : bypassing closing tab for subframes #

Patch Set 4 : adding isSubFrame to ExternalNavigationParams #

Total comments: 6

Patch Set 5 : addressing sky's comment #

Patch Set 6 : rebase and fix test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -81 lines) Patch
M android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc View 1 1 chunk +7 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationParams.java View 1 2 3 5 chunks +21 lines, -2 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/external_protocol_dialog.cc View 1 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/external_protocol/external_protocol_handler.h View 1 4 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/external_protocol/external_protocol_handler.cc View 1 2 3 4 6 chunks +31 lines, -16 lines 0 comments Download
M chrome/browser/external_protocol/external_protocol_handler_unittest.cc View 1 2 3 4 5 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc View 1 3 chunks +24 lines, -15 lines 0 comments Download
M chrome/browser/ui/android/external_protocol_dialog_android.cc View 1 2 1 chunk +33 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/external_protocol_dialog.mm View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 4 chunks +2 lines, -2 lines 2 comments Download
M chrome/browser/ui/views/external_protocol_dialog.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M components/navigation_interception/android/java/src/org/chromium/components/navigation_interception/NavigationParams.java View 1 2 1 chunk +6 lines, -3 lines 0 comments Download
M components/navigation_interception/intercept_navigation_resource_throttle.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/navigation_interception/navigation_params.h View 1 2 3 chunks +4 lines, -1 line 0 comments Download
M components/navigation_interception/navigation_params.cc View 1 2 2 chunks +5 lines, -2 lines 0 comments Download
M components/navigation_interception/navigation_params_android.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/public/browser/resource_dispatcher_host_delegate.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M content/public/browser/resource_dispatcher_host_delegate.cc View 1 1 chunk +7 lines, -3 lines 0 comments Download

Messages

Total messages: 49 (15 generated)
qinmin
PTAL
5 years, 8 months ago (2015-04-22 22:41:54 UTC) #2
davidben
Driveby since this happened to catch a file I'm on a watchlist for. Are you ...
5 years, 8 months ago (2015-04-23 00:22:23 UTC) #3
davidben
Oh, I see. You're hooking this into external protocol handlers instead, so that would avoid ...
5 years, 8 months ago (2015-04-23 00:25:13 UTC) #4
Jaekyun Seok (inactive)
not lgtm because I found the following issues after testing this CL. 1. UrlOverridingTest in ...
5 years, 8 months ago (2015-04-23 03:59:41 UTC) #6
Jaekyun Seok (inactive)
One more concern is that we need to support fallback URL navigation even without user ...
5 years, 8 months ago (2015-04-23 04:47:16 UTC) #8
qinmin
For 1, I think the UrlOverridingTest test expectations are wrong. There is no guarantee that ...
5 years, 8 months ago (2015-04-23 23:44:02 UTC) #9
qinmin
PTAL again. I've changed the logic to only handle external protocols in subframes. Test is ...
5 years, 7 months ago (2015-04-29 23:41:12 UTC) #10
Jaekyun Seok (inactive)
On 2015/04/29 23:41:12, qinmin wrote: > PTAL again. > > I've changed the logic to ...
5 years, 7 months ago (2015-04-30 00:03:31 UTC) #11
qinmin
On 2015/04/30 00:03:31, Jaekyun Seok wrote: > On 2015/04/29 23:41:12, qinmin wrote: > > PTAL ...
5 years, 7 months ago (2015-04-30 21:00:58 UTC) #12
Jaekyun Seok (inactive)
On 2015/04/30 21:00:58, qinmin wrote: > On 2015/04/30 00:03:31, Jaekyun Seok wrote: > > On ...
5 years, 7 months ago (2015-04-30 21:31:14 UTC) #13
qinmin
On 2015/04/30 21:31:14, Jaekyun Seok (OOO till 5.5) wrote: > On 2015/04/30 21:00:58, qinmin wrote: ...
5 years, 7 months ago (2015-04-30 22:26:06 UTC) #14
Jaekyun Seok (inactive)
On 2015/04/30 22:26:06, qinmin wrote: > On 2015/04/30 21:31:14, Jaekyun Seok (OOO till 5.5) wrote: ...
5 years, 7 months ago (2015-04-30 22:31:01 UTC) #15
qinmin
On 2015/04/30 22:31:01, Jaekyun Seok (OOO till 5.5) wrote: > On 2015/04/30 22:26:06, qinmin wrote: ...
5 years, 7 months ago (2015-04-30 22:45:35 UTC) #16
qinmin
+mnaganov for OWNER of component/navigation_interception/
5 years, 7 months ago (2015-05-01 21:34:46 UTC) #18
mnaganov (inactive)
android_webview/ and component/navigation_interception/ LGTM
5 years, 7 months ago (2015-05-01 22:00:54 UTC) #19
qinmin
ping sievers@, would you mind take a look at content/ ?
5 years, 7 months ago (2015-05-04 19:07:31 UTC) #20
qinmin
sky@, would you take a look at chrome/browser/? thanks
5 years, 7 months ago (2015-05-04 19:08:38 UTC) #21
sky
https://codereview.chromium.org/1091253008/diff/60001/chrome/browser/external_protocol/external_protocol_handler.cc File chrome/browser/external_protocol/external_protocol_handler.cc (right): https://codereview.chromium.org/1091253008/diff/60001/chrome/browser/external_protocol/external_protocol_handler.cc#newcode154 chrome/browser/external_protocol/external_protocol_handler.cc:154: ui::PageTransition page_transition_; nit: const on all of these. https://codereview.chromium.org/1091253008/diff/60001/chrome/browser/ui/views/external_protocol_dialog.cc ...
5 years, 7 months ago (2015-05-04 19:15:49 UTC) #22
no sievers
Just a few questions: * same question about unused params as sky. Are these going ...
5 years, 7 months ago (2015-05-04 19:27:12 UTC) #23
qinmin
https://codereview.chromium.org/1091253008/diff/60001/chrome/browser/external_protocol/external_protocol_handler.cc File chrome/browser/external_protocol/external_protocol_handler.cc (right): https://codereview.chromium.org/1091253008/diff/60001/chrome/browser/external_protocol/external_protocol_handler.cc#newcode154 chrome/browser/external_protocol/external_protocol_handler.cc:154: ui::PageTransition page_transition_; On 2015/05/04 19:15:49, sky wrote: > nit: ...
5 years, 7 months ago (2015-05-04 19:31:52 UTC) #24
qinmin
On 2015/05/04 19:27:12, sievers wrote: > Just a few questions: > > * same question ...
5 years, 7 months ago (2015-05-04 19:37:43 UTC) #25
qinmin
On 2015/05/04 19:27:12, sievers wrote: > Just a few questions: > > * same question ...
5 years, 7 months ago (2015-05-04 19:37:46 UTC) #26
no sievers
content lgtm
5 years, 7 months ago (2015-05-04 19:47:33 UTC) #27
sky
LGTM
5 years, 7 months ago (2015-05-04 20:46:51 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1091253008/80001
5 years, 7 months ago (2015-05-05 17:50:28 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/68602)
5 years, 7 months ago (2015-05-05 18:12:21 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1091253008/120001
5 years, 7 months ago (2015-05-05 20:44:59 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/19545)
5 years, 7 months ago (2015-05-05 22:42:53 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1091253008/140001
5 years, 7 months ago (2015-05-06 17:17:58 UTC) #43
commit-bot: I haz the power
Committed patchset #6 (id:140001)
5 years, 7 months ago (2015-05-06 18:42:40 UTC) #44
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/7573e42dc9fcb20f31f980d5f1fa8125719ce0f0 Cr-Commit-Position: refs/heads/master@{#328570}
5 years, 7 months ago (2015-05-06 18:43:30 UTC) #45
Avi (use Gerrit)
https://codereview.chromium.org/1091253008/diff/140001/chrome/browser/ui/tab_helpers.cc File chrome/browser/ui/tab_helpers.cc (right): https://codereview.chromium.org/1091253008/diff/140001/chrome/browser/ui/tab_helpers.cc#newcode198 chrome/browser/ui/tab_helpers.cc:198: ExternalProtocolObserver::CreateForWebContents(web_contents); Please move this into the general block! This ...
5 years, 6 months ago (2015-06-03 15:14:10 UTC) #47
Avi (use Gerrit)
5 years, 6 months ago (2015-06-03 15:14:12 UTC) #48
Avi (use Gerrit)
5 years, 6 months ago (2015-06-03 15:19:30 UTC) #49
Message was sent while issue was closed.
https://codereview.chromium.org/1091253008/diff/140001/chrome/browser/ui/tab_...
File chrome/browser/ui/tab_helpers.cc (right):

https://codereview.chromium.org/1091253008/diff/140001/chrome/browser/ui/tab_...
chrome/browser/ui/tab_helpers.cc:198:
ExternalProtocolObserver::CreateForWebContents(web_contents);
On 2015/06/03 15:14:10, Avi wrote:
> Please move this into the general block! This goes on line 150, along with all
> the other tab helpers that apply to all platforms.

Fix is in https://codereview.chromium.org/1157253009/.

Powered by Google App Engine
This is Rietveld 408576698