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_PPAPI_PPAPI_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
15 #include "third_party/WebKit/public/web/WebPlugin.h" | 15 #include "third_party/WebKit/public/web/WebPlugin.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 #include "webkit/plugins/webkit_plugins_export.h" | |
18 | 17 |
19 struct _NPP; | 18 struct _NPP; |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 class RenderView; | 21 class RenderView; |
23 } | 22 } |
24 | 23 |
25 namespace WebKit { | 24 namespace WebKit { |
26 struct WebPluginParams; | 25 struct WebPluginParams; |
27 struct WebPrintParams; | 26 struct WebPrintParams; |
28 } | 27 } |
29 | 28 |
30 namespace webkit { | 29 namespace webkit { |
31 namespace ppapi { | 30 namespace ppapi { |
32 | 31 |
33 class PluginDelegate; | 32 class PluginDelegate; |
34 class PluginInstanceImpl; | 33 class PluginInstanceImpl; |
35 class PluginModule; | 34 class PluginModule; |
36 class PPB_URLLoader_Impl; | 35 class PPB_URLLoader_Impl; |
37 | 36 |
38 class WebPluginImpl : public WebKit::WebPlugin { | 37 class WebPluginImpl : public WebKit::WebPlugin { |
39 public: | 38 public: |
40 WEBKIT_PLUGINS_EXPORT WebPluginImpl( | 39 WebPluginImpl(PluginModule* module, |
41 PluginModule* module, | 40 const WebKit::WebPluginParams& params, |
42 const WebKit::WebPluginParams& params, | 41 const base::WeakPtr<PluginDelegate>& plugin_delegate, |
43 const base::WeakPtr<PluginDelegate>& plugin_delegate, | 42 const base::WeakPtr<content::RenderView>& render_view); |
44 const base::WeakPtr<content::RenderView>& render_view); | |
45 | 43 |
46 PluginInstanceImpl* instance() { return instance_.get(); } | 44 PluginInstanceImpl* instance() { return instance_.get(); } |
47 | 45 |
48 // WebKit::WebPlugin implementation. | 46 // WebKit::WebPlugin implementation. |
49 virtual WebKit::WebPluginContainer* container() const; | 47 virtual WebKit::WebPluginContainer* container() const; |
50 virtual bool initialize(WebKit::WebPluginContainer* container); | 48 virtual bool initialize(WebKit::WebPluginContainer* container); |
51 virtual void destroy(); | 49 virtual void destroy(); |
52 virtual NPObject* scriptableObject(); | 50 virtual NPObject* scriptableObject(); |
53 virtual struct _NPP* pluginNPP(); | 51 virtual struct _NPP* pluginNPP(); |
54 virtual bool getFormValue(WebKit::WebString& value); | 52 virtual bool getFormValue(WebKit::WebString& value); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas) OVERRIDE; | 87 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas) OVERRIDE; |
90 virtual void printEnd() OVERRIDE; | 88 virtual void printEnd() OVERRIDE; |
91 | 89 |
92 virtual bool canRotateView() OVERRIDE; | 90 virtual bool canRotateView() OVERRIDE; |
93 virtual void rotateView(RotationType type) OVERRIDE; | 91 virtual void rotateView(RotationType type) OVERRIDE; |
94 virtual bool isPlaceholder() OVERRIDE; | 92 virtual bool isPlaceholder() OVERRIDE; |
95 | 93 |
96 private: | 94 private: |
97 friend class base::DeleteHelper<WebPluginImpl>; | 95 friend class base::DeleteHelper<WebPluginImpl>; |
98 | 96 |
99 WEBKIT_PLUGINS_EXPORT virtual ~WebPluginImpl(); | 97 virtual ~WebPluginImpl(); |
100 struct InitData; | 98 struct InitData; |
101 | 99 |
102 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. | 100 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. |
103 // True if the instance represents the entire document in a frame instead of | 101 // True if the instance represents the entire document in a frame instead of |
104 // being an embedded resource. | 102 // being an embedded resource. |
105 bool full_frame_; | 103 bool full_frame_; |
106 scoped_refptr<PluginInstanceImpl> instance_; | 104 scoped_refptr<PluginInstanceImpl> instance_; |
107 gfx::Rect plugin_rect_; | 105 gfx::Rect plugin_rect_; |
108 PP_Var instance_object_; | 106 PP_Var instance_object_; |
109 WebKit::WebPluginContainer* container_; | 107 WebKit::WebPluginContainer* container_; |
110 | 108 |
111 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 109 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
112 }; | 110 }; |
113 | 111 |
114 } // namespace ppapi | 112 } // namespace ppapi |
115 } // namespace webkit | 113 } // namespace webkit |
116 | 114 |
117 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_WEBPLUGIN_IMPL_H_ | 115 #endif // CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |