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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 #endif | 188 #endif |
193 RenderFrameImpl* render_frame_; | 189 RenderFrameImpl* render_frame_; |
194 base::WeakPtr<RenderViewImpl> render_view_; | 190 base::WeakPtr<RenderViewImpl> render_view_; |
195 blink::WebFrame* webframe_; | 191 blink::WebFrame* webframe_; |
196 | 192 |
197 WebPluginDelegateProxy* delegate_; | 193 WebPluginDelegateProxy* delegate_; |
198 | 194 |
199 // This is just a weak reference. | 195 // This is just a weak reference. |
200 blink::WebPluginContainer* container_; | 196 blink::WebPluginContainer* container_; |
201 | 197 |
202 // Unique identifier for this plugin, used to track script objects. | |
203 struct _NPP* npp_; | |
204 | |
205 // The plugin source URL. | 198 // The plugin source URL. |
206 GURL plugin_url_; | 199 GURL plugin_url_; |
207 | 200 |
208 // Indicates if the download would be initiated by the plugin or us. | 201 // Indicates if the download would be initiated by the plugin or us. |
209 bool load_manually_; | 202 bool load_manually_; |
210 | 203 |
211 // Indicates if this is the first geometry update received by the plugin. | 204 // Indicates if this is the first geometry update received by the plugin. |
212 bool first_geometry_update_; | 205 bool first_geometry_update_; |
213 | 206 |
214 // Set to true if the next response error should be ignored. | 207 // Set to true if the next response error should be ignored. |
(...skipping 12 matching lines...) Expand all Loading... |
227 // these so that we can re-initialize the plugin if we need to. | 220 // these so that we can re-initialize the plugin if we need to. |
228 std::vector<std::string> arg_names_; | 221 std::vector<std::string> arg_names_; |
229 std::vector<std::string> arg_values_; | 222 std::vector<std::string> arg_values_; |
230 | 223 |
231 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 224 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
232 }; | 225 }; |
233 | 226 |
234 } // namespace content | 227 } // namespace content |
235 | 228 |
236 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 229 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |