OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ | 5 #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ |
6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ | 6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <list> | 9 #include <list> |
10 | 10 |
| 11 #include "base/gfx/native_widget_types.h" |
11 #include "base/iat_patch.h" | 12 #include "base/iat_patch.h" |
12 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
13 #include "base/task.h" | 14 #include "base/task.h" |
14 #include "webkit/glue/webplugin_delegate.h" | 15 #include "webkit/glue/webplugin_delegate.h" |
15 #include "third_party/npapi/bindings/npapi.h" | 16 #include "third_party/npapi/bindings/npapi.h" |
16 #include "webkit/glue/webcursor.h" | 17 #include "webkit/glue/webcursor.h" |
17 | 18 |
18 namespace NPAPI { | 19 namespace NPAPI { |
19 class PluginInstance; | 20 class PluginInstance; |
20 }; | 21 }; |
21 | 22 |
22 // An implementation of WebPluginDelegate that proxies all calls to | 23 // An implementation of WebPluginDelegate that proxies all calls to |
23 // the plugin process. | 24 // the plugin process. |
24 class WebPluginDelegateImpl : public WebPluginDelegate { | 25 class WebPluginDelegateImpl : public WebPluginDelegate { |
25 public: | 26 public: |
26 static WebPluginDelegateImpl* Create(const std::wstring& filename, | 27 static WebPluginDelegateImpl* Create(const std::wstring& filename, |
27 const std::string& mime_type, | 28 const std::string& mime_type, |
28 HWND containing_window); | 29 gfx::NativeView containing_view); |
29 static bool IsPluginDelegateWindow(HWND window); | 30 static bool IsPluginDelegateWindow(HWND window); |
30 static bool GetPluginNameFromWindow(HWND window, std::wstring *plugin_name); | 31 static bool GetPluginNameFromWindow(HWND window, std::wstring *plugin_name); |
31 | 32 |
32 // Returns true if the window handle passed in is that of the dummy | 33 // Returns true if the window handle passed in is that of the dummy |
33 // activation window for windowless plugins. | 34 // activation window for windowless plugins. |
34 static bool IsDummyActivationWindow(HWND window); | 35 static bool IsDummyActivationWindow(HWND window); |
35 | 36 |
36 // WebPluginDelegate implementation | 37 // WebPluginDelegate implementation |
37 virtual void PluginDestroyed(); | 38 virtual void PluginDestroyed(); |
38 virtual bool Initialize(const GURL& url, | 39 virtual bool Initialize(const GURL& url, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 int quirks() { return quirks_; } | 97 int quirks() { return quirks_; } |
97 | 98 |
98 static void MoveWindow(HWND window, | 99 static void MoveWindow(HWND window, |
99 const gfx::Rect& window_rect, | 100 const gfx::Rect& window_rect, |
100 const gfx::Rect& clip_rect, | 101 const gfx::Rect& clip_rect, |
101 const std::vector<gfx::Rect>& cutout_rects, | 102 const std::vector<gfx::Rect>& cutout_rects, |
102 bool visible); | 103 bool visible); |
103 | 104 |
104 private: | 105 private: |
105 WebPluginDelegateImpl(HWND containing_window, | 106 WebPluginDelegateImpl(gfx::NativeView containing_view, |
106 NPAPI::PluginInstance *instance); | 107 NPAPI::PluginInstance *instance); |
107 ~WebPluginDelegateImpl(); | 108 ~WebPluginDelegateImpl(); |
108 | 109 |
109 //-------------------------- | 110 //-------------------------- |
110 // used for windowed plugins | 111 // used for windowed plugins |
111 void WindowedUpdateGeometry(const gfx::Rect& window_rect, | 112 void WindowedUpdateGeometry(const gfx::Rect& window_rect, |
112 const gfx::Rect& clip_rect, | 113 const gfx::Rect& clip_rect, |
113 const std::vector<gfx::Rect>& cutout_rects, | 114 const std::vector<gfx::Rect>& cutout_rects, |
114 bool visible); | 115 bool visible); |
115 // Create the native window. | 116 // Create the native window. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // TrackPopupMenu. | 273 // TrackPopupMenu. |
273 static BOOL WINAPI TrackPopupMenuPatch(HMENU menu, unsigned int flags, int x, | 274 static BOOL WINAPI TrackPopupMenuPatch(HMENU menu, unsigned int flags, int x, |
274 int y, int reserved, HWND window, | 275 int y, int reserved, HWND window, |
275 const RECT* rect); | 276 const RECT* rect); |
276 | 277 |
277 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); | 278 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); |
278 }; | 279 }; |
279 | 280 |
280 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ | 281 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ |
281 | 282 |
OLD | NEW |