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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 5572 matching lines...) Expand 10 before | Expand all | Expand 10 after
5583 void RenderView::zoomLevelChanged() { 5583 void RenderView::zoomLevelChanged() {
5584 bool remember = !webview()->mainFrame()->document().isPluginDocument(); 5584 bool remember = !webview()->mainFrame()->document().isPluginDocument();
5585 5585
5586 // Tell the browser which url got zoomed so it can update the menu and the 5586 // Tell the browser which url got zoomed so it can update the menu and the
5587 // saved values if necessary 5587 // saved values if necessary
5588 Send(new ViewHostMsg_DidZoomURL( 5588 Send(new ViewHostMsg_DidZoomURL(
5589 routing_id_, webview()->zoomLevel(), remember, 5589 routing_id_, webview()->zoomLevel(), remember,
5590 GURL(webview()->mainFrame()->url()))); 5590 GURL(webview()->mainFrame()->url())));
5591 } 5591 }
5592 5592
5593 void RenderView::registerProtocolHandler(const WebString& scheme,
5594 const WebString& base_url,
5595 const WebString& url,
5596 const WebString& title) {
5597 GURL base(base_url);
5598 GURL absolute_url = base.Resolve(UTF16ToUTF8(url));
5599 if (base.GetOrigin() != absolute_url.GetOrigin()) {
5600 return;
5601 }
5602 RenderThread::current()->Send(
5603 new ViewHostMsg_RegisterProtocolHandler(routing_id_,
5604 UTF16ToUTF8(scheme),
5605 absolute_url,
5606 title));
5607 }
5608
5593 bool RenderView::IsNonLocalTopLevelNavigation( 5609 bool RenderView::IsNonLocalTopLevelNavigation(
5594 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { 5610 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) {
5595 // Must be a top level frame. 5611 // Must be a top level frame.
5596 if (frame->parent() != NULL) 5612 if (frame->parent() != NULL)
5597 return false; 5613 return false;
5598 5614
5599 // Navigations initiated within Webkit are not sent out to the external host 5615 // Navigations initiated within Webkit are not sent out to the external host
5600 // in the following cases. 5616 // in the following cases.
5601 // 1. The url scheme is not http/https 5617 // 1. The url scheme is not http/https
5602 // 2. There is no opener and this is not the first url being opened by this 5618 // 2. There is no opener and this is not the first url being opened by this
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
5690 } 5706 }
5691 } 5707 }
5692 5708
5693 void RenderView::OnContextMenuClosed( 5709 void RenderView::OnContextMenuClosed(
5694 const webkit_glue::CustomContextMenuContext& custom_context) { 5710 const webkit_glue::CustomContextMenuContext& custom_context) {
5695 if (custom_context.is_pepper_menu) 5711 if (custom_context.is_pepper_menu)
5696 pepper_delegate_.OnContextMenuClosed(custom_context); 5712 pepper_delegate_.OnContextMenuClosed(custom_context);
5697 else 5713 else
5698 context_menu_node_.reset(); 5714 context_menu_node_.reset();
5699 } 5715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698