| 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 |  | 
| 112 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) | 
| 113     IPC_MESSAGE_HANDLER(PluginMsg_SetWindowFocus, OnSetWindowFocus) | 107     IPC_MESSAGE_HANDLER(PluginMsg_SetWindowFocus, OnSetWindowFocus) | 
| 114     IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden) | 108     IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden) | 
| 115     IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown) | 109     IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown) | 
| 116     IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) | 110     IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) | 
| 117     IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, | 111     IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted, | 
| 118                         OnImeCompositionCompleted) | 112                         OnImeCompositionCompleted) | 
| 119 #endif | 113 #endif | 
| 120     IPC_MESSAGE_UNHANDLED(handled = false) | 114     IPC_MESSAGE_UNHANDLED(handled = false) | 
| 121   IPC_END_MESSAGE_MAP() | 115   IPC_END_MESSAGE_MAP() | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 172     *result = delegate_->Initialize(params.url, | 166     *result = delegate_->Initialize(params.url, | 
| 173                                     arg_names, | 167                                     arg_names, | 
| 174                                     arg_values, | 168                                     arg_values, | 
| 175                                     params.load_manually); | 169                                     params.load_manually); | 
| 176     *transparent = delegate_->instance()->transparent(); | 170     *transparent = delegate_->instance()->transparent(); | 
| 177   } | 171   } | 
| 178 } | 172 } | 
| 179 | 173 | 
| 180 void WebPluginDelegateStub::OnSetFocus(bool focused) { | 174 void WebPluginDelegateStub::OnSetFocus(bool focused) { | 
| 181   delegate_->SetFocus(focused); | 175   delegate_->SetFocus(focused); | 
| 182 #if defined(OS_WIN) && !defined(USE_AURA) |  | 
| 183   if (focused) |  | 
| 184     webplugin_->UpdateIMEStatus(); |  | 
| 185 #endif |  | 
| 186 } | 176 } | 
| 187 | 177 | 
| 188 void WebPluginDelegateStub::OnHandleInputEvent( | 178 void WebPluginDelegateStub::OnHandleInputEvent( | 
| 189     const blink::WebInputEvent *event, | 179     const blink::WebInputEvent *event, | 
| 190     bool* handled, | 180     bool* handled, | 
| 191     WebCursor* cursor) { | 181     WebCursor* cursor) { | 
| 192   WebCursor::CursorInfo cursor_info; | 182   WebCursor::CursorInfo cursor_info; | 
| 193   *handled = delegate_->HandleInputEvent(*event, &cursor_info); | 183   *handled = delegate_->HandleInputEvent(*event, &cursor_info); | 
| 194   cursor->InitFromCursorInfo(cursor_info); | 184   cursor->InitFromCursorInfo(cursor_info); | 
| 195 } | 185 } | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 236   if (!delegate_) | 226   if (!delegate_) | 
| 237     return; | 227     return; | 
| 238   *success = delegate_->GetFormValue(value); | 228   *success = delegate_->GetFormValue(value); | 
| 239 } | 229 } | 
| 240 | 230 | 
| 241 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { | 231 void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { | 
| 242   if (delegate_) | 232   if (delegate_) | 
| 243     delegate_->SetContentAreaHasFocus(has_focus); | 233     delegate_->SetContentAreaHasFocus(has_focus); | 
| 244 } | 234 } | 
| 245 | 235 | 
| 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 |  | 
| 264 #if defined(OS_MACOSX) | 236 #if defined(OS_MACOSX) | 
| 265 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { | 237 void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { | 
| 266   if (delegate_) | 238   if (delegate_) | 
| 267     delegate_->SetWindowHasFocus(has_focus); | 239     delegate_->SetWindowHasFocus(has_focus); | 
| 268 } | 240 } | 
| 269 | 241 | 
| 270 void WebPluginDelegateStub::OnContainerHidden() { | 242 void WebPluginDelegateStub::OnContainerHidden() { | 
| 271   if (delegate_) | 243   if (delegate_) | 
| 272     delegate_->SetContainerVisibility(false); | 244     delegate_->SetContainerVisibility(false); | 
| 273 } | 245 } | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 289 } | 261 } | 
| 290 | 262 | 
| 291 void WebPluginDelegateStub::OnImeCompositionCompleted( | 263 void WebPluginDelegateStub::OnImeCompositionCompleted( | 
| 292     const base::string16& text) { | 264     const base::string16& text) { | 
| 293   if (delegate_) | 265   if (delegate_) | 
| 294     delegate_->ImeCompositionCompleted(text); | 266     delegate_->ImeCompositionCompleted(text); | 
| 295 } | 267 } | 
| 296 #endif  // OS_MACOSX | 268 #endif  // OS_MACOSX | 
| 297 | 269 | 
| 298 }  // namespace content | 270 }  // namespace content | 
| OLD | NEW | 
|---|