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 "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 char** argv, | 46 char** argv, |
47 int argc, | 47 int argc, |
48 WebPlugin* plugin, | 48 WebPlugin* plugin, |
49 bool load_manually); | 49 bool load_manually); |
50 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 50 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
51 const gfx::Rect& clip_rect); | 51 const gfx::Rect& clip_rect); |
52 virtual void Paint(gfx::NativeDrawingContext context, const gfx::Rect& rect); | 52 virtual void Paint(gfx::NativeDrawingContext context, const gfx::Rect& rect); |
53 virtual void Print(gfx::NativeDrawingContext context); | 53 virtual void Print(gfx::NativeDrawingContext context); |
54 | 54 |
55 virtual void SetFocus(); // only called when windowless | 55 virtual void SetFocus(); // only called when windowless |
56 // only called when windowless | 56 // only called when windowless |
57 virtual bool HandleEvent(NPEvent* event, | 57 // See NPAPI NPP_HandleEvent for more information. |
58 WebCursor* cursor); | 58 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, |
| 59 WebCursor* cursor); |
59 virtual NPObject* GetPluginScriptableObject(); | 60 virtual NPObject* GetPluginScriptableObject(); |
60 virtual void DidFinishLoadWithReason(NPReason reason); | 61 virtual void DidFinishLoadWithReason(NPReason reason); |
61 virtual int GetProcessId(); | 62 virtual int GetProcessId(); |
62 | 63 |
63 virtual void FlushGeometryUpdates() { | 64 virtual void FlushGeometryUpdates() { |
64 } | 65 } |
65 virtual void SendJavaScriptStream(const std::string& url, | 66 virtual void SendJavaScriptStream(const std::string& url, |
66 const std::wstring& result, | 67 const std::wstring& result, |
67 bool success, bool notify_needed, | 68 bool success, bool notify_needed, |
68 intptr_t notify_data); | 69 intptr_t notify_data); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 //---------------------------- | 140 //---------------------------- |
140 // used for windowless plugins | 141 // used for windowless plugins |
141 void WindowlessUpdateGeometry(const gfx::Rect& window_rect, | 142 void WindowlessUpdateGeometry(const gfx::Rect& window_rect, |
142 const gfx::Rect& clip_rect); | 143 const gfx::Rect& clip_rect); |
143 void WindowlessPaint(gfx::NativeDrawingContext hdc, const gfx::Rect& rect); | 144 void WindowlessPaint(gfx::NativeDrawingContext hdc, const gfx::Rect& rect); |
144 | 145 |
145 // Tells the plugin about the current state of the window. | 146 // Tells the plugin about the current state of the window. |
146 // See NPAPI NPP_SetWindow for more information. | 147 // See NPAPI NPP_SetWindow for more information. |
147 void WindowlessSetWindow(bool force_set_window); | 148 void WindowlessSetWindow(bool force_set_window); |
148 | 149 |
149 | |
150 //----------------------------------------- | 150 //----------------------------------------- |
151 // used for windowed and windowless plugins | 151 // used for windowed and windowless plugins |
152 | 152 |
153 NPAPI::PluginInstance* instance() { return instance_.get(); } | 153 NPAPI::PluginInstance* instance() { return instance_.get(); } |
154 | 154 |
155 // Closes down and destroys our plugin instance. | 155 // Closes down and destroys our plugin instance. |
156 void DestroyInstance(); | 156 void DestroyInstance(); |
157 | 157 |
158 // used for windowed plugins | 158 // used for windowed plugins |
159 gfx::NativeView windowed_handle_; | 159 gfx::NativeView windowed_handle_; |
(...skipping 19 matching lines...) Expand all Loading... |
179 WNDPROC plugin_wnd_proc_; | 179 WNDPROC plugin_wnd_proc_; |
180 | 180 |
181 // Used to throttle WM_USER+1 messages in Flash. | 181 // Used to throttle WM_USER+1 messages in Flash. |
182 uint32 last_message_; | 182 uint32 last_message_; |
183 bool is_calling_wndproc; | 183 bool is_calling_wndproc; |
184 #endif // OS_WIN | 184 #endif // OS_WIN |
185 | 185 |
186 #if defined(OS_LINUX) | 186 #if defined(OS_LINUX) |
187 // The pixmap we're drawing into, for a windowless plugin. | 187 // The pixmap we're drawing into, for a windowless plugin. |
188 GdkPixmap* pixmap_; | 188 GdkPixmap* pixmap_; |
| 189 double first_event_time_; |
189 | 190 |
190 // Ensure pixmap_ exists and is at least width by height pixels. | 191 // Ensure pixmap_ exists and is at least width by height pixels. |
191 void EnsurePixmapAtLeastSize(int width, int height); | 192 void EnsurePixmapAtLeastSize(int width, int height); |
192 #endif | 193 #endif |
193 | 194 |
194 gfx::NativeView parent_; | 195 gfx::NativeView parent_; |
195 NPWindow window_; | 196 NPWindow window_; |
196 #if defined(OS_MACOSX) | 197 #if defined(OS_MACOSX) |
197 NP_CGContext cg_context_; | 198 NP_CGContext cg_context_; |
198 #endif | 199 #endif |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 274 |
274 // Holds the current cursor set by the windowless plugin. | 275 // Holds the current cursor set by the windowless plugin. |
275 WebCursor current_windowless_cursor_; | 276 WebCursor current_windowless_cursor_; |
276 | 277 |
277 friend class WebPluginDelegate; | 278 friend class WebPluginDelegate; |
278 | 279 |
279 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); | 280 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); |
280 }; | 281 }; |
281 | 282 |
282 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 283 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |