| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 struct PluginHostMsg_URLRequest_Params; | 31 struct PluginHostMsg_URLRequest_Params; |
| 32 class SkBitmap; | 32 class SkBitmap; |
| 33 | 33 |
| 34 namespace base { | 34 namespace base { |
| 35 class WaitableEvent; | 35 class WaitableEvent; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace content { | 38 namespace content { |
| 39 class NPObjectStub; | 39 class NPObjectStub; |
| 40 class PluginChannelHost; | 40 class PluginChannelHost; |
| 41 class RenderFrameImpl; |
| 41 class RenderViewImpl; | 42 class RenderViewImpl; |
| 42 class WebPluginImpl; | 43 class WebPluginImpl; |
| 43 | 44 |
| 44 // An implementation of WebPluginDelegate that proxies all calls to | 45 // An implementation of WebPluginDelegate that proxies all calls to |
| 45 // the plugin process. | 46 // the plugin process. |
| 46 class WebPluginDelegateProxy | 47 class WebPluginDelegateProxy |
| 47 : public WebPluginDelegate, | 48 : public WebPluginDelegate, |
| 48 public IPC::Listener, | 49 public IPC::Listener, |
| 49 public IPC::Sender, | 50 public IPC::Sender, |
| 50 public base::SupportsWeakPtr<WebPluginDelegateProxy> { | 51 public base::SupportsWeakPtr<WebPluginDelegateProxy> { |
| 51 public: | 52 public: |
| 52 WebPluginDelegateProxy(WebPluginImpl* plugin, | 53 WebPluginDelegateProxy(WebPluginImpl* plugin, |
| 53 const std::string& mime_type, | 54 const std::string& mime_type, |
| 54 const base::WeakPtr<RenderViewImpl>& render_view); | 55 const base::WeakPtr<RenderViewImpl>& render_view, |
| 56 RenderFrameImpl* render_frame); |
| 55 | 57 |
| 56 // WebPluginDelegate implementation: | 58 // WebPluginDelegate implementation: |
| 57 virtual void PluginDestroyed() OVERRIDE; | 59 virtual void PluginDestroyed() OVERRIDE; |
| 58 virtual bool Initialize(const GURL& url, | 60 virtual bool Initialize(const GURL& url, |
| 59 const std::vector<std::string>& arg_names, | 61 const std::vector<std::string>& arg_names, |
| 60 const std::vector<std::string>& arg_values, | 62 const std::vector<std::string>& arg_values, |
| 61 bool load_manually) OVERRIDE; | 63 bool load_manually) OVERRIDE; |
| 62 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 64 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
| 63 const gfx::Rect& clip_rect) OVERRIDE; | 65 const gfx::Rect& clip_rect) OVERRIDE; |
| 64 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE; | 66 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // plugin window gets destroyed, or when the plugin has crashed (at which | 248 // plugin window gets destroyed, or when the plugin has crashed (at which |
| 247 // point the window has already been destroyed). | 249 // point the window has already been destroyed). |
| 248 void WillDestroyWindow(); | 250 void WillDestroyWindow(); |
| 249 | 251 |
| 250 #if defined(OS_WIN) | 252 #if defined(OS_WIN) |
| 251 // Returns true if we should update the plugin geometry synchronously. | 253 // Returns true if we should update the plugin geometry synchronously. |
| 252 bool UseSynchronousGeometryUpdates(); | 254 bool UseSynchronousGeometryUpdates(); |
| 253 #endif | 255 #endif |
| 254 | 256 |
| 255 base::WeakPtr<RenderViewImpl> render_view_; | 257 base::WeakPtr<RenderViewImpl> render_view_; |
| 258 RenderFrameImpl* render_frame_; |
| 256 WebPluginImpl* plugin_; | 259 WebPluginImpl* plugin_; |
| 257 bool uses_shared_bitmaps_; | 260 bool uses_shared_bitmaps_; |
| 258 #if defined(OS_MACOSX) | 261 #if defined(OS_MACOSX) |
| 259 bool uses_compositor_; | 262 bool uses_compositor_; |
| 260 #elif defined(OS_WIN) | 263 #elif defined(OS_WIN) |
| 261 // Used for windowless plugins so that keyboard activation works. | 264 // Used for windowless plugins so that keyboard activation works. |
| 262 gfx::NativeViewId dummy_activation_window_; | 265 gfx::NativeViewId dummy_activation_window_; |
| 263 #endif | 266 #endif |
| 264 gfx::PluginWindowHandle window_; | 267 gfx::PluginWindowHandle window_; |
| 265 scoped_refptr<PluginChannelHost> channel_host_; | 268 scoped_refptr<PluginChannelHost> channel_host_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 305 |
| 303 // The url of the main frame hosting the plugin. | 306 // The url of the main frame hosting the plugin. |
| 304 GURL page_url_; | 307 GURL page_url_; |
| 305 | 308 |
| 306 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); | 309 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); |
| 307 }; | 310 }; |
| 308 | 311 |
| 309 } // namespace content | 312 } // namespace content |
| 310 | 313 |
| 311 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 314 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
| OLD | NEW |