OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ | 5 #ifndef CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ |
6 #define CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ | 6 #define CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #if defined(USE_X11) | 11 #if defined(USE_X11) |
12 #include "ui/base/x/x11_util.h" | 12 #include "ui/base/x/x11_util.h" |
13 #endif | 13 #endif |
14 #include "app/surface/transport_dib.h" | 14 #include "app/surface/transport_dib.h" |
15 #include "base/hash_tables.h" | 15 #include "base/hash_tables.h" |
16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
17 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
18 #include "base/mac/scoped_cftyperef.h" | 18 #include "base/mac/scoped_cftyperef.h" |
19 #endif | 19 #endif |
20 #include "base/scoped_handle.h" | 20 #include "base/scoped_handle.h" |
21 #include "base/scoped_ptr.h" | 21 #include "base/scoped_ptr.h" |
22 #include "base/shared_memory.h" | 22 #include "base/shared_memory.h" |
23 #include "base/timer.h" | 23 #include "base/timer.h" |
24 #include "chrome/common/chrome_plugin_api.h" | |
25 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
26 #include "ipc/ipc_message.h" | 25 #include "ipc/ipc_message.h" |
27 #include "webkit/plugins/npapi/webplugin.h" | 26 #include "webkit/plugins/npapi/webplugin.h" |
28 | 27 |
29 class PluginChannel; | 28 class PluginChannel; |
30 | 29 |
31 namespace webkit { | 30 namespace webkit { |
32 namespace npapi { | 31 namespace npapi { |
33 class WebPluginDelegateImpl; | 32 class WebPluginDelegateImpl; |
34 } | 33 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual void Invalidate(); | 67 virtual void Invalidate(); |
69 virtual void InvalidateRect(const gfx::Rect& rect); | 68 virtual void InvalidateRect(const gfx::Rect& rect); |
70 virtual NPObject* GetWindowScriptNPObject(); | 69 virtual NPObject* GetWindowScriptNPObject(); |
71 virtual NPObject* GetPluginElement(); | 70 virtual NPObject* GetPluginElement(); |
72 virtual void SetCookie(const GURL& url, | 71 virtual void SetCookie(const GURL& url, |
73 const GURL& first_party_for_cookies, | 72 const GURL& first_party_for_cookies, |
74 const std::string& cookie); | 73 const std::string& cookie); |
75 virtual std::string GetCookies(const GURL& url, | 74 virtual std::string GetCookies(const GURL& url, |
76 const GURL& first_party_for_cookies); | 75 const GURL& first_party_for_cookies); |
77 | 76 |
78 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | |
79 const std::string& json_arguments, | |
80 std::string* json_retval); | |
81 | |
82 // Called by gears over the CPAPI interface to verify that the given event is | |
83 // the current (javascript) drag event the browser is dispatching, and return | |
84 // the drag data, or control the drop effect (drag cursor), if so. | |
85 bool GetDragData(struct NPObject* event, bool add_data, int32* identity, | |
86 int32* event_id, std::string* type, std::string* data); | |
87 bool SetDropEffect(struct NPObject* event, int effect); | |
88 | |
89 virtual void OnMissingPluginStatus(int status); | 77 virtual void OnMissingPluginStatus(int status); |
90 // class-specific methods | 78 // class-specific methods |
91 | 79 |
92 // Retrieves the browsing context associated with the renderer this plugin | |
93 // is in. Calling multiple times will return the same value. | |
94 CPBrowsingContext GetCPBrowsingContext(); | |
95 | |
96 // Retrieves the WebPluginProxy for the given context that was returned by | |
97 // GetCPBrowsingContext, or NULL if not found. | |
98 static WebPluginProxy* FromCPBrowsingContext(CPBrowsingContext context); | |
99 | |
100 // Returns a WebPluginResourceClient object given its id, or NULL if no | 80 // Returns a WebPluginResourceClient object given its id, or NULL if no |
101 // object with that id exists. | 81 // object with that id exists. |
102 webkit::npapi::WebPluginResourceClient* GetResourceClient(int id); | 82 webkit::npapi::WebPluginResourceClient* GetResourceClient(int id); |
103 | 83 |
104 // Returns the id of the renderer that contains this plugin. | 84 // Returns the id of the renderer that contains this plugin. |
105 int GetRendererId(); | 85 int GetRendererId(); |
106 | 86 |
107 // Returns the id of the associated render view. | 87 // Returns the id of the associated render view. |
108 int host_render_view_routing_id() const { | 88 int host_render_view_routing_id() const { |
109 return host_render_view_routing_id_; | 89 return host_render_view_routing_id_; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 void SetWindowlessBuffer(const TransportDIB::Handle& windowless_buffer, | 176 void SetWindowlessBuffer(const TransportDIB::Handle& windowless_buffer, |
197 const TransportDIB::Handle& background_buffer, | 177 const TransportDIB::Handle& background_buffer, |
198 const gfx::Rect& window_rect); | 178 const gfx::Rect& window_rect); |
199 | 179 |
200 typedef base::hash_map<int, webkit::npapi::WebPluginResourceClient*> | 180 typedef base::hash_map<int, webkit::npapi::WebPluginResourceClient*> |
201 ResourceClientMap; | 181 ResourceClientMap; |
202 ResourceClientMap resource_clients_; | 182 ResourceClientMap resource_clients_; |
203 | 183 |
204 scoped_refptr<PluginChannel> channel_; | 184 scoped_refptr<PluginChannel> channel_; |
205 int route_id_; | 185 int route_id_; |
206 uint32 cp_browsing_context_; | |
207 NPObject* window_npobject_; | 186 NPObject* window_npobject_; |
208 NPObject* plugin_element_; | 187 NPObject* plugin_element_; |
209 webkit::npapi::WebPluginDelegateImpl* delegate_; | 188 webkit::npapi::WebPluginDelegateImpl* delegate_; |
210 gfx::Rect damaged_rect_; | 189 gfx::Rect damaged_rect_; |
211 bool waiting_for_paint_; | 190 bool waiting_for_paint_; |
212 gfx::NativeViewId containing_window_; | 191 gfx::NativeViewId containing_window_; |
213 // The url of the main frame hosting the plugin. | 192 // The url of the main frame hosting the plugin. |
214 GURL page_url_; | 193 GURL page_url_; |
215 | 194 |
216 // Variables used for desynchronized windowless plugin painting. See note in | 195 // Variables used for desynchronized windowless plugin painting. See note in |
(...skipping 20 matching lines...) Expand all Loading... |
237 | 216 |
238 #endif | 217 #endif |
239 | 218 |
240 // Contains the routing id of the host render view. | 219 // Contains the routing id of the host render view. |
241 int host_render_view_routing_id_; | 220 int host_render_view_routing_id_; |
242 | 221 |
243 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; | 222 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; |
244 }; | 223 }; |
245 | 224 |
246 #endif // CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ | 225 #endif // CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ |
OLD | NEW |