| 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_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
| 17 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/surface/transport_dib.h" | 20 #include "ui/gfx/surface/transport_dib.h" |
| 21 #include "webkit/plugins/npapi/webplugin_delegate.h" | 21 #include "webkit/plugins/npapi/webplugin_delegate.h" |
| 22 #include "webkit/plugins/webplugininfo.h" | 22 #include "webkit/plugins/webplugininfo.h" |
| 23 | 23 |
| 24 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
| 25 #include "base/hash_tables.h" | 25 #include "base/hash_tables.h" |
| 26 #include "base/memory/linked_ptr.h" | 26 #include "base/memory/linked_ptr.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 class NPObjectStub; |
| 30 class PluginChannelHost; |
| 31 class RenderViewImpl; |
| 32 class SkBitmap; |
| 33 |
| 29 struct NPObject; | 34 struct NPObject; |
| 30 class NPObjectStub; | |
| 31 struct NPVariant_Param; | 35 struct NPVariant_Param; |
| 32 class PluginChannelHost; | |
| 33 struct PluginHostMsg_URLRequest_Params; | 36 struct PluginHostMsg_URLRequest_Params; |
| 34 class RenderView; | |
| 35 class SkBitmap; | |
| 36 | 37 |
| 37 namespace base { | 38 namespace base { |
| 38 class SharedMemory; | 39 class SharedMemory; |
| 39 class WaitableEvent; | 40 class WaitableEvent; |
| 40 } | 41 } |
| 41 | 42 |
| 42 namespace skia { | 43 namespace skia { |
| 43 class PlatformCanvas; | 44 class PlatformCanvas; |
| 44 } | 45 } |
| 45 | 46 |
| 46 namespace webkit { | 47 namespace webkit { |
| 47 namespace npapi { | 48 namespace npapi { |
| 48 class WebPlugin; | 49 class WebPlugin; |
| 49 } | 50 } |
| 50 } | 51 } |
| 51 | 52 |
| 52 // An implementation of WebPluginDelegate that proxies all calls to | 53 // An implementation of WebPluginDelegate that proxies all calls to |
| 53 // the plugin process. | 54 // the plugin process. |
| 54 class WebPluginDelegateProxy | 55 class WebPluginDelegateProxy |
| 55 : public webkit::npapi::WebPluginDelegate, | 56 : public webkit::npapi::WebPluginDelegate, |
| 56 public IPC::Channel::Listener, | 57 public IPC::Channel::Listener, |
| 57 public IPC::Message::Sender, | 58 public IPC::Message::Sender, |
| 58 public base::SupportsWeakPtr<WebPluginDelegateProxy> { | 59 public base::SupportsWeakPtr<WebPluginDelegateProxy> { |
| 59 public: | 60 public: |
| 60 WebPluginDelegateProxy(const std::string& mime_type, | 61 WebPluginDelegateProxy(const std::string& mime_type, |
| 61 const base::WeakPtr<RenderView>& render_view); | 62 const base::WeakPtr<RenderViewImpl>& render_view); |
| 62 | 63 |
| 63 // WebPluginDelegate implementation: | 64 // WebPluginDelegate implementation: |
| 64 virtual void PluginDestroyed(); | 65 virtual void PluginDestroyed(); |
| 65 virtual bool Initialize(const GURL& url, | 66 virtual bool Initialize(const GURL& url, |
| 66 const std::vector<std::string>& arg_names, | 67 const std::vector<std::string>& arg_names, |
| 67 const std::vector<std::string>& arg_values, | 68 const std::vector<std::string>& arg_values, |
| 68 webkit::npapi::WebPlugin* plugin, | 69 webkit::npapi::WebPlugin* plugin, |
| 69 bool load_manually); | 70 bool load_manually); |
| 70 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 71 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
| 71 const gfx::Rect& clip_rect); | 72 const gfx::Rect& clip_rect); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // the plug-in. Returns true if it successfully sets the window handle on the | 263 // the plug-in. Returns true if it successfully sets the window handle on the |
| 263 // plug-in. | 264 // plug-in. |
| 264 bool BindFakePluginWindowHandle(bool opaque); | 265 bool BindFakePluginWindowHandle(bool opaque); |
| 265 #endif // OS_MACOSX | 266 #endif // OS_MACOSX |
| 266 | 267 |
| 267 #if defined(OS_WIN) | 268 #if defined(OS_WIN) |
| 268 // Returns true if we should update the plugin geometry synchronously. | 269 // Returns true if we should update the plugin geometry synchronously. |
| 269 bool UseSynchronousGeometryUpdates(); | 270 bool UseSynchronousGeometryUpdates(); |
| 270 #endif | 271 #endif |
| 271 | 272 |
| 272 base::WeakPtr<RenderView> render_view_; | 273 base::WeakPtr<RenderViewImpl> render_view_; |
| 273 webkit::npapi::WebPlugin* plugin_; | 274 webkit::npapi::WebPlugin* plugin_; |
| 274 bool uses_shared_bitmaps_; | 275 bool uses_shared_bitmaps_; |
| 275 gfx::PluginWindowHandle window_; | 276 gfx::PluginWindowHandle window_; |
| 276 scoped_refptr<PluginChannelHost> channel_host_; | 277 scoped_refptr<PluginChannelHost> channel_host_; |
| 277 std::string mime_type_; | 278 std::string mime_type_; |
| 278 int instance_id_; | 279 int instance_id_; |
| 279 webkit::WebPluginInfo info_; | 280 webkit::WebPluginInfo info_; |
| 280 | 281 |
| 281 gfx::Rect plugin_rect_; | 282 gfx::Rect plugin_rect_; |
| 282 gfx::Rect clip_rect_; | 283 gfx::Rect clip_rect_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 313 // back-buffer. | 314 // back-buffer. |
| 314 gfx::Rect front_buffer_diff_; | 315 gfx::Rect front_buffer_diff_; |
| 315 | 316 |
| 316 // The url of the main frame hosting the plugin. | 317 // The url of the main frame hosting the plugin. |
| 317 GURL page_url_; | 318 GURL page_url_; |
| 318 | 319 |
| 319 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); | 320 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); |
| 320 }; | 321 }; |
| 321 | 322 |
| 322 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 323 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| OLD | NEW |