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 #ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLLoaderClient.
h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLLoaderClient.
h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" |
21 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 23 #include "third_party/npapi/bindings/npruntime.h" |
23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
24 #include "webkit/plugins/npapi/webplugin.h" | 25 #include "webkit/plugins/npapi/webplugin.h" |
25 #include "webkit/plugins/webkit_plugins_export.h" | 26 #include "webkit/plugins/webkit_plugins_export.h" |
26 | 27 |
27 namespace cc { | 28 namespace cc { |
28 class IOSurfaceLayer; | 29 class IOSurfaceLayer; |
29 } | 30 } |
30 | 31 |
31 namespace WebKit { | 32 namespace WebKit { |
32 class WebFrame; | 33 class WebFrame; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 uint32 length); | 69 uint32 length); |
69 | 70 |
70 virtual WebPluginDelegate* delegate(); | 71 virtual WebPluginDelegate* delegate(); |
71 | 72 |
72 private: | 73 private: |
73 // WebKit::WebPlugin methods: | 74 // WebKit::WebPlugin methods: |
74 virtual bool initialize( | 75 virtual bool initialize( |
75 WebKit::WebPluginContainer* container); | 76 WebKit::WebPluginContainer* container); |
76 virtual void destroy(); | 77 virtual void destroy(); |
77 virtual NPObject* scriptableObject(); | 78 virtual NPObject* scriptableObject(); |
| 79 virtual NPP pluginNPP(); |
78 virtual bool getFormValue(WebKit::WebString& value); | 80 virtual bool getFormValue(WebKit::WebString& value); |
79 virtual void paint( | 81 virtual void paint( |
80 WebKit::WebCanvas* canvas, const WebKit::WebRect& paint_rect); | 82 WebKit::WebCanvas* canvas, const WebKit::WebRect& paint_rect); |
81 virtual void updateGeometry( | 83 virtual void updateGeometry( |
82 const WebKit::WebRect& frame_rect, const WebKit::WebRect& clip_rect, | 84 const WebKit::WebRect& frame_rect, const WebKit::WebRect& clip_rect, |
83 const WebKit::WebVector<WebKit::WebRect>& cut_outs, bool is_visible); | 85 const WebKit::WebVector<WebKit::WebRect>& cut_outs, bool is_visible); |
84 virtual void updateFocus(bool focused); | 86 virtual void updateFocus(bool focused); |
85 virtual void updateVisibility(bool visible); | 87 virtual void updateVisibility(bool visible); |
86 virtual bool acceptsInputEvents(); | 88 virtual bool acceptsInputEvents(); |
87 virtual bool handleInputEvent( | 89 virtual bool handleInputEvent( |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 #endif | 287 #endif |
286 bool accepts_input_events_; | 288 bool accepts_input_events_; |
287 base::WeakPtr<WebPluginPageDelegate> page_delegate_; | 289 base::WeakPtr<WebPluginPageDelegate> page_delegate_; |
288 WebKit::WebFrame* webframe_; | 290 WebKit::WebFrame* webframe_; |
289 | 291 |
290 WebPluginDelegate* delegate_; | 292 WebPluginDelegate* delegate_; |
291 | 293 |
292 // This is just a weak reference. | 294 // This is just a weak reference. |
293 WebKit::WebPluginContainer* container_; | 295 WebKit::WebPluginContainer* container_; |
294 | 296 |
| 297 // Unique identifier for this plugin, used to track script objects. |
| 298 NPP npp_; |
| 299 |
295 typedef std::map<WebPluginResourceClient*, | 300 typedef std::map<WebPluginResourceClient*, |
296 webkit_glue::MultipartResponseDelegate*> | 301 webkit_glue::MultipartResponseDelegate*> |
297 MultiPartResponseHandlerMap; | 302 MultiPartResponseHandlerMap; |
298 // Tracks HTTP multipart response handlers instantiated for | 303 // Tracks HTTP multipart response handlers instantiated for |
299 // a WebPluginResourceClient instance. | 304 // a WebPluginResourceClient instance. |
300 MultiPartResponseHandlerMap multi_part_response_map_; | 305 MultiPartResponseHandlerMap multi_part_response_map_; |
301 | 306 |
302 // The plugin source URL. | 307 // The plugin source URL. |
303 GURL plugin_url_; | 308 GURL plugin_url_; |
304 | 309 |
(...skipping 22 matching lines...) Expand all Loading... |
327 | 332 |
328 base::WeakPtrFactory<WebPluginImpl> weak_factory_; | 333 base::WeakPtrFactory<WebPluginImpl> weak_factory_; |
329 | 334 |
330 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 335 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
331 }; | 336 }; |
332 | 337 |
333 } // namespace npapi | 338 } // namespace npapi |
334 } // namespace webkit | 339 } // namespace webkit |
335 | 340 |
336 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ | 341 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |