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 CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Helper function for sorting post data. | 65 // Helper function for sorting post data. |
66 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, | 66 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, |
67 const char* buf, | 67 const char* buf, |
68 uint32_t length); | 68 uint32_t length); |
69 | 69 |
70 blink::WebFrame* webframe() { return webframe_; } | 70 blink::WebFrame* webframe() { return webframe_; } |
71 | 71 |
72 // blink::WebPlugin methods: | 72 // blink::WebPlugin methods: |
73 bool initialize(blink::WebPluginContainer* container) override; | 73 bool initialize(blink::WebPluginContainer* container) override; |
74 void destroy() override; | 74 void destroy() override; |
75 NPObject* scriptableObject() override; | |
76 struct _NPP* pluginNPP() override; | |
77 bool getFormValue(blink::WebString& value) override; | 75 bool getFormValue(blink::WebString& value) override; |
78 void updateAllLifecyclePhases() override; | 76 void updateAllLifecyclePhases() override; |
79 void paint(blink::WebCanvas* canvas, | 77 void paint(blink::WebCanvas* canvas, |
80 const blink::WebRect& paint_rect) override; | 78 const blink::WebRect& paint_rect) override; |
81 void updateGeometry(const blink::WebRect& window_rect, | 79 void updateGeometry(const blink::WebRect& window_rect, |
82 const blink::WebRect& clip_rect, | 80 const blink::WebRect& clip_rect, |
83 const blink::WebRect& unobscured_rect, | 81 const blink::WebRect& unobscured_rect, |
84 const blink::WebVector<blink::WebRect>& cut_outs_rects, | 82 const blink::WebVector<blink::WebRect>& cut_outs_rects, |
85 bool is_visible) override; | 83 bool is_visible) override; |
86 void updateFocus(bool focused, blink::WebFocusType focus_type) override; | 84 void updateFocus(bool focused, blink::WebFocusType focus_type) override; |
87 void updateVisibility(bool visible) override; | 85 void updateVisibility(bool visible) override; |
88 bool acceptsInputEvents() override; | 86 bool acceptsInputEvents() override; |
89 blink::WebInputEventResult handleInputEvent( | 87 blink::WebInputEventResult handleInputEvent( |
90 const blink::WebInputEvent& event, | 88 const blink::WebInputEvent& event, |
91 blink::WebCursorInfo& cursor_info) override; | 89 blink::WebCursorInfo& cursor_info) override; |
92 void didReceiveResponse(const blink::WebURLResponse& response) override {} | 90 void didReceiveResponse(const blink::WebURLResponse& response) override {} |
93 void didReceiveData(const char* data, int data_length) override {} | 91 void didReceiveData(const char* data, int data_length) override {} |
94 void didFinishLoading() override {} | 92 void didFinishLoading() override {} |
95 void didFailLoading(const blink::WebURLError& error) override {} | 93 void didFailLoading(const blink::WebURLError& error) override {} |
96 bool isPlaceholder() override; | 94 bool isPlaceholder() override; |
97 | 95 |
98 // WebPlugin implementation: | 96 // WebPlugin implementation: |
99 void Invalidate() override; | 97 void Invalidate() override; |
100 void InvalidateRect(const gfx::Rect& rect) override; | 98 void InvalidateRect(const gfx::Rect& rect) override; |
101 NPObject* GetWindowScriptNPObject() override; | |
102 NPObject* GetPluginElement() override; | |
103 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; | 99 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; |
104 void SetCookie(const GURL& url, | 100 void SetCookie(const GURL& url, |
105 const GURL& first_party_for_cookies, | 101 const GURL& first_party_for_cookies, |
106 const std::string& cookie) override; | 102 const std::string& cookie) override; |
107 std::string GetCookies(const GURL& url, | 103 std::string GetCookies(const GURL& url, |
108 const GURL& first_party_for_cookies) override; | 104 const GURL& first_party_for_cookies) override; |
109 void CancelDocumentLoad() override; | 105 void CancelDocumentLoad() override; |
110 void DidStartLoading() override; | 106 void DidStartLoading() override; |
111 void DidStopLoading() override; | 107 void DidStopLoading() override; |
112 bool IsOffTheRecord() override; | 108 bool IsOffTheRecord() override; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 #endif | 182 #endif |
187 RenderFrameImpl* render_frame_; | 183 RenderFrameImpl* render_frame_; |
188 base::WeakPtr<RenderViewImpl> render_view_; | 184 base::WeakPtr<RenderViewImpl> render_view_; |
189 blink::WebFrame* webframe_; | 185 blink::WebFrame* webframe_; |
190 | 186 |
191 WebPluginDelegateProxy* delegate_; | 187 WebPluginDelegateProxy* delegate_; |
192 | 188 |
193 // This is just a weak reference. | 189 // This is just a weak reference. |
194 blink::WebPluginContainer* container_; | 190 blink::WebPluginContainer* container_; |
195 | 191 |
196 // Unique identifier for this plugin, used to track script objects. | |
197 struct _NPP* npp_; | |
198 | |
199 // The plugin source URL. | 192 // The plugin source URL. |
200 GURL plugin_url_; | 193 GURL plugin_url_; |
201 | 194 |
202 // Indicates if the download would be initiated by the plugin or us. | 195 // Indicates if the download would be initiated by the plugin or us. |
203 bool load_manually_; | 196 bool load_manually_; |
204 | 197 |
205 // Indicates if this is the first geometry update received by the plugin. | 198 // Indicates if this is the first geometry update received by the plugin. |
206 bool first_geometry_update_; | 199 bool first_geometry_update_; |
207 | 200 |
208 // Set to true if the next response error should be ignored. | 201 // Set to true if the next response error should be ignored. |
(...skipping 12 matching lines...) Expand all Loading... |
221 // these so that we can re-initialize the plugin if we need to. | 214 // these so that we can re-initialize the plugin if we need to. |
222 std::vector<std::string> arg_names_; | 215 std::vector<std::string> arg_names_; |
223 std::vector<std::string> arg_values_; | 216 std::vector<std::string> arg_values_; |
224 | 217 |
225 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 218 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
226 }; | 219 }; |
227 | 220 |
228 } // namespace content | 221 } // namespace content |
229 | 222 |
230 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 223 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |