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/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnMsgWebUISend) | 767 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnMsgWebUISend) |
768 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardMessageToExternalHost, | 768 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardMessageToExternalHost, |
769 OnMsgForwardMessageToExternalHost) | 769 OnMsgForwardMessageToExternalHost) |
770 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText) | 770 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText) |
771 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 771 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
772 OnMsgRunJavaScriptMessage) | 772 OnMsgRunJavaScriptMessage) |
773 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 773 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
774 OnMsgRunBeforeUnloadConfirm) | 774 OnMsgRunBeforeUnloadConfirm) |
775 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog, | 775 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog, |
776 OnMsgShowModalHTMLDialog) | 776 OnMsgShowModalHTMLDialog) |
| 777 IPC_MESSAGE_HANDLER(ViewHostMsg_IsWebCopyCutEnabled, OnIsWebCopyCutEnabled) |
| 778 IPC_MESSAGE_HANDLER(ViewHostMsg_IsWebPasteEnabled, OnIsWebPasteEnabled) |
777 IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging) | 779 IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging) |
778 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 780 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
779 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 781 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
780 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) | 782 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) |
781 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsAgent, | 783 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsAgent, |
782 OnForwardToDevToolsAgent) | 784 OnForwardToDevToolsAgent) |
783 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsClient, | 785 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsClient, |
784 OnForwardToDevToolsClient) | 786 OnForwardToDevToolsClient) |
785 IPC_MESSAGE_HANDLER(ViewHostMsg_ActivateDevToolsWindow, | 787 IPC_MESSAGE_HANDLER(ViewHostMsg_ActivateDevToolsWindow, |
786 OnActivateDevToolsWindow) | 788 OnActivateDevToolsWindow) |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 | 1258 |
1257 void RenderViewHost::ContextMenuClosed( | 1259 void RenderViewHost::ContextMenuClosed( |
1258 const webkit_glue::CustomContextMenuContext& custom_context) { | 1260 const webkit_glue::CustomContextMenuContext& custom_context) { |
1259 Send(new ViewMsg_ContextMenuClosed(routing_id(), custom_context)); | 1261 Send(new ViewMsg_ContextMenuClosed(routing_id(), custom_context)); |
1260 } | 1262 } |
1261 | 1263 |
1262 void RenderViewHost::PrintNodeUnderContextMenu() { | 1264 void RenderViewHost::PrintNodeUnderContextMenu() { |
1263 Send(new ViewMsg_PrintNodeUnderContextMenu(routing_id())); | 1265 Send(new ViewMsg_PrintNodeUnderContextMenu(routing_id())); |
1264 } | 1266 } |
1265 | 1267 |
| 1268 void RenderViewHost::OnIsWebCopyCutEnabled(bool* enabled) { |
| 1269 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1270 if (view) |
| 1271 *enabled = view->IsWebCopyCutEnabled(); |
| 1272 else |
| 1273 *enabled = false; |
| 1274 } |
| 1275 |
| 1276 void RenderViewHost::OnIsWebPasteEnabled(bool* enabled) { |
| 1277 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1278 if (view) |
| 1279 *enabled = view->IsWebPasteEnabled(); |
| 1280 else |
| 1281 *enabled = false; |
| 1282 } |
| 1283 |
1266 void RenderViewHost::OnMsgStartDragging( | 1284 void RenderViewHost::OnMsgStartDragging( |
1267 const WebDropData& drop_data, | 1285 const WebDropData& drop_data, |
1268 WebDragOperationsMask drag_operations_mask, | 1286 WebDragOperationsMask drag_operations_mask, |
1269 const SkBitmap& image, | 1287 const SkBitmap& image, |
1270 const gfx::Point& image_offset) { | 1288 const gfx::Point& image_offset) { |
1271 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1289 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
1272 if (view) | 1290 if (view) |
1273 view->StartDragging(drop_data, drag_operations_mask, image, image_offset); | 1291 view->StartDragging(drop_data, drag_operations_mask, image, image_offset); |
1274 } | 1292 } |
1275 | 1293 |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 LOG(DFATAL) << "Invalid checked state " << checked_state; | 1723 LOG(DFATAL) << "Invalid checked state " << checked_state; |
1706 return; | 1724 return; |
1707 } | 1725 } |
1708 | 1726 |
1709 CommandState state; | 1727 CommandState state; |
1710 state.is_enabled = is_enabled; | 1728 state.is_enabled = is_enabled; |
1711 state.checked_state = | 1729 state.checked_state = |
1712 static_cast<RenderViewCommandCheckedState>(checked_state); | 1730 static_cast<RenderViewCommandCheckedState>(checked_state); |
1713 command_states_[static_cast<RenderViewCommand>(command)] = state; | 1731 command_states_[static_cast<RenderViewCommand>(command)] = state; |
1714 } | 1732 } |
OLD | NEW |