| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 RenderViewHostDelegate::OnJSOutOfMemory); | 765 RenderViewHostDelegate::OnJSOutOfMemory); |
| 766 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); | 766 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); |
| 767 IPC_MESSAGE_HANDLER(ViewHostMsg_UnloadListenerChanged, | 767 IPC_MESSAGE_HANDLER(ViewHostMsg_UnloadListenerChanged, |
| 768 OnUnloadListenerChanged); | 768 OnUnloadListenerChanged); |
| 769 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, | 769 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, |
| 770 OnQueryFormFieldAutofill) | 770 OnQueryFormFieldAutofill) |
| 771 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, | 771 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, |
| 772 OnRemoveAutofillEntry) | 772 OnRemoveAutofillEntry) |
| 773 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFeedList, OnMsgUpdateFeedList) | 773 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFeedList, OnMsgUpdateFeedList) |
| 774 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) | 774 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) |
| 775 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
| 776 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectionText, OnMsgSetSelectionText) |
| 775 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, | 777 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, |
| 776 OnPasteFromSelectionClipboard) | 778 OnMsgPasteFromSelectionClipboard) |
| 777 // Have the super handle all other messages. | 779 // Have the super handle all other messages. |
| 778 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) | 780 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) |
| 779 IPC_END_MESSAGE_MAP_EX() | 781 IPC_END_MESSAGE_MAP_EX() |
| 780 | 782 |
| 781 if (!msg_is_ok) { | 783 if (!msg_is_ok) { |
| 782 // The message had a handler, but its de-serialization failed. | 784 // The message had a handler, but its de-serialization failed. |
| 783 // Kill the renderer. | 785 // Kill the renderer. |
| 784 process()->ReceivedBadMessage(msg.type()); | 786 process()->ReceivedBadMessage(msg.type()); |
| 785 } | 787 } |
| 786 } | 788 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1089 |
| 1088 void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) { | 1090 void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) { |
| 1089 delegate_->GoToEntryAtOffset(offset); | 1091 delegate_->GoToEntryAtOffset(offset); |
| 1090 } | 1092 } |
| 1091 | 1093 |
| 1092 void RenderViewHost::OnMsgSetTooltipText(const std::wstring& tooltip_text) { | 1094 void RenderViewHost::OnMsgSetTooltipText(const std::wstring& tooltip_text) { |
| 1093 if (view()) | 1095 if (view()) |
| 1094 view()->SetTooltipText(tooltip_text); | 1096 view()->SetTooltipText(tooltip_text); |
| 1095 } | 1097 } |
| 1096 | 1098 |
| 1099 void RenderViewHost::OnMsgSelectionChanged() { |
| 1100 if (view()) |
| 1101 view()->SelectionChanged(); |
| 1102 } |
| 1103 |
| 1104 void RenderViewHost::OnMsgSetSelectionText(const std::string& text) { |
| 1105 if (view()) |
| 1106 view()->SetSelectionText(text); |
| 1107 } |
| 1108 |
| 1109 void RenderViewHost::OnMsgPasteFromSelectionClipboard() { |
| 1110 if (view()) |
| 1111 view()->PasteFromSelectionClipboard(); |
| 1112 } |
| 1113 |
| 1097 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, | 1114 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, |
| 1098 const std::wstring& title, | 1115 const std::wstring& title, |
| 1099 const std::wstring& default_file, | 1116 const std::wstring& default_file, |
| 1100 const std::wstring& filter) { | 1117 const std::wstring& filter) { |
| 1101 std::wstring real_filter = filter; | 1118 std::wstring real_filter = filter; |
| 1102 std::replace(real_filter.begin(), real_filter.end(), '|', '\0'); | 1119 std::replace(real_filter.begin(), real_filter.end(), '|', '\0'); |
| 1103 delegate_->RunFileChooser(multiple_files, title, default_file, real_filter); | 1120 delegate_->RunFileChooser(multiple_files, title, default_file, real_filter); |
| 1104 } | 1121 } |
| 1105 | 1122 |
| 1106 void RenderViewHost::OnMsgRunJavaScriptMessage( | 1123 void RenderViewHost::OnMsgRunJavaScriptMessage( |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 int callback_id) { | 1376 int callback_id) { |
| 1360 // TODO(aa): Here is where we can check that this renderer was supposed to be | 1377 // TODO(aa): Here is where we can check that this renderer was supposed to be |
| 1361 // able to call extension APIs. | 1378 // able to call extension APIs. |
| 1362 extension_function_dispatcher_.HandleRequest(name, args, callback_id); | 1379 extension_function_dispatcher_.HandleRequest(name, args, callback_id); |
| 1363 } | 1380 } |
| 1364 | 1381 |
| 1365 void RenderViewHost::SendExtensionResponse(int callback_id, | 1382 void RenderViewHost::SendExtensionResponse(int callback_id, |
| 1366 const std::string& response) { | 1383 const std::string& response) { |
| 1367 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1384 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
| 1368 } | 1385 } |
| 1369 | |
| 1370 void RenderViewHost::OnPasteFromSelectionClipboard() { | |
| 1371 if (view()) | |
| 1372 view()->PasteFromSelectionClipboard(); | |
| 1373 } | |
| OLD | NEW |