OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBVIEW_PLUGIN_H_ | 5 #ifndef WEBKIT_PLUGINS_WEBVIEW_PLUGIN_H_ |
6 #define WEBKIT_PLUGINS_WEBVIEW_PLUGIN_H_ | 6 #define WEBKIT_PLUGINS_WEBVIEW_PLUGIN_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
| 18 #include "webkit/plugins/webkit_plugins_export.h" |
18 | 19 |
19 namespace WebKit { | 20 namespace WebKit { |
20 class WebMouseEvent; | 21 class WebMouseEvent; |
21 } | 22 } |
22 struct WebPreferences; | 23 struct WebPreferences; |
23 | 24 |
24 namespace webkit { | 25 namespace webkit { |
25 | 26 |
26 // This class implements the WebPlugin interface by forwarding drawing and | 27 // This class implements the WebPlugin interface by forwarding drawing and |
27 // handling input events to a WebView. | 28 // handling input events to a WebView. |
(...skipping 21 matching lines...) Expand all Loading... |
49 | 50 |
50 // Called when the WebFrame finished loading. | 51 // Called when the WebFrame finished loading. |
51 virtual void DidFinishLoading() = 0; | 52 virtual void DidFinishLoading() = 0; |
52 }; | 53 }; |
53 | 54 |
54 explicit WebViewPlugin(Delegate* delegate); | 55 explicit WebViewPlugin(Delegate* delegate); |
55 | 56 |
56 // Convenience method to set up a new WebViewPlugin using |preferences| | 57 // Convenience method to set up a new WebViewPlugin using |preferences| |
57 // and displaying |html_data|. |url| should be a (fake) chrome:// URL; it is | 58 // and displaying |html_data|. |url| should be a (fake) chrome:// URL; it is |
58 // only used for navigation and never actually resolved. | 59 // only used for navigation and never actually resolved. |
59 static WebViewPlugin* Create(Delegate* delegate, | 60 WEBKIT_PLUGINS_EXPORT static WebViewPlugin* Create( |
60 const WebPreferences& preferences, | 61 Delegate* delegate, |
61 const std::string& html_data, | 62 const WebPreferences& preferences, |
62 const GURL& url); | 63 const std::string& html_data, |
| 64 const GURL& url); |
63 | 65 |
64 WebKit::WebView* web_view() { return web_view_; } | 66 WebKit::WebView* web_view() { return web_view_; } |
65 | 67 |
66 WebKit::WebPluginContainer* container() { return container_; } | 68 WebKit::WebPluginContainer* container() { return container_; } |
67 | 69 |
68 // When loading a plug-in document (i.e. a full page plug-in not embedded in | 70 // When loading a plug-in document (i.e. a full page plug-in not embedded in |
69 // another page), we save all data that has been received, and replay it with | 71 // another page), we save all data that has been received, and replay it with |
70 // this method on the actual plug-in. | 72 // this method on the actual plug-in. |
71 void ReplayReceivedData(WebKit::WebPlugin* plugin); | 73 WEBKIT_PLUGINS_EXPORT void ReplayReceivedData(WebKit::WebPlugin* plugin); |
72 | 74 |
73 void RestoreTitleText(); | 75 WEBKIT_PLUGINS_EXPORT void RestoreTitleText(); |
74 | 76 |
75 // WebPlugin methods: | 77 // WebPlugin methods: |
76 virtual bool initialize(WebKit::WebPluginContainer*); | 78 virtual bool initialize(WebKit::WebPluginContainer*); |
77 virtual void destroy(); | 79 virtual void destroy(); |
78 | 80 |
79 virtual NPObject* scriptableObject(); | 81 virtual NPObject* scriptableObject(); |
80 virtual bool getFormValue(WebKit::WebString* value); | 82 virtual bool getFormValue(WebKit::WebString* value); |
81 | 83 |
82 virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); | 84 virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); |
83 | 85 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 WebKit::WebURLResponse response_; | 157 WebKit::WebURLResponse response_; |
156 std::list<std::string> data_; | 158 std::list<std::string> data_; |
157 bool finished_loading_; | 159 bool finished_loading_; |
158 scoped_ptr<WebKit::WebURLError> error_; | 160 scoped_ptr<WebKit::WebURLError> error_; |
159 WebKit::WebString old_title_; | 161 WebKit::WebString old_title_; |
160 }; | 162 }; |
161 | 163 |
162 } // namespace webkit | 164 } // namespace webkit |
163 | 165 |
164 #endif // WEBKIT_PLUGINS_WEBVIEW_PLUGIN_H_ | 166 #endif // WEBKIT_PLUGINS_WEBVIEW_PLUGIN_H_ |
OLD | NEW |