| 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 CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ | 5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
| 6 #define CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ | 6 #define CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 WebPluginProxy(PluginChannel* channel, | 51 WebPluginProxy(PluginChannel* channel, |
| 52 int route_id, | 52 int route_id, |
| 53 const GURL& page_url, | 53 const GURL& page_url, |
| 54 gfx::NativeViewId containing_window, | 54 gfx::NativeViewId containing_window, |
| 55 int host_render_view_routing_id); | 55 int host_render_view_routing_id); |
| 56 virtual ~WebPluginProxy(); | 56 virtual ~WebPluginProxy(); |
| 57 | 57 |
| 58 void set_delegate(webkit::npapi::WebPluginDelegateImpl* d) { delegate_ = d; } | 58 void set_delegate(webkit::npapi::WebPluginDelegateImpl* d) { delegate_ = d; } |
| 59 | 59 |
| 60 // WebPlugin overrides | 60 // WebPlugin overrides |
| 61 virtual void SetWindow(gfx::PluginWindowHandle window); | 61 virtual void SetWindow(gfx::PluginWindowHandle window) OVERRIDE; |
| 62 | 62 |
| 63 // Whether input events should be sent to the delegate. | 63 // Whether input events should be sent to the delegate. |
| 64 virtual void SetAcceptsInputEvents(bool accepts); | 64 virtual void SetAcceptsInputEvents(bool accepts) OVERRIDE; |
| 65 | 65 |
| 66 virtual void WillDestroyWindow(gfx::PluginWindowHandle window); | 66 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) OVERRIDE; |
| 67 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 68 void SetWindowlessPumpEvent(HANDLE pump_messages_event); | 68 void SetWindowlessPumpEvent(HANDLE pump_messages_event); |
| 69 void ReparentPluginWindow(HWND window, HWND parent); | 69 void ReparentPluginWindow(HWND window, HWND parent); |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 virtual void CancelResource(unsigned long id); | 72 virtual void CancelResource(unsigned long id) OVERRIDE; |
| 73 virtual void Invalidate(); | 73 virtual void Invalidate() OVERRIDE; |
| 74 virtual void InvalidateRect(const gfx::Rect& rect); | 74 virtual void InvalidateRect(const gfx::Rect& rect) OVERRIDE; |
| 75 virtual NPObject* GetWindowScriptNPObject(); | 75 virtual NPObject* GetWindowScriptNPObject() OVERRIDE; |
| 76 virtual NPObject* GetPluginElement(); | 76 virtual NPObject* GetPluginElement() OVERRIDE; |
| 77 virtual bool FindProxyForUrl(const GURL& url, std::string* proxy_list); | 77 virtual bool FindProxyForUrl(const GURL& url, |
| 78 std::string* proxy_list) OVERRIDE; |
| 78 virtual void SetCookie(const GURL& url, | 79 virtual void SetCookie(const GURL& url, |
| 79 const GURL& first_party_for_cookies, | 80 const GURL& first_party_for_cookies, |
| 80 const std::string& cookie); | 81 const std::string& cookie) OVERRIDE; |
| 81 virtual std::string GetCookies(const GURL& url, | 82 virtual std::string GetCookies(const GURL& url, |
| 82 const GURL& first_party_for_cookies); | 83 const GURL& first_party_for_cookies) OVERRIDE; |
| 83 | 84 |
| 84 // class-specific methods | 85 // class-specific methods |
| 85 | 86 |
| 86 // Returns a WebPluginResourceClient object given its id, or NULL if no | 87 // Returns a WebPluginResourceClient object given its id, or NULL if no |
| 87 // object with that id exists. | 88 // object with that id exists. |
| 88 webkit::npapi::WebPluginResourceClient* GetResourceClient(int id); | 89 webkit::npapi::WebPluginResourceClient* GetResourceClient(int id); |
| 89 | 90 |
| 90 // Returns the id of the renderer that contains this plugin. | 91 // Returns the id of the renderer that contains this plugin. |
| 91 int GetRendererId(); | 92 int GetRendererId(); |
| 92 | 93 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 105 void OnResourceCreated(int resource_id, | 106 void OnResourceCreated(int resource_id, |
| 106 webkit::npapi::WebPluginResourceClient* client); | 107 webkit::npapi::WebPluginResourceClient* client); |
| 107 | 108 |
| 108 virtual void HandleURLRequest(const char* url, | 109 virtual void HandleURLRequest(const char* url, |
| 109 const char* method, | 110 const char* method, |
| 110 const char* target, | 111 const char* target, |
| 111 const char* buf, | 112 const char* buf, |
| 112 unsigned int len, | 113 unsigned int len, |
| 113 int notify_id, | 114 int notify_id, |
| 114 bool popups_allowed, | 115 bool popups_allowed, |
| 115 bool notify_redirects); | 116 bool notify_redirects) OVERRIDE; |
| 116 void UpdateGeometry(const gfx::Rect& window_rect, | 117 void UpdateGeometry(const gfx::Rect& window_rect, |
| 117 const gfx::Rect& clip_rect, | 118 const gfx::Rect& clip_rect, |
| 118 const TransportDIB::Handle& windowless_buffer0, | 119 const TransportDIB::Handle& windowless_buffer0, |
| 119 const TransportDIB::Handle& windowless_buffer1, | 120 const TransportDIB::Handle& windowless_buffer1, |
| 120 int windowless_buffer_index, | 121 int windowless_buffer_index, |
| 121 const TransportDIB::Handle& background_buffer, | 122 const TransportDIB::Handle& background_buffer, |
| 122 bool transparent); | 123 bool transparent); |
| 123 virtual void CancelDocumentLoad(); | 124 virtual void CancelDocumentLoad() OVERRIDE; |
| 124 virtual void InitiateHTTPRangeRequest( | 125 virtual void InitiateHTTPRangeRequest( |
| 125 const char* url, const char* range_info, int range_request_id); | 126 const char* url, const char* range_info, int range_request_id) OVERRIDE; |
| 126 virtual void SetDeferResourceLoading(unsigned long resource_id, bool defer); | 127 virtual void SetDeferResourceLoading(unsigned long resource_id, |
| 127 virtual bool IsOffTheRecord(); | 128 bool defer) OVERRIDE; |
| 129 virtual bool IsOffTheRecord() OVERRIDE; |
| 128 virtual void ResourceClientDeleted( | 130 virtual void ResourceClientDeleted( |
| 129 webkit::npapi::WebPluginResourceClient* resource_client); | 131 webkit::npapi::WebPluginResourceClient* resource_client) OVERRIDE; |
| 130 gfx::NativeViewId containing_window() { return containing_window_; } | 132 gfx::NativeViewId containing_window() { return containing_window_; } |
| 131 | 133 |
| 132 #if defined(OS_MACOSX) | 134 #if defined(OS_MACOSX) |
| 133 virtual void FocusChanged(bool focused); | 135 virtual void FocusChanged(bool focused) OVERRIDE; |
| 134 | 136 |
| 135 virtual void StartIme(); | 137 virtual void StartIme() OVERRIDE; |
| 136 | 138 |
| 137 virtual void BindFakePluginWindowHandle(bool opaque); | 139 virtual void BindFakePluginWindowHandle(bool opaque) OVERRIDE; |
| 138 | 140 |
| 139 virtual webkit::npapi::WebPluginAcceleratedSurface* | 141 virtual webkit::npapi::WebPluginAcceleratedSurface* |
| 140 GetAcceleratedSurface(gfx::GpuPreference gpu_preference); | 142 GetAcceleratedSurface(gfx::GpuPreference gpu_preference) OVERRIDE; |
| 141 | 143 |
| 142 // Tell the browser (via the renderer) to invalidate because the | 144 // Tell the browser (via the renderer) to invalidate because the |
| 143 // accelerated buffers have changed. | 145 // accelerated buffers have changed. |
| 144 virtual void AcceleratedFrameBuffersDidSwap( | 146 virtual void AcceleratedFrameBuffersDidSwap( |
| 145 gfx::PluginWindowHandle window, uint64 surface_id); | 147 gfx::PluginWindowHandle window, uint64 surface_id); |
| 146 | 148 |
| 147 // Tell the renderer and browser to associate the given plugin handle with | 149 // Tell the renderer and browser to associate the given plugin handle with |
| 148 // |accelerated_surface_identifier|. The geometry is used to resize any | 150 // |accelerated_surface_identifier|. The geometry is used to resize any |
| 149 // native "window" (which on the Mac is a just a view). | 151 // native "window" (which on the Mac is a just a view). |
| 150 // This method is used when IOSurface support is available. | 152 // This method is used when IOSurface support is available. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 161 const gfx::Size& size, | 163 const gfx::Size& size, |
| 162 const TransportDIB::Handle& dib_handle); | 164 const TransportDIB::Handle& dib_handle); |
| 163 | 165 |
| 164 // Create/destroy TranportDIBs via messages to the browser process. | 166 // Create/destroy TranportDIBs via messages to the browser process. |
| 165 // These are only used when IOSurface support is not available. | 167 // These are only used when IOSurface support is not available. |
| 166 virtual void AllocSurfaceDIB(const size_t size, | 168 virtual void AllocSurfaceDIB(const size_t size, |
| 167 TransportDIB::Handle* dib_handle); | 169 TransportDIB::Handle* dib_handle); |
| 168 virtual void FreeSurfaceDIB(TransportDIB::Id dib_id); | 170 virtual void FreeSurfaceDIB(TransportDIB::Id dib_id); |
| 169 #endif | 171 #endif |
| 170 | 172 |
| 171 virtual void URLRedirectResponse(bool allow, int resource_id); | 173 virtual void URLRedirectResponse(bool allow, int resource_id) OVERRIDE; |
| 172 | 174 |
| 173 #if defined(OS_WIN) && !defined(USE_AURA) | 175 #if defined(OS_WIN) && !defined(USE_AURA) |
| 174 // Retrieves the IME status from a windowless plug-in and sends it to a | 176 // Retrieves the IME status from a windowless plug-in and sends it to a |
| 175 // renderer process. A renderer process will convert the coordinates from | 177 // renderer process. A renderer process will convert the coordinates from |
| 176 // local to the window coordinates and send the converted coordinates to a | 178 // local to the window coordinates and send the converted coordinates to a |
| 177 // browser process. | 179 // browser process. |
| 178 void UpdateIMEStatus(); | 180 void UpdateIMEStatus(); |
| 179 #endif | 181 #endif |
| 180 | 182 |
| 181 private: | 183 private: |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 275 |
| 274 #endif | 276 #endif |
| 275 | 277 |
| 276 // Contains the routing id of the host render view. | 278 // Contains the routing id of the host render view. |
| 277 int host_render_view_routing_id_; | 279 int host_render_view_routing_id_; |
| 278 | 280 |
| 279 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; | 281 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; |
| 280 }; | 282 }; |
| 281 | 283 |
| 282 #endif // CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ | 284 #endif // CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
| OLD | NEW |