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 "content/renderer/render_view.h" | 5 #include "content/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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 OnPpapiBrokerChannelCreated) | 667 OnPpapiBrokerChannelCreated) |
668 #if defined(OS_MACOSX) | 668 #if defined(OS_MACOSX) |
669 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 669 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
670 #endif | 670 #endif |
671 IPC_MESSAGE_HANDLER(ViewMsg_ContextMenuClosed, OnContextMenuClosed) | 671 IPC_MESSAGE_HANDLER(ViewMsg_ContextMenuClosed, OnContextMenuClosed) |
672 IPC_MESSAGE_HANDLER(ViewMsg_NetworkStateChanged, OnNetworkStateChanged) | 672 IPC_MESSAGE_HANDLER(ViewMsg_NetworkStateChanged, OnNetworkStateChanged) |
673 // TODO(viettrungluu): Move to a separate message filter. | 673 // TODO(viettrungluu): Move to a separate message filter. |
674 #if defined(ENABLE_FLAPPER_HACKS) | 674 #if defined(ENABLE_FLAPPER_HACKS) |
675 IPC_MESSAGE_HANDLER(PepperMsg_ConnectTcpACK, OnConnectTcpACK) | 675 IPC_MESSAGE_HANDLER(PepperMsg_ConnectTcpACK, OnConnectTcpACK) |
676 #endif | 676 #endif |
| 677 #if defined(OS_MACOSX) |
| 678 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 679 #endif |
677 | 680 |
678 // Have the super handle all other messages. | 681 // Have the super handle all other messages. |
679 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 682 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
680 IPC_END_MESSAGE_MAP() | 683 IPC_END_MESSAGE_MAP() |
681 return handled; | 684 return handled; |
682 } | 685 } |
683 | 686 |
684 void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) { | 687 void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) { |
685 if (!webview()) | 688 if (!webview()) |
686 return; | 689 return; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 webview()->focusedFrame()->executeCommand( | 904 webview()->focusedFrame()->executeCommand( |
902 WebString::fromUTF8("SelectAll")); | 905 WebString::fromUTF8("SelectAll")); |
903 } | 906 } |
904 | 907 |
905 void RenderView::OnSetInitialFocus(bool reverse) { | 908 void RenderView::OnSetInitialFocus(bool reverse) { |
906 if (!webview()) | 909 if (!webview()) |
907 return; | 910 return; |
908 webview()->setInitialFocus(reverse); | 911 webview()->setInitialFocus(reverse); |
909 } | 912 } |
910 | 913 |
| 914 #if defined(OS_MACOSX) |
| 915 void RenderView::OnSetInLiveResize(bool in_live_resize) { |
| 916 if (!webview()) |
| 917 return; |
| 918 if (in_live_resize) |
| 919 webview()->willStartLiveResize(); |
| 920 else |
| 921 webview()->willEndLiveResize(); |
| 922 } |
| 923 #endif |
| 924 |
911 void RenderView::OnScrollFocusedEditableNodeIntoView() { | 925 void RenderView::OnScrollFocusedEditableNodeIntoView() { |
912 WebKit::WebNode node = GetFocusedNode(); | 926 WebKit::WebNode node = GetFocusedNode(); |
913 if (!node.isNull()) { | 927 if (!node.isNull()) { |
914 if (IsEditableNode(node)) | 928 if (IsEditableNode(node)) |
915 // TODO(varunjain): Change webkit API to scroll a particular node into | 929 // TODO(varunjain): Change webkit API to scroll a particular node into |
916 // view and use that API here instead. | 930 // view and use that API here instead. |
917 webview()->scrollFocusedNodeIntoView(); | 931 webview()->scrollFocusedNodeIntoView(); |
918 } | 932 } |
919 } | 933 } |
920 | 934 |
(...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4103 const webkit_glue::CustomContextMenuContext& custom_context) { | 4117 const webkit_glue::CustomContextMenuContext& custom_context) { |
4104 if (custom_context.is_pepper_menu) | 4118 if (custom_context.is_pepper_menu) |
4105 pepper_delegate_.OnContextMenuClosed(custom_context); | 4119 pepper_delegate_.OnContextMenuClosed(custom_context); |
4106 else | 4120 else |
4107 context_menu_node_.reset(); | 4121 context_menu_node_.reset(); |
4108 } | 4122 } |
4109 | 4123 |
4110 void RenderView::OnNetworkStateChanged(bool online) { | 4124 void RenderView::OnNetworkStateChanged(bool online) { |
4111 WebNetworkStateNotifier::setOnLine(online); | 4125 WebNetworkStateNotifier::setOnLine(online); |
4112 } | 4126 } |
OLD | NEW |