| 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/browser/renderer_host/render_view_host.h" | 5 #include "content/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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu) | 673 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu) |
| 674 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL) | 674 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL) |
| 675 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 675 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
| 676 OnMsgDidContentsPreferredSizeChange) | 676 OnMsgDidContentsPreferredSizeChange) |
| 677 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 677 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
| 678 OnMsgRunJavaScriptMessage) | 678 OnMsgRunJavaScriptMessage) |
| 679 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 679 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
| 680 OnMsgRunBeforeUnloadConfirm) | 680 OnMsgRunBeforeUnloadConfirm) |
| 681 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) | 681 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) |
| 682 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 682 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
| 683 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
| 683 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 684 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
| 684 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) | 685 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) |
| 685 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK) | 686 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK) |
| 686 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnMsgClosePageACK) | 687 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnMsgClosePageACK) |
| 687 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 688 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
| 688 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, | 689 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, |
| 689 OnAccessibilityNotifications) | 690 OnAccessibilityNotifications) |
| 690 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 691 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
| 691 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | 692 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) |
| 692 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, | 693 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 view->StartDragging(drop_data, drag_operations_mask, image, image_offset); | 1035 view->StartDragging(drop_data, drag_operations_mask, image, image_offset); |
| 1035 } | 1036 } |
| 1036 } | 1037 } |
| 1037 | 1038 |
| 1038 void RenderViewHost::OnUpdateDragCursor(WebDragOperation current_op) { | 1039 void RenderViewHost::OnUpdateDragCursor(WebDragOperation current_op) { |
| 1039 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1040 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1040 if (view) | 1041 if (view) |
| 1041 view->UpdateDragCursor(current_op); | 1042 view->UpdateDragCursor(current_op); |
| 1042 } | 1043 } |
| 1043 | 1044 |
| 1045 void RenderViewHost::OnTargetDropACK() { |
| 1046 NotificationService::current()->Notify( |
| 1047 NotificationType::RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK, |
| 1048 Source<RenderViewHost>(this), |
| 1049 NotificationService::NoDetails()); |
| 1050 } |
| 1051 |
| 1044 void RenderViewHost::OnTakeFocus(bool reverse) { | 1052 void RenderViewHost::OnTakeFocus(bool reverse) { |
| 1045 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1053 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1046 if (view) | 1054 if (view) |
| 1047 view->TakeFocus(reverse); | 1055 view->TakeFocus(reverse); |
| 1048 } | 1056 } |
| 1049 | 1057 |
| 1050 void RenderViewHost::OnAddMessageToConsole(int32 level, | 1058 void RenderViewHost::OnAddMessageToConsole(int32 level, |
| 1051 const std::wstring& message, | 1059 const std::wstring& message, |
| 1052 int32 line_no, | 1060 int32 line_no, |
| 1053 const std::wstring& source_id) { | 1061 const std::wstring& source_id) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 if (view) { | 1320 if (view) { |
| 1313 view->ShowPopupMenu(params.bounds, | 1321 view->ShowPopupMenu(params.bounds, |
| 1314 params.item_height, | 1322 params.item_height, |
| 1315 params.item_font_size, | 1323 params.item_font_size, |
| 1316 params.selected_item, | 1324 params.selected_item, |
| 1317 params.popup_items, | 1325 params.popup_items, |
| 1318 params.right_aligned); | 1326 params.right_aligned); |
| 1319 } | 1327 } |
| 1320 } | 1328 } |
| 1321 #endif | 1329 #endif |
| OLD | NEW |