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

Side by Side 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 unified diff | Download patch
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/browser/renderer_host/render_widget_host.h" 5 #include "chrome/browser/renderer_host/render_widget_host.h"
6 6
7 #include "app/keyboard_codes.h" 7 #include "app/keyboard_codes.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 OnMsgImeUpdateTextInputState) 161 OnMsgImeUpdateTextInputState)
162 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, 162 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition,
163 OnMsgImeCancelComposition) 163 OnMsgImeCancelComposition)
164 IPC_MESSAGE_HANDLER(ViewHostMsg_GpuRenderingActivated, 164 IPC_MESSAGE_HANDLER(ViewHostMsg_GpuRenderingActivated,
165 OnMsgGpuRenderingActivated) 165 OnMsgGpuRenderingActivated)
166 #if defined(OS_MACOSX) 166 #if defined(OS_MACOSX)
167 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) 167 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup)
168 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) 168 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo)
169 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) 169 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect)
170 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) 170 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect)
171 IPC_MESSAGE_HANDLER(ViewHostMsg_SetPluginImeEnabled,
172 OnMsgSetPluginImeEnabled)
171 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, 173 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle,
172 OnAllocateFakePluginWindowHandle) 174 OnAllocateFakePluginWindowHandle)
173 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle, 175 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle,
174 OnDestroyFakePluginWindowHandle) 176 OnDestroyFakePluginWindowHandle)
175 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetIOSurface, 177 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetIOSurface,
176 OnAcceleratedSurfaceSetIOSurface) 178 OnAcceleratedSurfaceSetIOSurface)
177 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, 179 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetTransportDIB,
178 OnAcceleratedSurfaceSetTransportDIB) 180 OnAcceleratedSurfaceSetTransportDIB)
179 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, 181 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped,
180 OnAcceleratedSurfaceBuffersSwapped) 182 OnAcceleratedSurfaceBuffersSwapped)
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 } 1001 }
1000 } 1002 }
1001 1003
1002 void RenderWidgetHost::OnMsgGetRootWindowRect(gfx::NativeViewId window_id, 1004 void RenderWidgetHost::OnMsgGetRootWindowRect(gfx::NativeViewId window_id,
1003 gfx::Rect* results) { 1005 gfx::Rect* results) {
1004 if (view_) { 1006 if (view_) {
1005 *results = view_->GetRootWindowRect(); 1007 *results = view_->GetRootWindowRect();
1006 } 1008 }
1007 } 1009 }
1008 1010
1011 void RenderWidgetHost::OnMsgSetPluginImeEnabled(bool enabled, int plugin_id) {
1012 view_->SetPluginImeEnabled(enabled, plugin_id);
1013 }
1014
1009 void RenderWidgetHost::OnAllocateFakePluginWindowHandle( 1015 void RenderWidgetHost::OnAllocateFakePluginWindowHandle(
1010 bool opaque, 1016 bool opaque,
1011 bool root, 1017 bool root,
1012 gfx::PluginWindowHandle* id) { 1018 gfx::PluginWindowHandle* id) {
1013 // TODO(kbr): similar potential issue here as in OnMsgCreatePluginContainer. 1019 // TODO(kbr): similar potential issue here as in OnMsgCreatePluginContainer.
1014 // Possibly less of an issue because this is only used for the GPU plugin. 1020 // Possibly less of an issue because this is only used for the GPU plugin.
1015 if (view_) { 1021 if (view_) {
1016 *id = view_->AllocateFakePluginWindowHandle(opaque, root); 1022 *id = view_->AllocateFakePluginWindowHandle(opaque, root);
1017 } else { 1023 } else {
1018 NOTIMPLEMENTED(); 1024 NOTIMPLEMENTED();
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 << type << "). Ignoring event."; 1208 << type << "). Ignoring event.";
1203 1209
1204 // Something must be wrong. Clear the |key_queue_| and 1210 // Something must be wrong. Clear the |key_queue_| and
1205 // |suppress_next_char_events_| so that we can resume from the error. 1211 // |suppress_next_char_events_| so that we can resume from the error.
1206 key_queue_.clear(); 1212 key_queue_.clear();
1207 suppress_next_char_events_ = false; 1213 suppress_next_char_events_ = false;
1208 } else { 1214 } else {
1209 NativeWebKeyboardEvent front_item = key_queue_.front(); 1215 NativeWebKeyboardEvent front_item = key_queue_.front();
1210 key_queue_.pop_front(); 1216 key_queue_.pop_front();
1211 1217
1218 #if defined(OS_MACOSX)
1219 if (!is_hidden_ && view_->PostProcessEventForPluginIme(front_item))
1220 return;
1221 #endif
1222
1212 // We only send unprocessed key event upwards if we are not hidden, 1223 // We only send unprocessed key event upwards if we are not hidden,
1213 // because the user has moved away from us and no longer expect any effect 1224 // because the user has moved away from us and no longer expect any effect
1214 // of this key event. 1225 // of this key event.
1215 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { 1226 if (!processed && !is_hidden_ && !front_item.skip_in_browser) {
1216 UnhandledKeyboardEvent(front_item); 1227 UnhandledKeyboardEvent(front_item);
1217 1228
1218 // WARNING: This RenderWidgetHost can be deallocated at this point 1229 // WARNING: This RenderWidgetHost can be deallocated at this point
1219 // (i.e. in the case of Ctrl+W, where the call to 1230 // (i.e. in the case of Ctrl+W, where the call to
1220 // UnhandledKeyboardEvent destroys this RenderWidgetHost). 1231 // UnhandledKeyboardEvent destroys this RenderWidgetHost).
1221 } 1232 }
1222 } 1233 }
1223 } 1234 }
OLDNEW
« 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