OLD | NEW |
---|---|
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 5664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5675 void RenderView::zoomLevelChanged() { | 5675 void RenderView::zoomLevelChanged() { |
5676 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 5676 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
5677 | 5677 |
5678 // Tell the browser which url got zoomed so it can update the menu and the | 5678 // Tell the browser which url got zoomed so it can update the menu and the |
5679 // saved values if necessary | 5679 // saved values if necessary |
5680 Send(new ViewHostMsg_DidZoomURL( | 5680 Send(new ViewHostMsg_DidZoomURL( |
5681 routing_id_, webview()->zoomLevel(), remember, | 5681 routing_id_, webview()->zoomLevel(), remember, |
5682 GURL(webview()->mainFrame()->url()))); | 5682 GURL(webview()->mainFrame()->url()))); |
5683 } | 5683 } |
5684 | 5684 |
5685 void RenderView::registerProtocolHandler(const WebString& scheme, | |
5686 const WebString& baseUrl, | |
5687 const WebString& url, | |
5688 const WebString& title) { | |
5689 GURL base(baseUrl); | |
jam
2011/02/15 18:48:39
nit:
-two space indents
-parameter names need to u
koz (OOO until 15th September)
2011/02/16 03:37:48
Done.
| |
5690 GURL absoluteUrl = base.Resolve(UTF16ToUTF8(url)); | |
5691 RenderThread::current()->Send( | |
5692 new ViewHostMsg_RegisterProtocolHandler( | |
5693 routing_id_, UTF16ToUTF8(scheme), absoluteUrl, title)); | |
jam
2011/02/15 18:48:39
nit: the third line needs to be indented 4 spaces
koz (OOO until 15th September)
2011/02/16 03:37:48
Done.
| |
5694 } | |
5695 | |
5685 bool RenderView::IsNonLocalTopLevelNavigation( | 5696 bool RenderView::IsNonLocalTopLevelNavigation( |
5686 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { | 5697 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { |
5687 // Must be a top level frame. | 5698 // Must be a top level frame. |
5688 if (frame->parent() != NULL) | 5699 if (frame->parent() != NULL) |
5689 return false; | 5700 return false; |
5690 | 5701 |
5691 // Navigations initiated within Webkit are not sent out to the external host | 5702 // Navigations initiated within Webkit are not sent out to the external host |
5692 // in the following cases. | 5703 // in the following cases. |
5693 // 1. The url scheme is not http/https | 5704 // 1. The url scheme is not http/https |
5694 // 2. There is no opener and this is not the first url being opened by this | 5705 // 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 Loading... | |
5782 } | 5793 } |
5783 } | 5794 } |
5784 | 5795 |
5785 void RenderView::OnContextMenuClosed( | 5796 void RenderView::OnContextMenuClosed( |
5786 const webkit_glue::CustomContextMenuContext& custom_context) { | 5797 const webkit_glue::CustomContextMenuContext& custom_context) { |
5787 if (custom_context.is_pepper_menu) | 5798 if (custom_context.is_pepper_menu) |
5788 pepper_delegate_.OnContextMenuClosed(custom_context); | 5799 pepper_delegate_.OnContextMenuClosed(custom_context); |
5789 else | 5800 else |
5790 context_menu_node_.reset(); | 5801 context_menu_node_.reset(); |
5791 } | 5802 } |
OLD | NEW |