Thread triggering event info into OpenURLParams
The OpenURLParams has knowledge of user_gesture, which is great to feed
into the existing popup blocking heuristics. However, it is very common
for sites to "steal" a user gesture to use for script-initiated
(click-jacking) popups / navigations.
This CL threads an additional bit of information through via IPC to
the OpenURLParams: the trusted state of the JS triggering event which led to
this navigation request.
Docs for Event.isTrusted can be found here:
https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted
This extra bit can be used to explore additional popup blocking heuristics,
and is planned to be used in conjunction with the subresource_filter
component.
Bug: 733330
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Iac45ed4800989b45a006483b5e6a6b943e6c5af9
Reviewed-on: https://chromium-review.googlesource.com/539898
Commit-Queue: Charlie Harrison <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#481112}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index 648e209..32fabc7 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -64,16 +64,18 @@
bool is_same_document_history_load) override;
bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host,
const GURL& default_url) override;
- void RequestOpenURL(RenderFrameHostImpl* render_frame_host,
- const GURL& url,
- bool uses_post,
- const scoped_refptr<ResourceRequestBodyImpl>& body,
- const std::string& extra_headers,
- const Referrer& referrer,
- WindowOpenDisposition disposition,
- bool force_new_process_for_new_contents,
- bool should_replace_current_entry,
- bool user_gesture) override;
+ void RequestOpenURL(
+ RenderFrameHostImpl* render_frame_host,
+ const GURL& url,
+ bool uses_post,
+ const scoped_refptr<ResourceRequestBodyImpl>& body,
+ const std::string& extra_headers,
+ const Referrer& referrer,
+ WindowOpenDisposition disposition,
+ bool force_new_process_for_new_contents,
+ bool should_replace_current_entry,
+ bool user_gesture,
+ blink::WebTriggeringEventInfo triggering_event_info) override;
void RequestTransferURL(RenderFrameHostImpl* render_frame_host,
const GURL& url,
SiteInstance* source_site_instance,