OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/plugin/webplugin_delegate_stub.h" | 5 #include "content/plugin/webplugin_delegate_stub.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 IPC_MESSAGE_HANDLER(PluginMsg_SetFocus, OnSetFocus) | 96 IPC_MESSAGE_HANDLER(PluginMsg_SetFocus, OnSetFocus) |
97 IPC_MESSAGE_HANDLER(PluginMsg_HandleInputEvent, OnHandleInputEvent) | 97 IPC_MESSAGE_HANDLER(PluginMsg_HandleInputEvent, OnHandleInputEvent) |
98 IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint) | 98 IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint) |
99 IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint) | 99 IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint) |
100 IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, | 100 IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, |
101 OnGetPluginScriptableObject) | 101 OnGetPluginScriptableObject) |
102 IPC_MESSAGE_HANDLER(PluginMsg_GetFormValue, OnGetFormValue) | 102 IPC_MESSAGE_HANDLER(PluginMsg_GetFormValue, OnGetFormValue) |
103 IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) | 103 IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) |
104 IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometrySync, OnUpdateGeometry) | 104 IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometrySync, OnUpdateGeometry) |
105 IPC_MESSAGE_HANDLER(PluginMsg_SetContentAreaFocus, OnSetContentAreaFocus) | 105 IPC_MESSAGE_HANDLER(PluginMsg_SetContentAreaFocus, OnSetContentAreaFocus) |
| 106 #if defined(OS_WIN) && !defined(USE_AURA) |
| 107 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionUpdated, |
| 108 OnImeCompositionUpdated) |
| 109 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, |
| 110 OnImeCompositionCompleted) |
| 111 #endif |
106 #if defined(OS_MACOSX) | 112 #if defined(OS_MACOSX) |
107 IPC_MESSAGE_HANDLER(PluginMsg_SetWindowFocus, OnSetWindowFocus) | 113 IPC_MESSAGE_HANDLER(PluginMsg_SetWindowFocus, OnSetWindowFocus) |
108 IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden) | 114 IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden) |
109 IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown) | 115 IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown) |
110 IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) | 116 IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) |
111 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, | 117 IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, |
112 OnImeCompositionCompleted) | 118 OnImeCompositionCompleted) |
113 #endif | 119 #endif |
114 IPC_MESSAGE_UNHANDLED(handled = false) | 120 IPC_MESSAGE_UNHANDLED(handled = false) |
115 IPC_END_MESSAGE_MAP() | 121 IPC_END_MESSAGE_MAP() |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 *result = delegate_->Initialize(params.url, | 172 *result = delegate_->Initialize(params.url, |
167 arg_names, | 173 arg_names, |
168 arg_values, | 174 arg_values, |
169 params.load_manually); | 175 params.load_manually); |
170 *transparent = delegate_->instance()->transparent(); | 176 *transparent = delegate_->instance()->transparent(); |
171 } | 177 } |
172 } | 178 } |
173 | 179 |
174 void WebPluginDelegateStub::OnSetFocus(bool focused) { | 180 void WebPluginDelegateStub::OnSetFocus(bool focused) { |
175 delegate_->SetFocus(focused); | 181 delegate_->SetFocus(focused); |
| 182 #if defined(OS_WIN) && !defined(USE_AURA) |
| 183 if (focused) |
| 184 webplugin_->UpdateIMEStatus(); |
| 185 #endif |
176 } | 186 } |
177 | 187 |
178 void WebPluginDelegateStub::OnHandleInputEvent( | 188 void WebPluginDelegateStub::OnHandleInputEvent( |
179 const blink::WebInputEvent *event, | 189 const blink::WebInputEvent *event, |
180 bool* handled, | 190 bool* handled, |
181 WebCursor* cursor) { | 191 WebCursor* cursor) { |
182 WebCursor::CursorInfo cursor_info; | 192 WebCursor::CursorInfo cursor_info; |
183 *handled = delegate_->HandleInputEvent(*event, &cursor_info); | 193 *handled = delegate_->HandleInputEvent(*event, &cursor_info); |
184 cursor->InitFromCursorInfo(cursor_info); | 194 cursor->InitFromCursorInfo(cursor_info); |
185 } | 195 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (!delegate_) | 236 if (!delegate_) |
227 return; | 237 return; |
228 *success = delegate_->GetFormValue(value); | 238 *success = delegate_->GetFormValue(value); |
229 } | 239 } |
230 | 240 |
231 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { | 241 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { |
232 if (delegate_) | 242 if (delegate_) |
233 delegate_->SetContentAreaHasFocus(has_focus); | 243 delegate_->SetContentAreaHasFocus(has_focus); |
234 } | 244 } |
235 | 245 |
| 246 #if defined(OS_WIN) && !defined(USE_AURA) |
| 247 void WebPluginDelegateStub::OnImeCompositionUpdated( |
| 248 const base::string16& text, |
| 249 const std::vector<int>& clauses, |
| 250 const std::vector<int>& target, |
| 251 int cursor_position) { |
| 252 if (delegate_) |
| 253 delegate_->ImeCompositionUpdated(text, clauses, target, cursor_position); |
| 254 webplugin_->UpdateIMEStatus(); |
| 255 } |
| 256 |
| 257 void WebPluginDelegateStub::OnImeCompositionCompleted( |
| 258 const base::string16& text) { |
| 259 if (delegate_) |
| 260 delegate_->ImeCompositionCompleted(text); |
| 261 } |
| 262 #endif |
| 263 |
236 #if defined(OS_MACOSX) | 264 #if defined(OS_MACOSX) |
237 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { | 265 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { |
238 if (delegate_) | 266 if (delegate_) |
239 delegate_->SetWindowHasFocus(has_focus); | 267 delegate_->SetWindowHasFocus(has_focus); |
240 } | 268 } |
241 | 269 |
242 void WebPluginDelegateStub::OnContainerHidden() { | 270 void WebPluginDelegateStub::OnContainerHidden() { |
243 if (delegate_) | 271 if (delegate_) |
244 delegate_->SetContainerVisibility(false); | 272 delegate_->SetContainerVisibility(false); |
245 } | 273 } |
(...skipping 15 matching lines...) Expand all Loading... |
261 } | 289 } |
262 | 290 |
263 void WebPluginDelegateStub::OnImeCompositionCompleted( | 291 void WebPluginDelegateStub::OnImeCompositionCompleted( |
264 const base::string16& text) { | 292 const base::string16& text) { |
265 if (delegate_) | 293 if (delegate_) |
266 delegate_->ImeCompositionCompleted(text); | 294 delegate_->ImeCompositionCompleted(text); |
267 } | 295 } |
268 #endif // OS_MACOSX | 296 #endif // OS_MACOSX |
269 | 297 |
270 } // namespace content | 298 } // namespace content |
OLD | NEW |