| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); | 782 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); |
| 783 IPC_MESSAGE_HANDLER(ViewHostMsg_UnloadListenerChanged, | 783 IPC_MESSAGE_HANDLER(ViewHostMsg_UnloadListenerChanged, |
| 784 OnUnloadListenerChanged); | 784 OnUnloadListenerChanged); |
| 785 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, | 785 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, |
| 786 OnQueryFormFieldAutofill) | 786 OnQueryFormFieldAutofill) |
| 787 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, | 787 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, |
| 788 OnRemoveAutofillEntry) | 788 OnRemoveAutofillEntry) |
| 789 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFeedList, OnMsgUpdateFeedList) | 789 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFeedList, OnMsgUpdateFeedList) |
| 790 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) | 790 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) |
| 791 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 791 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
| 792 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectionText, OnMsgSetSelectionText) | |
| 793 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, | 792 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, |
| 794 OnMsgPasteFromSelectionClipboard) | 793 OnMsgPasteFromSelectionClipboard) |
| 795 // Have the super handle all other messages. | 794 // Have the super handle all other messages. |
| 796 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) | 795 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) |
| 797 IPC_END_MESSAGE_MAP_EX() | 796 IPC_END_MESSAGE_MAP_EX() |
| 798 | 797 |
| 799 if (!msg_is_ok) { | 798 if (!msg_is_ok) { |
| 800 // The message had a handler, but its de-serialization failed. | 799 // The message had a handler, but its de-serialization failed. |
| 801 // Kill the renderer. | 800 // Kill the renderer. |
| 802 process()->ReceivedBadMessage(msg.type()); | 801 process()->ReceivedBadMessage(msg.type()); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1108 |
| 1110 void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) { | 1109 void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) { |
| 1111 delegate_->GoToEntryAtOffset(offset); | 1110 delegate_->GoToEntryAtOffset(offset); |
| 1112 } | 1111 } |
| 1113 | 1112 |
| 1114 void RenderViewHost::OnMsgSetTooltipText(const std::wstring& tooltip_text) { | 1113 void RenderViewHost::OnMsgSetTooltipText(const std::wstring& tooltip_text) { |
| 1115 if (view()) | 1114 if (view()) |
| 1116 view()->SetTooltipText(tooltip_text); | 1115 view()->SetTooltipText(tooltip_text); |
| 1117 } | 1116 } |
| 1118 | 1117 |
| 1119 void RenderViewHost::OnMsgSelectionChanged() { | 1118 void RenderViewHost::OnMsgSelectionChanged(const std::string& text) { |
| 1120 if (view()) | 1119 if (view()) |
| 1121 view()->SelectionChanged(); | 1120 view()->SelectionChanged(text); |
| 1122 } | |
| 1123 | |
| 1124 void RenderViewHost::OnMsgSetSelectionText(const std::string& text) { | |
| 1125 if (view()) | |
| 1126 view()->SetSelectionText(text); | |
| 1127 } | 1121 } |
| 1128 | 1122 |
| 1129 void RenderViewHost::OnMsgPasteFromSelectionClipboard() { | 1123 void RenderViewHost::OnMsgPasteFromSelectionClipboard() { |
| 1130 if (view()) | 1124 if (view()) |
| 1131 view()->PasteFromSelectionClipboard(); | 1125 view()->PasteFromSelectionClipboard(); |
| 1132 } | 1126 } |
| 1133 | 1127 |
| 1134 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, | 1128 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, |
| 1135 const std::wstring& title, | 1129 const std::wstring& title, |
| 1136 const std::wstring& default_file, | 1130 const std::wstring& default_file, |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 int callback_id) { | 1390 int callback_id) { |
| 1397 // TODO(aa): Here is where we can check that this renderer was supposed to be | 1391 // TODO(aa): Here is where we can check that this renderer was supposed to be |
| 1398 // able to call extension APIs. | 1392 // able to call extension APIs. |
| 1399 extension_function_dispatcher_.HandleRequest(name, args, callback_id); | 1393 extension_function_dispatcher_.HandleRequest(name, args, callback_id); |
| 1400 } | 1394 } |
| 1401 | 1395 |
| 1402 void RenderViewHost::SendExtensionResponse(int callback_id, | 1396 void RenderViewHost::SendExtensionResponse(int callback_id, |
| 1403 const std::string& response) { | 1397 const std::string& response) { |
| 1404 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1398 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
| 1405 } | 1399 } |
| OLD | NEW |