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

Unified Diff: chrome/browser/renderer_host/render_widget_host.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host.cc
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index 7d4aa79fbdaad2f14b109dcf92ec5543e7b8fae9..a6efd58ae1847174aec14d0b9229276878560dfa 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -168,6 +168,8 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SetPluginImeEnabled,
+ OnMsgSetPluginImeEnabled)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle,
OnAllocateFakePluginWindowHandle)
IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle,
@@ -1006,6 +1008,10 @@ void RenderWidgetHost::OnMsgGetRootWindowRect(gfx::NativeViewId window_id,
}
}
+void RenderWidgetHost::OnMsgSetPluginImeEnabled(bool enabled, int plugin_id) {
+ view_->SetPluginImeEnabled(enabled, plugin_id);
+}
+
void RenderWidgetHost::OnAllocateFakePluginWindowHandle(
bool opaque,
bool root,
@@ -1209,6 +1215,11 @@ void RenderWidgetHost::ProcessKeyboardEventAck(int type, bool processed) {
NativeWebKeyboardEvent front_item = key_queue_.front();
key_queue_.pop_front();
+#if defined(OS_MACOSX)
+ if (!is_hidden_ && view_->PostProcessEventForPluginIme(front_item))
+ return;
+#endif
+
// We only send unprocessed key event upwards if we are not hidden,
// because the user has moved away from us and no longer expect any effect
// of this key event.
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | chrome/browser/renderer_host/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698