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/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeUpdateTextInputState, | 166 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeUpdateTextInputState, |
167 OnMsgImeUpdateTextInputState) | 167 OnMsgImeUpdateTextInputState) |
168 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, | 168 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, |
169 OnMsgImeCancelComposition) | 169 OnMsgImeCancelComposition) |
170 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, | 170 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, |
171 OnMsgDidActivateAcceleratedCompositing) | 171 OnMsgDidActivateAcceleratedCompositing) |
172 #if defined(OS_MACOSX) | 172 #if defined(OS_MACOSX) |
173 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) | 173 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) |
174 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) | 174 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) |
175 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) | 175 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) |
176 IPC_MESSAGE_HANDLER(ViewHostMsg_SetPluginImeEnabled, | 176 IPC_MESSAGE_HANDLER(ViewHostMsg_PluginFocusChanged, |
177 OnMsgSetPluginImeEnabled) | 177 OnMsgPluginFocusChanged) |
| 178 IPC_MESSAGE_HANDLER(ViewHostMsg_StartPluginIme, |
| 179 OnMsgStartPluginIme) |
178 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, | 180 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, |
179 OnAllocateFakePluginWindowHandle) | 181 OnAllocateFakePluginWindowHandle) |
180 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle, | 182 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle, |
181 OnDestroyFakePluginWindowHandle) | 183 OnDestroyFakePluginWindowHandle) |
182 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetIOSurface, | 184 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetIOSurface, |
183 OnAcceleratedSurfaceSetIOSurface) | 185 OnAcceleratedSurfaceSetIOSurface) |
184 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, | 186 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, |
185 OnAcceleratedSurfaceSetTransportDIB) | 187 OnAcceleratedSurfaceSetTransportDIB) |
186 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, | 188 IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, |
187 OnAcceleratedSurfaceBuffersSwapped) | 189 OnAcceleratedSurfaceBuffersSwapped) |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 } | 1038 } |
1037 } | 1039 } |
1038 | 1040 |
1039 void RenderWidgetHost::OnMsgGetRootWindowRect(gfx::NativeViewId window_id, | 1041 void RenderWidgetHost::OnMsgGetRootWindowRect(gfx::NativeViewId window_id, |
1040 gfx::Rect* results) { | 1042 gfx::Rect* results) { |
1041 if (view_) { | 1043 if (view_) { |
1042 *results = view_->GetRootWindowRect(); | 1044 *results = view_->GetRootWindowRect(); |
1043 } | 1045 } |
1044 } | 1046 } |
1045 | 1047 |
1046 void RenderWidgetHost::OnMsgSetPluginImeEnabled(bool enabled, int plugin_id) { | 1048 void RenderWidgetHost::OnMsgPluginFocusChanged(bool focused, int plugin_id) { |
1047 view_->SetPluginImeEnabled(enabled, plugin_id); | 1049 view_->PluginFocusChanged(focused, plugin_id); |
| 1050 } |
| 1051 |
| 1052 void RenderWidgetHost::OnMsgStartPluginIme() { |
| 1053 view_->StartPluginIme(); |
1048 } | 1054 } |
1049 | 1055 |
1050 void RenderWidgetHost::OnAllocateFakePluginWindowHandle( | 1056 void RenderWidgetHost::OnAllocateFakePluginWindowHandle( |
1051 bool opaque, | 1057 bool opaque, |
1052 bool root, | 1058 bool root, |
1053 gfx::PluginWindowHandle* id) { | 1059 gfx::PluginWindowHandle* id) { |
1054 // TODO(kbr): similar potential issue here as in OnMsgCreatePluginContainer. | 1060 // TODO(kbr): similar potential issue here as in OnMsgCreatePluginContainer. |
1055 // Possibly less of an issue because this is only used for the GPU plugin. | 1061 // Possibly less of an issue because this is only used for the GPU plugin. |
1056 if (view_) { | 1062 if (view_) { |
1057 *id = view_->AllocateFakePluginWindowHandle(opaque, root); | 1063 *id = view_->AllocateFakePluginWindowHandle(opaque, root); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 return; | 1263 return; |
1258 | 1264 |
1259 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) { | 1265 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) { |
1260 #if defined(TOOLKIT_USES_GTK) | 1266 #if defined(TOOLKIT_USES_GTK) |
1261 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 1267 view_->CreatePluginContainer(deferred_plugin_handles_[i]); |
1262 #endif | 1268 #endif |
1263 } | 1269 } |
1264 | 1270 |
1265 deferred_plugin_handles_.clear(); | 1271 deferred_plugin_handles_.clear(); |
1266 } | 1272 } |
OLD | NEW |