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" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "content/child/npapi/plugin_instance.h" | 12 #include "content/child/npapi/plugin_instance.h" |
13 #include "content/child/npapi/webplugin_delegate_impl.h" | 13 #include "content/child/npapi/webplugin_delegate_impl.h" |
14 #include "content/child/npapi/webplugin_resource_client.h" | 14 #include "content/child/npapi/webplugin_resource_client.h" |
15 #include "content/child/plugin_messages.h" | 15 #include "content/child/plugin_messages.h" |
16 #include "content/plugin/plugin_channel.h" | 16 #include "content/plugin/plugin_channel.h" |
17 #include "content/plugin/plugin_thread.h" | 17 #include "content/plugin/plugin_thread.h" |
18 #include "content/plugin/webplugin_proxy.h" | 18 #include "content/plugin/webplugin_proxy.h" |
19 #include "content/public/common/content_client.h" | 19 #include "content/public/common/content_client.h" |
20 #include "content/public/common/content_constants.h" | 20 #include "content/public/common/content_constants.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "skia/ext/platform_device.h" | 22 #include "skia/ext/platform_device.h" |
23 #include "third_party/WebKit/public/web/WebBindings.h" | 23 #include "third_party/WebKit/public/web/WebBindings.h" |
24 #include "third_party/WebKit/public/web/WebCursorInfo.h" | 24 #include "third_party/WebKit/public/web/WebCursorInfo.h" |
25 #include "third_party/npapi/bindings/npapi.h" | 25 #include "third_party/npapi/bindings/npapi.h" |
26 #include "third_party/npapi/bindings/npruntime.h" | 26 #include "third_party/npapi/bindings/npruntime.h" |
27 #include "webkit/common/cursors/webcursor.h" | 27 #include "webkit/common/cursors/webcursor.h" |
28 | 28 |
29 using WebKit::WebBindings; | 29 using blink::WebBindings; |
30 using WebKit::WebCursorInfo; | 30 using blink::WebCursorInfo; |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 static void DestroyWebPluginAndDelegate( | 34 static void DestroyWebPluginAndDelegate( |
35 base::WeakPtr<NPObjectStub> scriptable_object, | 35 base::WeakPtr<NPObjectStub> scriptable_object, |
36 WebPluginDelegateImpl* delegate, | 36 WebPluginDelegateImpl* delegate, |
37 WebPlugin* webplugin) { | 37 WebPlugin* webplugin) { |
38 // The plugin may not expect us to try to release the scriptable object | 38 // The plugin may not expect us to try to release the scriptable object |
39 // after calling NPP_Destroy on the instance, so delete the stub now. | 39 // after calling NPP_Destroy on the instance, so delete the stub now. |
40 if (scriptable_object.get()) | 40 if (scriptable_object.get()) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 void WebPluginDelegateStub::OnSetFocus(bool focused) { | 267 void WebPluginDelegateStub::OnSetFocus(bool focused) { |
268 delegate_->SetFocus(focused); | 268 delegate_->SetFocus(focused); |
269 #if defined(OS_WIN) && !defined(USE_AURA) | 269 #if defined(OS_WIN) && !defined(USE_AURA) |
270 if (focused) | 270 if (focused) |
271 webplugin_->UpdateIMEStatus(); | 271 webplugin_->UpdateIMEStatus(); |
272 #endif | 272 #endif |
273 } | 273 } |
274 | 274 |
275 void WebPluginDelegateStub::OnHandleInputEvent( | 275 void WebPluginDelegateStub::OnHandleInputEvent( |
276 const WebKit::WebInputEvent *event, | 276 const blink::WebInputEvent *event, |
277 bool* handled, | 277 bool* handled, |
278 WebCursor* cursor) { | 278 WebCursor* cursor) { |
279 WebCursor::CursorInfo cursor_info; | 279 WebCursor::CursorInfo cursor_info; |
280 *handled = delegate_->HandleInputEvent(*event, &cursor_info); | 280 *handled = delegate_->HandleInputEvent(*event, &cursor_info); |
281 cursor->InitFromCursorInfo(cursor_info); | 281 cursor->InitFromCursorInfo(cursor_info); |
282 } | 282 } |
283 | 283 |
284 void WebPluginDelegateStub::OnPaint(const gfx::Rect& damaged_rect) { | 284 void WebPluginDelegateStub::OnPaint(const gfx::Rect& damaged_rect) { |
285 webplugin_->Paint(damaged_rect); | 285 webplugin_->Paint(damaged_rect); |
286 } | 286 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 data, | 438 data, |
439 static_cast<unsigned int>(params.post_data.size()), | 439 static_cast<unsigned int>(params.post_data.size()), |
440 params.referrer, | 440 params.referrer, |
441 params.notify_redirect, | 441 params.notify_redirect, |
442 params.is_plugin_src_load, | 442 params.is_plugin_src_load, |
443 channel_->renderer_id(), | 443 channel_->renderer_id(), |
444 params.render_view_id); | 444 params.render_view_id); |
445 } | 445 } |
446 | 446 |
447 } // namespace content | 447 } // namespace content |
OLD | NEW |