OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/render_view.h" | 5 #include "chrome/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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 782 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
783 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBrowserWindowId, | 783 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBrowserWindowId, |
784 OnUpdateBrowserWindowId) | 784 OnUpdateBrowserWindowId) |
785 IPC_MESSAGE_HANDLER(ViewMsg_NotifyRenderViewType, | 785 IPC_MESSAGE_HANDLER(ViewMsg_NotifyRenderViewType, |
786 OnNotifyRendererViewType) | 786 OnNotifyRendererViewType) |
787 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) | 787 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
788 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) | 788 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) |
789 #if defined(OS_MACOSX) | 789 #if defined(OS_MACOSX) |
790 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 790 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
791 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 791 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
| 792 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionConfirmed, |
| 793 OnPluginImeCompositionConfirmed) |
792 #endif | 794 #endif |
793 IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent, | 795 IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent, |
794 OnSetEditCommandsForNextKeyEvent) | 796 OnSetEditCommandsForNextKeyEvent) |
795 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteCode, | 797 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteCode, |
796 OnExecuteCode) | 798 OnExecuteCode) |
797 IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, | 799 IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, |
798 OnCustomContextMenuAction) | 800 OnCustomContextMenuAction) |
799 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) | 801 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) |
800 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) | 802 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) |
801 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) | 803 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) |
(...skipping 4066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4868 | 4870 |
4869 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, | 4871 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, |
4870 const gfx::Rect& view_frame) { | 4872 const gfx::Rect& view_frame) { |
4871 // Inform plugins that their window's frame has changed. | 4873 // Inform plugins that their window's frame has changed. |
4872 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 4874 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
4873 for (plugin_it = plugin_delegates_.begin(); | 4875 for (plugin_it = plugin_delegates_.begin(); |
4874 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4876 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
4875 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); | 4877 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); |
4876 } | 4878 } |
4877 } | 4879 } |
| 4880 |
| 4881 void RenderView::OnPluginImeCompositionConfirmed(const string16& text, |
| 4882 int plugin_id) { |
| 4883 // WebPluginDelegateProxy is responsible for figuring out if this text |
| 4884 // applies to it or not, so inform all the delegates. |
| 4885 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 4886 for (plugin_it = plugin_delegates_.begin(); |
| 4887 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 4888 (*plugin_it)->ImeCompositionConfirmed(text, plugin_id); |
| 4889 } |
| 4890 } |
4878 #endif // OS_MACOSX | 4891 #endif // OS_MACOSX |
4879 | 4892 |
4880 void RenderView::SendExtensionRequest( | 4893 void RenderView::SendExtensionRequest( |
4881 const ViewHostMsg_DomMessage_Params& params) { | 4894 const ViewHostMsg_DomMessage_Params& params) { |
4882 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params)); | 4895 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params)); |
4883 } | 4896 } |
4884 | 4897 |
4885 void RenderView::OnExtensionResponse(int request_id, | 4898 void RenderView::OnExtensionResponse(int request_id, |
4886 bool success, | 4899 bool success, |
4887 const std::string& response, | 4900 const std::string& response, |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5783 #if defined(OS_MACOSX) | 5796 #if defined(OS_MACOSX) |
5784 if (!has_document_tag_) { | 5797 if (!has_document_tag_) { |
5785 // Make the call to get the tag. | 5798 // Make the call to get the tag. |
5786 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); | 5799 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); |
5787 has_document_tag_ = true; | 5800 has_document_tag_ = true; |
5788 } | 5801 } |
5789 #endif | 5802 #endif |
5790 } | 5803 } |
5791 | 5804 |
5792 #if defined(OS_MACOSX) | 5805 #if defined(OS_MACOSX) |
| 5806 void RenderView::SetPluginImeEnabled(bool enabled, int plugin_id) { |
| 5807 IPC::Message* msg = new ViewHostMsg_SetPluginImeEnabled(routing_id(), |
| 5808 enabled, plugin_id); |
| 5809 // This message can be sent during event-handling, and needs to be delivered |
| 5810 // within that context. |
| 5811 msg->set_unblock(true); |
| 5812 Send(msg); |
| 5813 } |
| 5814 |
5793 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( | 5815 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( |
5794 bool opaque, bool root) { | 5816 bool opaque, bool root) { |
5795 gfx::PluginWindowHandle window = NULL; | 5817 gfx::PluginWindowHandle window = NULL; |
5796 Send(new ViewHostMsg_AllocateFakePluginWindowHandle( | 5818 Send(new ViewHostMsg_AllocateFakePluginWindowHandle( |
5797 routing_id(), opaque, root, &window)); | 5819 routing_id(), opaque, root, &window)); |
5798 if (window) { | 5820 if (window) { |
5799 fake_plugin_window_handles_.insert(window); | 5821 fake_plugin_window_handles_.insert(window); |
5800 } | 5822 } |
5801 return window; | 5823 return window; |
5802 } | 5824 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5971 } | 5993 } |
5972 | 5994 |
5973 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, | 5995 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, |
5974 IPC::PlatformFileForTransit file_for_transit, | 5996 IPC::PlatformFileForTransit file_for_transit, |
5975 int message_id) { | 5997 int message_id) { |
5976 pepper_delegate_.OnAsyncFileOpened( | 5998 pepper_delegate_.OnAsyncFileOpened( |
5977 error_code, | 5999 error_code, |
5978 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 6000 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
5979 message_id); | 6001 message_id); |
5980 } | 6002 } |
OLD | NEW |