| 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 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 WebPluginProxy(PluginChannel* channel, | 41 WebPluginProxy(PluginChannel* channel, |
| 42 int route_id, | 42 int route_id, |
| 43 const GURL& page_url, | 43 const GURL& page_url, |
| 44 gfx::NativeViewId containing_window, | 44 gfx::NativeViewId containing_window, |
| 45 int host_render_view_routing_id); | 45 int host_render_view_routing_id); |
| 46 ~WebPluginProxy(); | 46 ~WebPluginProxy(); |
| 47 | 47 |
| 48 void set_delegate(WebPluginDelegateImpl* d) { delegate_ = d; } | 48 void set_delegate(WebPluginDelegateImpl* d) { delegate_ = d; } |
| 49 | 49 |
| 50 // WebPlugin overrides | 50 // WebPlugin overrides |
| 51 void SetWindow(gfx::PluginWindowHandle window); | 51 virtual void SetWindow(gfx::PluginWindowHandle window); |
| 52 | 52 |
| 53 // Whether input events should be sent to the delegate. | 53 // Whether input events should be sent to the delegate. |
| 54 virtual void SetAcceptsInputEvents(bool accepts) { | 54 virtual void SetAcceptsInputEvents(bool accepts); |
| 55 NOTREACHED(); | |
| 56 } | |
| 57 | 55 |
| 58 void WillDestroyWindow(gfx::PluginWindowHandle window); | 56 virtual void WillDestroyWindow(gfx::PluginWindowHandle window); |
| 59 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 60 void SetWindowlessPumpEvent(HANDLE pump_messages_event); | 58 void SetWindowlessPumpEvent(HANDLE pump_messages_event); |
| 61 #endif | 59 #endif |
| 62 | 60 |
| 63 void CancelResource(unsigned long id); | 61 virtual void CancelResource(unsigned long id); |
| 64 void Invalidate(); | 62 virtual void Invalidate(); |
| 65 void InvalidateRect(const gfx::Rect& rect); | 63 virtual void InvalidateRect(const gfx::Rect& rect); |
| 66 NPObject* GetWindowScriptNPObject(); | 64 virtual NPObject* GetWindowScriptNPObject(); |
| 67 NPObject* GetPluginElement(); | 65 virtual NPObject* GetPluginElement(); |
| 68 void SetCookie(const GURL& url, | 66 virtual void SetCookie(const GURL& url, |
| 69 const GURL& first_party_for_cookies, | 67 const GURL& first_party_for_cookies, |
| 70 const std::string& cookie); | 68 const std::string& cookie); |
| 71 std::string GetCookies(const GURL& url, const GURL& first_party_for_cookies); | 69 virtual std::string GetCookies(const GURL& url, |
| 70 const GURL& first_party_for_cookies); |
| 72 | 71 |
| 73 void ShowModalHTMLDialog(const GURL& url, int width, int height, | 72 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
| 74 const std::string& json_arguments, | 73 const std::string& json_arguments, |
| 75 std::string* json_retval); | 74 std::string* json_retval); |
| 76 | 75 |
| 77 // Called by gears over the CPAPI interface to verify that the given event is | 76 // Called by gears over the CPAPI interface to verify that the given event is |
| 78 // the current (javascript) drag event the browser is dispatching, and return | 77 // the current (javascript) drag event the browser is dispatching, and return |
| 79 // the drag data, or control the drop effect (drag cursor), if so. | 78 // the drag data, or control the drop effect (drag cursor), if so. |
| 80 bool GetDragData(struct NPObject* event, bool add_data, int32* identity, | 79 bool GetDragData(struct NPObject* event, bool add_data, int32* identity, |
| 81 int32* event_id, std::string* type, std::string* data); | 80 int32* event_id, std::string* type, std::string* data); |
| 82 bool SetDropEffect(struct NPObject* event, int effect); | 81 bool SetDropEffect(struct NPObject* event, int effect); |
| 83 | 82 |
| 84 void OnMissingPluginStatus(int status); | 83 virtual void OnMissingPluginStatus(int status); |
| 85 // class-specific methods | 84 // class-specific methods |
| 86 | 85 |
| 87 // Retrieves the browsing context associated with the renderer this plugin | 86 // Retrieves the browsing context associated with the renderer this plugin |
| 88 // is in. Calling multiple times will return the same value. | 87 // is in. Calling multiple times will return the same value. |
| 89 CPBrowsingContext GetCPBrowsingContext(); | 88 CPBrowsingContext GetCPBrowsingContext(); |
| 90 | 89 |
| 91 // Retrieves the WebPluginProxy for the given context that was returned by | 90 // Retrieves the WebPluginProxy for the given context that was returned by |
| 92 // GetCPBrowsingContext, or NULL if not found. | 91 // GetCPBrowsingContext, or NULL if not found. |
| 93 static WebPluginProxy* FromCPBrowsingContext(CPBrowsingContext context); | 92 static WebPluginProxy* FromCPBrowsingContext(CPBrowsingContext context); |
| 94 | 93 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 107 // For windowless plugins, paints the given rectangle into the local buffer. | 106 // For windowless plugins, paints the given rectangle into the local buffer. |
| 108 void Paint(const gfx::Rect& rect); | 107 void Paint(const gfx::Rect& rect); |
| 109 | 108 |
| 110 // Callback from the renderer to let us know that a paint occurred. | 109 // Callback from the renderer to let us know that a paint occurred. |
| 111 void DidPaint(); | 110 void DidPaint(); |
| 112 | 111 |
| 113 // Notification received on a plugin issued resource request creation. | 112 // Notification received on a plugin issued resource request creation. |
| 114 void OnResourceCreated(int resource_id, | 113 void OnResourceCreated(int resource_id, |
| 115 webkit_glue::WebPluginResourceClient* client); | 114 webkit_glue::WebPluginResourceClient* client); |
| 116 | 115 |
| 117 void HandleURLRequest(const char* url, | 116 virtual void HandleURLRequest(const char* url, |
| 118 const char* method, | 117 const char* method, |
| 119 const char* target, | 118 const char* target, |
| 120 const char* buf, | 119 const char* buf, |
| 121 unsigned int len, | 120 unsigned int len, |
| 122 int notify_id, | 121 int notify_id, |
| 123 bool popups_allowed, | 122 bool popups_allowed, |
| 124 bool notify_redirects); | 123 bool notify_redirects); |
| 125 void UpdateGeometry(const gfx::Rect& window_rect, | 124 void UpdateGeometry(const gfx::Rect& window_rect, |
| 126 const gfx::Rect& clip_rect, | 125 const gfx::Rect& clip_rect, |
| 127 const TransportDIB::Handle& windowless_buffer, | 126 const TransportDIB::Handle& windowless_buffer, |
| 128 const TransportDIB::Handle& background_buffer, | 127 const TransportDIB::Handle& background_buffer, |
| 129 bool transparent | 128 bool transparent |
| 130 #if defined(OS_MACOSX) | 129 #if defined(OS_MACOSX) |
| 131 , | 130 , |
| 132 int ack_key | 131 int ack_key |
| 133 #endif | 132 #endif |
| 134 ); | 133 ); |
| 135 void CancelDocumentLoad(); | 134 virtual void CancelDocumentLoad(); |
| 136 void InitiateHTTPRangeRequest( | 135 virtual void InitiateHTTPRangeRequest( |
| 137 const char* url, const char* range_info, int range_request_id); | 136 const char* url, const char* range_info, int range_request_id); |
| 138 void SetDeferResourceLoading(unsigned long resource_id, bool defer); | 137 virtual void SetDeferResourceLoading(unsigned long resource_id, bool defer); |
| 139 bool IsOffTheRecord(); | 138 virtual bool IsOffTheRecord(); |
| 140 void ResourceClientDeleted( | 139 virtual void ResourceClientDeleted( |
| 141 webkit_glue::WebPluginResourceClient* resource_client); | 140 webkit_glue::WebPluginResourceClient* resource_client); |
| 142 gfx::NativeViewId containing_window() { return containing_window_; } | 141 gfx::NativeViewId containing_window() { return containing_window_; } |
| 143 | 142 |
| 144 #if defined(OS_MACOSX) | 143 #if defined(OS_MACOSX) |
| 145 virtual void SetImeEnabled(bool enabled); | 144 virtual void SetImeEnabled(bool enabled); |
| 146 | 145 |
| 147 virtual void BindFakePluginWindowHandle(bool opaque); | 146 virtual void BindFakePluginWindowHandle(bool opaque); |
| 148 | 147 |
| 149 virtual webkit_glue::WebPluginAcceleratedSurface* GetAcceleratedSurface(); | 148 virtual webkit_glue::WebPluginAcceleratedSurface* GetAcceleratedSurface(); |
| 150 | 149 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 229 |
| 231 #endif | 230 #endif |
| 232 | 231 |
| 233 // Contains the routing id of the host render view. | 232 // Contains the routing id of the host render view. |
| 234 int host_render_view_routing_id_; | 233 int host_render_view_routing_id_; |
| 235 | 234 |
| 236 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; | 235 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; |
| 237 }; | 236 }; |
| 238 | 237 |
| 239 #endif // CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ | 238 #endif // CHROME_PLUGIN_WEBPLUGIN_PROXY_H_ |
| OLD | NEW |