Add initiator origin information to all renderer-initiated navigations.
To support propagating precursor origin information throughout navigation
it is required to know the initiator origin for navigations. This is
a part of of bigger CL to implement support for precursor origin in
all navigation paths. This CL adds initiator origin to the following
cases that didn't have it before:
* RenderFrame(Host)Impl::OpenURL
* Navigating a remote frame (through RenderFrameProxy)
* window.open() with noopener attribute
Bug: 882053
Change-Id: Id5d5d0620f4381eb5965cef2168e6e65e098559a
Reviewed-on: https://chromium-review.googlesource.com/c/1379217
Commit-Queue: Nasko Oskov <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Cr-Commit-Position: refs/heads/master@{#617708}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 21d71f8..03dd2009 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2776,6 +2776,7 @@
std::unique_ptr<NavigationController::LoadURLParams> load_params =
std::make_unique<NavigationController::LoadURLParams>(
params.target_url);
+ load_params->initiator_origin = opener->GetLastCommittedOrigin();
load_params->referrer = params.referrer.To<Referrer>();
load_params->transition_type = ui::PAGE_TRANSITION_LINK;
load_params->is_renderer_initiated = true;