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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporated feedback Created 8 years, 7 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5330389e3c53598ebd5ba5f7a880050edd72f1bc..f60828dfe4a9687babe338db4408dbc1bf72a92f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2427,6 +2427,28 @@ void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) {
GetRenderViewHost()->ClosePage();
}
+bool WebContentsImpl::ShouldIgnoreNavigation(
+ RenderViewHost* render_view_host,
+ const GURL& url,
+ const content::Referrer& referrer,
+ bool is_content_initiated) {
+ if (!delegate_)
+ return false;
+
+ GURL validated_url(url);
+ RenderViewHostImpl* render_view_host_impl =
+ static_cast<RenderViewHostImpl*>(render_view_host);
+ content::RenderProcessHost* render_process_host =
+ render_view_host->GetProcess();
+ render_view_host_impl->FilterURL(
+ ChildProcessSecurityPolicyImpl::GetInstance(),
+ render_process_host->GetID(),
+ false,
+ &validated_url);
+ return delegate_->ShouldIgnoreNavigation(
+ this, validated_url, referrer, is_content_initiated);
+}
+
void WebContentsImpl::RunJavaScriptMessage(
RenderViewHost* rvh,
const string16& message,

Powered by Google App Engine
This is Rietveld 408576698