diff options
author | qinmin <qinmin@chromium.org> | 2015-05-06 11:42:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-06 18:43:01 +0000 |
commit | 7573e42dc9fcb20f31f980d5f1fa8125719ce0f0 (patch) | |
tree | 84703b6a8cd72a0bc89baa9b5daa13d86dd81a45 /content | |
parent | 2dafb810f36484b7b816a198ab9f6ad23fceb9dc (diff) | |
download | chromium_src-7573e42dc9fcb20f31f980d5f1fa8125719ce0f0.zip chromium_src-7573e42dc9fcb20f31f980d5f1fa8125719ce0f0.tar.gz chromium_src-7573e42dc9fcb20f31f980d5f1fa8125719ce0f0.tar.bz2 |
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
Review URL: https://codereview.chromium.org/1091253008
Cr-Commit-Position: refs/heads/master@{#328570}
Diffstat (limited to 'content')
4 files changed, 17 insertions, 6 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 68f2811..3d7565a 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -793,7 +793,8 @@ bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader, return false; return delegate_->HandleExternalProtocol( - url, info->GetChildID(), info->GetRouteID()); + url, info->GetChildID(), info->GetRouteID(), info->IsMainFrame(), + info->GetPageTransition(), info->HasUserGesture()); } void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 0923657..65c4971 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1783,8 +1783,10 @@ InputEventAckState RenderWidgetHostImpl::FilterInputEvent( if (!process_->HasConnection()) return INPUT_EVENT_ACK_STATE_UNKNOWN; - if (event.type == WebInputEvent::MouseDown) + if (event.type == WebInputEvent::MouseDown || + event.type == WebInputEvent::GestureTapDown) { OnUserGesture(); + } return view_ ? view_->FilterInputEvent(event) : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; diff --git a/content/public/browser/resource_dispatcher_host_delegate.cc b/content/public/browser/resource_dispatcher_host_delegate.cc index b1b6960..c67ab55 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.cc +++ b/content/public/browser/resource_dispatcher_host_delegate.cc @@ -42,9 +42,13 @@ ResourceDispatcherHostLoginDelegate* return nullptr; } -bool ResourceDispatcherHostDelegate::HandleExternalProtocol(const GURL& url, - int child_id, - int route_id) { +bool ResourceDispatcherHostDelegate::HandleExternalProtocol( + const GURL& url, + int child_id, + int route_id, + bool is_main_frame, + ui::PageTransition page_transition, + bool has_user_gesture) { return true; } diff --git a/content/public/browser/resource_dispatcher_host_delegate.h b/content/public/browser/resource_dispatcher_host_delegate.h index 7942df5..9a08117 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.h +++ b/content/public/browser/resource_dispatcher_host_delegate.h @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" #include "content/public/common/resource_type.h" +#include "ui/base/page_transition_types.h" class GURL; template <class T> class ScopedVector; @@ -74,7 +75,10 @@ class CONTENT_EXPORT ResourceDispatcherHostDelegate { // guarantee that the app successfully handled it. virtual bool HandleExternalProtocol(const GURL& url, int child_id, - int route_id); + int route_id, + bool is_main_frame, + ui::PageTransition page_transition, + bool has_user_gesture); // Returns true if we should force the given resource to be downloaded. // Otherwise, the content layer decides. |