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

Unified Diff: content/renderer/render_view_impl.h

Issue 10387074: Only disallow top-level navigations in platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add blob: URLs, use WebSecurityOrigin 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/renderer/render_view_impl.h
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 64085806118d287c739193f6de4aa3a704a384a5..f29024bf1f4c61e92fffd84df2f19bbb28452e9e 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -992,7 +992,13 @@ class RenderViewImpl : public RenderWidget,
// Returns false unless this is a top-level navigation that crosses origins.
bool IsNonLocalTopLevelNavigation(const GURL& url,
WebKit::WebFrame* frame,
- WebKit::WebNavigationType type);
+ WebKit::WebNavigationType type) const;
+
+ // Returns true if |frame| is the top frame, or if the URL being loaded is
+ // from a different origin than the top frame's (except for data: URLs, which
+ // are not considered remote).
+ bool IsRemoteOrTopLevelNavigation(const GURL& url,
+ WebKit::WebFrame* frame) const;
bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame,
const WebKit::WebURLError& error,

Powered by Google App Engine
This is Rietveld 408576698