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_WEBPLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ |
6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ | 6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/gfx/native_widget_types.h" | 11 #include "base/gfx/native_widget_types.h" |
12 #include "third_party/npapi/bindings/npapi.h" | 12 #include "third_party/npapi/bindings/npapi.h" |
13 | 13 |
14 // TODO(port): put in OS_WIN check. | 14 // TODO(port): put in OS_WIN check. |
15 typedef struct HDC__* HDC; | 15 typedef struct HDC__* HDC; |
16 struct NPObject; | 16 struct NPObject; |
17 | 17 |
18 class FilePath; | 18 class FilePath; |
19 class GURL; | 19 class GURL; |
20 class WebCursor; | 20 class WebCursor; |
21 class WebPlugin; | 21 class WebPlugin; |
22 class WebPluginResourceClient; | 22 class WebPluginResourceClient; |
23 | 23 |
| 24 namespace WebKit { |
| 25 class WebInputEvent; |
| 26 } |
| 27 |
24 namespace gfx { | 28 namespace gfx { |
25 class Rect; | 29 class Rect; |
26 } | 30 } |
27 | 31 |
28 // This is the interface that a plugin implementation needs to provide. | 32 // This is the interface that a plugin implementation needs to provide. |
29 class WebPluginDelegate { | 33 class WebPluginDelegate { |
30 public: | 34 public: |
31 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
32 enum PluginQuirks { | 36 enum PluginQuirks { |
33 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, | 37 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const gfx::Rect& rect) = 0; | 84 const gfx::Rect& rect) = 0; |
81 | 85 |
82 // Tells the plugin to print itself. | 86 // Tells the plugin to print itself. |
83 virtual void Print(gfx::NativeDrawingContext hdc) = 0; | 87 virtual void Print(gfx::NativeDrawingContext hdc) = 0; |
84 | 88 |
85 // Informs the plugin that it now has focus. | 89 // Informs the plugin that it now has focus. |
86 virtual void SetFocus() = 0; | 90 virtual void SetFocus() = 0; |
87 | 91 |
88 // For windowless plugins, gives them a user event like mouse/keyboard. | 92 // For windowless plugins, gives them a user event like mouse/keyboard. |
89 // Returns whether the event was handled. | 93 // Returns whether the event was handled. |
90 virtual bool HandleEvent(NPEvent* event, WebCursor* cursor) = 0; | 94 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, |
| 95 WebCursor* cursor) = 0; |
91 | 96 |
92 // Gets the NPObject associated with the plugin for scripting. | 97 // Gets the NPObject associated with the plugin for scripting. |
93 virtual NPObject* GetPluginScriptableObject() = 0; | 98 virtual NPObject* GetPluginScriptableObject() = 0; |
94 | 99 |
95 // Receives notification about a resource load that the plugin initiated | 100 // Receives notification about a resource load that the plugin initiated |
96 // for a frame. | 101 // for a frame. |
97 virtual void DidFinishLoadWithReason(NPReason reason) = 0; | 102 virtual void DidFinishLoadWithReason(NPReason reason) = 0; |
98 | 103 |
99 // Returns the process id of the process that is running the plugin. | 104 // Returns the process id of the process that is running the plugin. |
100 virtual int GetProcessId() = 0; | 105 virtual int GetProcessId() = 0; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #if defined(OS_WIN) | 154 #if defined(OS_WIN) |
150 // Returns a combinaison of PluginQuirks. | 155 // Returns a combinaison of PluginQuirks. |
151 virtual int GetQuirks() const; | 156 virtual int GetQuirks() const; |
152 #endif | 157 #endif |
153 | 158 |
154 private: | 159 private: |
155 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegate); | 160 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegate); |
156 }; | 161 }; |
157 | 162 |
158 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ | 163 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ |
OLD | NEW |