Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Side by Side Diff: chrome/renderer/render_view.cc

Issue 3808001: Implement IME for Mac plugins using the Cocoa event model on 10.6 (Closed)
Patch Set: Windows and unit test compile fixes Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/webplugin_delegate_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after
4865 4867
4866 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, 4868 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame,
4867 const gfx::Rect& view_frame) { 4869 const gfx::Rect& view_frame) {
4868 // Inform plugins that their window's frame has changed. 4870 // Inform plugins that their window's frame has changed.
4869 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 4871 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
4870 for (plugin_it = plugin_delegates_.begin(); 4872 for (plugin_it = plugin_delegates_.begin();
4871 plugin_it != plugin_delegates_.end(); ++plugin_it) { 4873 plugin_it != plugin_delegates_.end(); ++plugin_it) {
4872 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); 4874 (*plugin_it)->WindowFrameChanged(window_frame, view_frame);
4873 } 4875 }
4874 } 4876 }
4877
4878 void RenderView::OnPluginImeCompositionConfirmed(const string16& text,
4879 int plugin_id) {
4880 // WebPluginDelegateProxy is responsible for figuring out if this text
4881 // applies to it or not, so inform all the delegates.
4882 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
4883 for (plugin_it = plugin_delegates_.begin();
4884 plugin_it != plugin_delegates_.end(); ++plugin_it) {
4885 (*plugin_it)->ImeCompositionConfirmed(text, plugin_id);
4886 }
4887 }
4875 #endif // OS_MACOSX 4888 #endif // OS_MACOSX
4876 4889
4877 void RenderView::SendExtensionRequest( 4890 void RenderView::SendExtensionRequest(
4878 const ViewHostMsg_DomMessage_Params& params) { 4891 const ViewHostMsg_DomMessage_Params& params) {
4879 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params)); 4892 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params));
4880 } 4893 }
4881 4894
4882 void RenderView::OnExtensionResponse(int request_id, 4895 void RenderView::OnExtensionResponse(int request_id,
4883 bool success, 4896 bool success,
4884 const std::string& response, 4897 const std::string& response,
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
5787 #if defined(OS_MACOSX) 5800 #if defined(OS_MACOSX)
5788 if (!has_document_tag_) { 5801 if (!has_document_tag_) {
5789 // Make the call to get the tag. 5802 // Make the call to get the tag.
5790 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); 5803 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_));
5791 has_document_tag_ = true; 5804 has_document_tag_ = true;
5792 } 5805 }
5793 #endif 5806 #endif
5794 } 5807 }
5795 5808
5796 #if defined(OS_MACOSX) 5809 #if defined(OS_MACOSX)
5810 void RenderView::SetPluginImeEnabled(bool enabled, int plugin_id) {
5811 IPC::Message* msg = new ViewHostMsg_SetPluginImeEnabled(routing_id(),
5812 enabled, plugin_id);
5813 // This message can be sent during event-handling, and needs to be delivered
5814 // within that context.
5815 msg->set_unblock(true);
5816 Send(msg);
5817 }
5818
5797 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( 5819 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle(
5798 bool opaque, bool root) { 5820 bool opaque, bool root) {
5799 gfx::PluginWindowHandle window = NULL; 5821 gfx::PluginWindowHandle window = NULL;
5800 Send(new ViewHostMsg_AllocateFakePluginWindowHandle( 5822 Send(new ViewHostMsg_AllocateFakePluginWindowHandle(
5801 routing_id(), opaque, root, &window)); 5823 routing_id(), opaque, root, &window));
5802 if (window) { 5824 if (window) {
5803 fake_plugin_window_handles_.insert(window); 5825 fake_plugin_window_handles_.insert(window);
5804 } 5826 }
5805 return window; 5827 return window;
5806 } 5828 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
5975 } 5997 }
5976 5998
5977 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, 5999 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code,
5978 IPC::PlatformFileForTransit file_for_transit, 6000 IPC::PlatformFileForTransit file_for_transit,
5979 int message_id) { 6001 int message_id) {
5980 pepper_delegate_.OnAsyncFileOpened( 6002 pepper_delegate_.OnAsyncFileOpened(
5981 error_code, 6003 error_code,
5982 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 6004 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
5983 message_id); 6005 message_id);
5984 } 6006 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/webplugin_delegate_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698