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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 1234403005: Don't refer browser-initiated navigations to web-safe URLs to delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: extensions/browser/guest_view/web_view/web_view_guest.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index 1ee9252e392997ae23c48fd33d4073ef38bcbff1..30a4b0f7aecb3d03fb3327dc148f2e85774fbf55 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -1223,7 +1223,11 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
// Chrome Apps and WebUI. This is a browser initiated request and so
// we pass it along to the embedder's WebContentsDelegate to get the
// browser to perform the action for the <webview>.
- if (!params.is_renderer_initiated) {
+ // However, browser-initiated navigations (e.g. from extensions) to web-safe
+ // urls should not be referred to the delegate, which may block them.
Charlie Reis 2015/07/17 00:05:15 I feel like this code is getting very difficult to
wjmaclean 2015/07/17 01:29:46 Yes, that was my conclusion, though I didn't think
+ if (!params.is_renderer_initiated &&
+ !content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
+ params.url.scheme())) {
if (!owner_web_contents()->GetDelegate())
return nullptr;
return owner_web_contents()->GetDelegate()->OpenURLFromTab(

Powered by Google App Engine
This is Rietveld 408576698