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

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2411693003: Move blocking of top-level navigations to nested URLs with extension origins from non-extension pro… (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index b0f6efe4efab876abe3faade52850886b9d2f0b9..ac8f3fd92d78c8bd241a63a0458b573135ed17ea 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -44,6 +44,7 @@ void UpdateThrottleCheckResult(
// static
std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
const GURL& url,
+ const GURL& site_url,
FrameTreeNode* frame_tree_node,
bool is_renderer_initiated,
bool is_synchronous,
@@ -52,12 +53,14 @@ std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
int pending_nav_entry_id,
bool started_from_context_menu) {
return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl(
- url, frame_tree_node, is_renderer_initiated, is_synchronous, is_srcdoc,
- navigation_start, pending_nav_entry_id, started_from_context_menu));
+ url, site_url, frame_tree_node, is_renderer_initiated, is_synchronous,
+ is_srcdoc, navigation_start, pending_nav_entry_id,
+ started_from_context_menu));
}
NavigationHandleImpl::NavigationHandleImpl(
const GURL& url,
+ const GURL& site_url,
FrameTreeNode* frame_tree_node,
bool is_renderer_initiated,
bool is_synchronous,
@@ -66,6 +69,7 @@ NavigationHandleImpl::NavigationHandleImpl(
int pending_nav_entry_id,
bool started_from_context_menu)
: url_(url),
+ site_url_(site_url),
has_user_gesture_(false),
transition_(ui::PAGE_TRANSITION_LINK),
is_external_protocol_(false),
@@ -128,6 +132,10 @@ const GURL& NavigationHandleImpl::GetURL() {
return url_;
}
+const GURL& NavigationHandleImpl::GetSiteURL() {
+ return site_url_;
+}
+
bool NavigationHandleImpl::IsInMainFrame() {
return frame_tree_node_->IsMainFrame();
}

Powered by Google App Engine
This is Rietveld 408576698