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 WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/sequenced_task_runner_helpers.h" | 14 #include "base/sequenced_task_runner_helpers.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "third_party/npapi/bindings/npapi.h" | 17 #include "third_party/npapi/bindings/npapi.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 "webkit/glue/webcursor.h" | 20 #include "webkit/glue/webcursor.h" |
21 #include "webkit/plugins/npapi/webplugin_delegate.h" | 21 #include "webkit/plugins/npapi/webplugin_delegate.h" |
22 #include "webkit/plugins/webkit_plugins_export.h" | 22 #include "webkit/plugins/webkit_plugins_export.h" |
23 | 23 |
24 #if defined(USE_X11) | 24 #if defined(USE_X11) |
25 #include "ui/base/x/x11_util.h" | 25 #include "ui/base/x/x11_util.h" |
26 | 26 |
27 typedef struct _GdkDrawable GdkPixmap; | 27 typedef struct _GdkDrawable GdkPixmap; |
28 #endif | 28 #endif |
29 | 29 |
| 30 namespace base { |
30 class FilePath; | 31 class FilePath; |
| 32 } |
31 | 33 |
32 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
33 #ifdef __OBJC__ | 35 #ifdef __OBJC__ |
34 @class CALayer; | 36 @class CALayer; |
35 @class CARenderer; | 37 @class CARenderer; |
36 #else | 38 #else |
37 class CALayer; | 39 class CALayer; |
38 class CARenderer; | 40 class CARenderer; |
39 #endif | 41 #endif |
40 #endif | 42 #endif |
(...skipping 29 matching lines...) Expand all Loading... |
70 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux | 72 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux |
71 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows | 73 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows |
72 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows | 74 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows |
73 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows | 75 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows |
74 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows | 76 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows |
75 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux | 77 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux |
76 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. | 78 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. |
77 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. | 79 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. |
78 }; | 80 }; |
79 | 81 |
80 static WebPluginDelegateImpl* Create(const FilePath& filename, | 82 static WebPluginDelegateImpl* Create(const base::FilePath& filename, |
81 const std::string& mime_type); | 83 const std::string& mime_type); |
82 | 84 |
83 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
84 static bool IsPluginDelegateWindow(HWND window); | 86 static bool IsPluginDelegateWindow(HWND window); |
85 static bool GetPluginNameFromWindow(HWND window, | 87 static bool GetPluginNameFromWindow(HWND window, |
86 string16* plugin_name); | 88 string16* plugin_name); |
87 static bool GetPluginVersionFromWindow(HWND window, | 89 static bool GetPluginVersionFromWindow(HWND window, |
88 string16* plugin_version); | 90 string16* plugin_version); |
89 | 91 |
90 // Returns true if the window handle passed in is that of the dummy | 92 // Returns true if the window handle passed in is that of the dummy |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE; | 133 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE; |
132 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 134 virtual WebPluginResourceClient* CreateSeekableResourceClient( |
133 unsigned long resource_id, int range_request_id) OVERRIDE; | 135 unsigned long resource_id, int range_request_id) OVERRIDE; |
134 // End of WebPluginDelegate implementation. | 136 // End of WebPluginDelegate implementation. |
135 | 137 |
136 bool IsWindowless() const { return windowless_ ; } | 138 bool IsWindowless() const { return windowless_ ; } |
137 gfx::Rect GetRect() const { return window_rect_; } | 139 gfx::Rect GetRect() const { return window_rect_; } |
138 gfx::Rect GetClipRect() const { return clip_rect_; } | 140 gfx::Rect GetClipRect() const { return clip_rect_; } |
139 | 141 |
140 // Returns the path for the library implementing this plugin. | 142 // Returns the path for the library implementing this plugin. |
141 FilePath GetPluginPath(); | 143 base::FilePath GetPluginPath(); |
142 | 144 |
143 // Returns a combination of PluginQuirks. | 145 // Returns a combination of PluginQuirks. |
144 int GetQuirks() const { return quirks_; } | 146 int GetQuirks() const { return quirks_; } |
145 | 147 |
146 // Informs the plugin that the view it is in has gained or lost focus. | 148 // Informs the plugin that the view it is in has gained or lost focus. |
147 void SetContentAreaHasFocus(bool has_focus); | 149 void SetContentAreaHasFocus(bool has_focus); |
148 | 150 |
149 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
150 // Informs the plug-in that an IME has changed its status. | 152 // Informs the plug-in that an IME has changed its status. |
151 void ImeCompositionUpdated(const string16& text, | 153 void ImeCompositionUpdated(const string16& text, |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // True if NPP_New did not return an error. | 508 // True if NPP_New did not return an error. |
507 bool creation_succeeded_; | 509 bool creation_succeeded_; |
508 | 510 |
509 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 511 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
510 }; | 512 }; |
511 | 513 |
512 } // namespace npapi | 514 } // namespace npapi |
513 } // namespace webkit | 515 } // namespace webkit |
514 | 516 |
515 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 517 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |