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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Helper function for sorting post data. | 66 // Helper function for sorting post data. |
67 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, | 67 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, |
68 const char* buf, | 68 const char* buf, |
69 uint32_t length); | 69 uint32_t length); |
70 | 70 |
71 blink::WebFrame* webframe() { return webframe_; } | 71 blink::WebFrame* webframe() { return webframe_; } |
72 | 72 |
73 // blink::WebPlugin methods: | 73 // blink::WebPlugin methods: |
74 bool initialize(blink::WebPluginContainer* container) override; | 74 bool initialize(blink::WebPluginContainer* container) override; |
75 void destroy() override; | 75 void destroy() override; |
76 NPObject* scriptableObject() override; | |
77 struct _NPP* pluginNPP() override; | |
78 bool getFormValue(blink::WebString& value) override; | 76 bool getFormValue(blink::WebString& value) override; |
79 void layoutIfNeeded() override; | 77 void layoutIfNeeded() override; |
80 void paint(blink::WebCanvas* canvas, | 78 void paint(blink::WebCanvas* canvas, |
81 const blink::WebRect& paint_rect) override; | 79 const blink::WebRect& paint_rect) override; |
82 void updateGeometry(const blink::WebRect& window_rect, | 80 void updateGeometry(const blink::WebRect& window_rect, |
83 const blink::WebRect& clip_rect, | 81 const blink::WebRect& clip_rect, |
84 const blink::WebRect& unobscured_rect, | 82 const blink::WebRect& unobscured_rect, |
85 const blink::WebVector<blink::WebRect>& cut_outs_rects, | 83 const blink::WebVector<blink::WebRect>& cut_outs_rects, |
86 bool is_visible) override; | 84 bool is_visible) override; |
87 void updateFocus(bool focused, blink::WebFocusType focus_type) override; | 85 void updateFocus(bool focused, blink::WebFocusType focus_type) override; |
88 void updateVisibility(bool visible) override; | 86 void updateVisibility(bool visible) override; |
89 bool acceptsInputEvents() override; | 87 bool acceptsInputEvents() override; |
90 blink::WebInputEventResult handleInputEvent( | 88 blink::WebInputEventResult handleInputEvent( |
91 const blink::WebInputEvent& event, | 89 const blink::WebInputEvent& event, |
92 blink::WebCursorInfo& cursor_info) override; | 90 blink::WebCursorInfo& cursor_info) override; |
93 void didReceiveResponse(const blink::WebURLResponse& response) override {} | 91 void didReceiveResponse(const blink::WebURLResponse& response) override {} |
94 void didReceiveData(const char* data, int data_length) override {} | 92 void didReceiveData(const char* data, int data_length) override {} |
95 void didFinishLoading() override {} | 93 void didFinishLoading() override {} |
96 void didFailLoading(const blink::WebURLError& error) override {} | 94 void didFailLoading(const blink::WebURLError& error) override {} |
97 bool isPlaceholder() override; | 95 bool isPlaceholder() override; |
98 | 96 |
99 // WebPlugin implementation: | 97 // WebPlugin implementation: |
100 void SetWindow(gfx::PluginWindowHandle window) override; | 98 void SetWindow(gfx::PluginWindowHandle window) override; |
101 void SetAcceptsInputEvents(bool accepts) override; | 99 void SetAcceptsInputEvents(bool accepts) override; |
102 void WillDestroyWindow(gfx::PluginWindowHandle window) override; | 100 void WillDestroyWindow(gfx::PluginWindowHandle window) override; |
103 void CancelResource(unsigned long id) override; | 101 void CancelResource(unsigned long id) override; |
104 void Invalidate() override; | 102 void Invalidate() override; |
105 void InvalidateRect(const gfx::Rect& rect) override; | 103 void InvalidateRect(const gfx::Rect& rect) override; |
106 NPObject* GetWindowScriptNPObject() override; | |
107 NPObject* GetPluginElement() override; | |
108 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; | 104 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; |
109 void SetCookie(const GURL& url, | 105 void SetCookie(const GURL& url, |
110 const GURL& first_party_for_cookies, | 106 const GURL& first_party_for_cookies, |
111 const std::string& cookie) override; | 107 const std::string& cookie) override; |
112 std::string GetCookies(const GURL& url, | 108 std::string GetCookies(const GURL& url, |
113 const GURL& first_party_for_cookies) override; | 109 const GURL& first_party_for_cookies) override; |
114 void CancelDocumentLoad() override; | 110 void CancelDocumentLoad() override; |
115 void DidStartLoading() override; | 111 void DidStartLoading() override; |
116 void DidStopLoading() override; | 112 void DidStopLoading() override; |
117 bool IsOffTheRecord() override; | 113 bool IsOffTheRecord() override; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 bool accepts_input_events_; | 240 bool accepts_input_events_; |
245 RenderFrameImpl* render_frame_; | 241 RenderFrameImpl* render_frame_; |
246 base::WeakPtr<RenderViewImpl> render_view_; | 242 base::WeakPtr<RenderViewImpl> render_view_; |
247 blink::WebFrame* webframe_; | 243 blink::WebFrame* webframe_; |
248 | 244 |
249 WebPluginDelegateProxy* delegate_; | 245 WebPluginDelegateProxy* delegate_; |
250 | 246 |
251 // This is just a weak reference. | 247 // This is just a weak reference. |
252 blink::WebPluginContainer* container_; | 248 blink::WebPluginContainer* container_; |
253 | 249 |
254 // Unique identifier for this plugin, used to track script objects. | |
255 struct _NPP* npp_; | |
256 | |
257 typedef std::map<WebPluginResourceClient*, MultipartResponseDelegate*> | 250 typedef std::map<WebPluginResourceClient*, MultipartResponseDelegate*> |
258 MultiPartResponseHandlerMap; | 251 MultiPartResponseHandlerMap; |
259 // Tracks HTTP multipart response handlers instantiated for | 252 // Tracks HTTP multipart response handlers instantiated for |
260 // a WebPluginResourceClient instance. | 253 // a WebPluginResourceClient instance. |
261 MultiPartResponseHandlerMap multi_part_response_map_; | 254 MultiPartResponseHandlerMap multi_part_response_map_; |
262 | 255 |
263 // The plugin source URL. | 256 // The plugin source URL. |
264 GURL plugin_url_; | 257 GURL plugin_url_; |
265 | 258 |
266 // Indicates if the download would be initiated by the plugin or us. | 259 // Indicates if the download would be initiated by the plugin or us. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 }; | 311 }; |
319 | 312 |
320 LoaderClient loader_client_; | 313 LoaderClient loader_client_; |
321 | 314 |
322 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 315 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
323 }; | 316 }; |
324 | 317 |
325 } // namespace content | 318 } // namespace content |
326 | 319 |
327 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 320 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |