OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_GLUE_WEBPLUGIN_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "config.h" | 12 #include "config.h" |
13 #pragma warning(push, 0) | 13 #pragma warning(push, 0) |
14 #include "ResourceHandle.h" | 14 #include "ResourceHandle.h" |
15 #include "ResourceHandleClient.h" | 15 #include "ResourceHandleClient.h" |
16 #include "ResourceRequest.h" | 16 #include "ResourceRequest.h" |
17 #include "Widget.h" | 17 #include "Widget.h" |
| 18 #include "Vector.h" |
18 #pragma warning(pop) | 19 #pragma warning(pop) |
19 | 20 |
20 #include "base/basictypes.h" | 21 #include "base/basictypes.h" |
21 #include "base/scoped_ptr.h" | 22 #include "base/scoped_ptr.h" |
22 #include "webkit/glue/webframe_impl.h" | 23 #include "webkit/glue/webframe_impl.h" |
23 #include "webkit/glue/webplugin.h" | 24 #include "webkit/glue/webplugin.h" |
24 #include "webkit/glue/webplugin_delegate.h" | 25 #include "webkit/glue/webplugin_delegate.h" |
25 | 26 |
26 class WebFrameImpl; | 27 class WebFrameImpl; |
27 class WebPluginDelegate; | 28 class WebPluginDelegate; |
(...skipping 29 matching lines...) Expand all Loading... |
57 virtual void geometryChanged() const; | 58 virtual void geometryChanged() const; |
58 virtual void setFrameGeometry(const WebCore::IntRect& rect); | 59 virtual void setFrameGeometry(const WebCore::IntRect& rect); |
59 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& rect); | 60 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& rect); |
60 virtual void setFocus(); | 61 virtual void setFocus(); |
61 virtual void show(); | 62 virtual void show(); |
62 virtual void hide(); | 63 virtual void hide(); |
63 virtual void handleEvent(WebCore::Event* event); | 64 virtual void handleEvent(WebCore::Event* event); |
64 virtual void attachToWindow(); | 65 virtual void attachToWindow(); |
65 virtual void detachFromWindow(); | 66 virtual void detachFromWindow(); |
66 | 67 |
| 68 // Returns window-relative rectangles that should clip this widget. |
| 69 // Use this to implement iframe shim behavior. |
| 70 // |
| 71 // TODO(tulrich): add this method to WebCore/platform/Widget.h so it |
| 72 // can be used by any platform. |
| 73 void windowCutoutRects(WTF::Vector<WebCore::IntRect>* cutouts) const; |
| 74 |
67 // These methods are invoked from webkit when it has data to be sent to the | 75 // These methods are invoked from webkit when it has data to be sent to the |
68 // plugin. The plugin in this case does not initiate a download for the data. | 76 // plugin. The plugin in this case does not initiate a download for the data. |
69 void didReceiveResponse(const WebCore::ResourceResponse& response); | 77 void didReceiveResponse(const WebCore::ResourceResponse& response); |
70 void didReceiveData(const char *buffer, int length); | 78 void didReceiveData(const char *buffer, int length); |
71 void didFinishLoading(); | 79 void didFinishLoading(); |
72 void didFail(const WebCore::ResourceError&); | 80 void didFail(const WebCore::ResourceError&); |
73 | 81 |
74 struct HttpResponseInfo { | 82 struct HttpResponseInfo { |
75 std::string url; | 83 std::string url; |
76 std::wstring mime_type; | 84 std::wstring mime_type; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const std::string& json_arguments, | 177 const std::string& json_arguments, |
170 std::string* json_retval); | 178 std::string* json_retval); |
171 void OnMissingPluginStatus(int status); | 179 void OnMissingPluginStatus(int status); |
172 void Invalidate(); | 180 void Invalidate(); |
173 void InvalidateRect(const gfx::Rect& rect); | 181 void InvalidateRect(const gfx::Rect& rect); |
174 | 182 |
175 // Widget implementation: | 183 // Widget implementation: |
176 virtual WebCore::IntRect windowClipRect() const; | 184 virtual WebCore::IntRect windowClipRect() const; |
177 virtual void geometryChanged() const; | 185 virtual void geometryChanged() const; |
178 | 186 |
| 187 // Returns window-relative rectangles that should clip this widget. |
| 188 // Use this to implement iframe shim behavior. |
| 189 // |
| 190 // TODO(tulrich): windowCutoutRects() is not in WebCore::Widgets |
| 191 // yet; need to add it. |
| 192 void windowCutoutRects(WTF::Vector<WebCore::IntRect>* rects) const; |
| 193 |
179 // Override for when our window changes size or position. | 194 // Override for when our window changes size or position. |
180 // Used to notify the plugin when the size or position changes. | 195 // Used to notify the plugin when the size or position changes. |
181 virtual void setFrameGeometry(const WebCore::IntRect& rect); | 196 virtual void setFrameGeometry(const WebCore::IntRect& rect); |
182 | 197 |
183 // Overrides paint so we can notify the underlying widget to repaint. | 198 // Overrides paint so we can notify the underlying widget to repaint. |
184 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& rect); | 199 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& rect); |
185 virtual void print(WebCore::GraphicsContext*); | 200 virtual void print(WebCore::GraphicsContext*); |
186 | 201 |
187 // Override setFocus so we can notify the Plugin. | 202 // Override setFocus so we can notify the Plugin. |
188 virtual void setFocus(); | 203 virtual void setFocus(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void RemoveClient(WebCore::ResourceHandle* handle); | 243 void RemoveClient(WebCore::ResourceHandle* handle); |
229 | 244 |
230 // Returns all the response headers in one string, including the status code. | 245 // Returns all the response headers in one string, including the status code. |
231 std::wstring GetAllHeaders(const WebCore::ResourceResponse& response); | 246 std::wstring GetAllHeaders(const WebCore::ResourceResponse& response); |
232 | 247 |
233 WebCore::Frame* frame() { return webframe_ ? webframe_->frame() : NULL; } | 248 WebCore::Frame* frame() { return webframe_ ? webframe_->frame() : NULL; } |
234 | 249 |
235 // Calculates the bounds of the plugin widget based on the frame rect passed i
n. | 250 // Calculates the bounds of the plugin widget based on the frame rect passed i
n. |
236 void CalculateBounds(const WebCore::IntRect& frame_rect, | 251 void CalculateBounds(const WebCore::IntRect& frame_rect, |
237 WebCore::IntRect* window_rect, | 252 WebCore::IntRect* window_rect, |
238 WebCore::IntRect* clip_rect); | 253 WebCore::IntRect* clip_rect, |
| 254 std::vector<gfx::Rect>* cutout_rects); |
239 | 255 |
240 void HandleURLRequest(const char *method, | 256 void HandleURLRequest(const char *method, |
241 bool is_javascript_url, | 257 bool is_javascript_url, |
242 const char* target, unsigned int len, | 258 const char* target, unsigned int len, |
243 const char* buf, bool is_file_data, | 259 const char* buf, bool is_file_data, |
244 bool notify, const char* url, | 260 bool notify, const char* url, |
245 void* notify_data, bool popups_allowed); | 261 void* notify_data, bool popups_allowed); |
246 | 262 |
247 void CancelDocumentLoad(); | 263 void CancelDocumentLoad(); |
248 | 264 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // a WebPluginResourceClient instance. | 299 // a WebPluginResourceClient instance. |
284 MultiPartResponseHandlerMap multi_part_response_map_; | 300 MultiPartResponseHandlerMap multi_part_response_map_; |
285 | 301 |
286 // The plugin source URL. | 302 // The plugin source URL. |
287 GURL plugin_url_; | 303 GURL plugin_url_; |
288 | 304 |
289 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 305 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
290 }; | 306 }; |
291 | 307 |
292 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 308 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
OLD | NEW |