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 "webkit/glue/plugins/pepper_webplugin_impl.h" | 5 #include "webkit/glue/plugins/pepper_webplugin_impl.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "third_party/ppapi/c/pp_var.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
11 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 12 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
12 #include "webkit/glue/plugins/pepper_plugin_module.h" | 13 #include "webkit/glue/plugins/pepper_plugin_module.h" |
| 14 #include "webkit/glue/plugins/pepper_var.h" |
13 | 15 |
14 using WebKit::WebCanvas; | 16 using WebKit::WebCanvas; |
15 using WebKit::WebPluginContainer; | 17 using WebKit::WebPluginContainer; |
16 using WebKit::WebPluginParams; | 18 using WebKit::WebPluginParams; |
17 using WebKit::WebRect; | 19 using WebKit::WebRect; |
18 using WebKit::WebVector; | 20 using WebKit::WebVector; |
19 | 21 |
20 namespace pepper { | 22 namespace pepper { |
21 | 23 |
22 WebPluginImpl::WebPluginImpl( | 24 WebPluginImpl::WebPluginImpl( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void WebPluginImpl::destroy() { | 64 void WebPluginImpl::destroy() { |
63 if (instance_) { | 65 if (instance_) { |
64 instance_->Delete(); | 66 instance_->Delete(); |
65 instance_ = NULL; | 67 instance_ = NULL; |
66 } | 68 } |
67 | 69 |
68 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 70 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
69 } | 71 } |
70 | 72 |
71 NPObject* WebPluginImpl::scriptableObject() { | 73 NPObject* WebPluginImpl::scriptableObject() { |
72 // TODO(brettw): implement getting this from the plugin instance. | 74 return GetNPObject(instance_->GetInstanceObject()); |
73 return NULL; | |
74 } | 75 } |
75 | 76 |
76 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { | 77 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { |
77 instance_->Paint(canvas, plugin_rect_, rect); | 78 instance_->Paint(canvas, plugin_rect_, rect); |
78 } | 79 } |
79 | 80 |
80 void WebPluginImpl::updateGeometry( | 81 void WebPluginImpl::updateGeometry( |
81 const WebRect& window_rect, | 82 const WebRect& window_rect, |
82 const WebRect& clip_rect, | 83 const WebRect& clip_rect, |
83 const WebVector<WebRect>& cut_outs_rects, | 84 const WebVector<WebRect>& cut_outs_rects, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void* notify_data) { | 119 void* notify_data) { |
119 } | 120 } |
120 | 121 |
121 void WebPluginImpl::didFailLoadingFrameRequest( | 122 void WebPluginImpl::didFailLoadingFrameRequest( |
122 const WebKit::WebURL& url, | 123 const WebKit::WebURL& url, |
123 void* notify_data, | 124 void* notify_data, |
124 const WebKit::WebURLError& error) { | 125 const WebKit::WebURLError& error) { |
125 } | 126 } |
126 | 127 |
127 } // namespace pepper | 128 } // namespace pepper |
OLD | NEW |