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

Unified Diff: chrome/renderer/render_view.cc

Issue 6410115: Adds navigator.registerProtocolHandler. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Sync'd, disallow non-same origin rph, adds hostname to the infobar. Created 9 years, 10 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: chrome/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 48a3f621a6236a3ebf0658f46fdeecc9e6d5124b..48304f61e73e225da039197332486298172a8b39 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -5590,6 +5590,22 @@ void RenderView::zoomLevelChanged() {
GURL(webview()->mainFrame()->url())));
}
+void RenderView::registerProtocolHandler(const WebString& scheme,
+ const WebString& base_url,
+ const WebString& url,
+ const WebString& title) {
+ GURL base(base_url);
+ GURL absolute_url = base.Resolve(UTF16ToUTF8(url));
+ if (base.GetOrigin() != absolute_url.GetOrigin()) {
+ return;
+ }
+ RenderThread::current()->Send(
+ new ViewHostMsg_RegisterProtocolHandler(routing_id_,
+ UTF16ToUTF8(scheme),
+ absolute_url,
+ title));
+}
+
bool RenderView::IsNonLocalTopLevelNavigation(
const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) {
// Must be a top level frame.

Powered by Google App Engine
This is Rietveld 408576698