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 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 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 int cursor_position); | 156 int cursor_position); |
157 | 157 |
158 // Informs the plugin that IME composition has completed./ If |text| is empty, | 158 // Informs the plugin that IME composition has completed./ If |text| is empty, |
159 // IME was cancelled. | 159 // IME was cancelled. |
160 void ImeCompositionCompleted(const string16& text); | 160 void ImeCompositionCompleted(const string16& text); |
161 | 161 |
162 // Returns the IME status retrieved from a plug-in. | 162 // Returns the IME status retrieved from a plug-in. |
163 bool GetIMEStatus(int* input_type, gfx::Rect* caret_rect); | 163 bool GetIMEStatus(int* input_type, gfx::Rect* caret_rect); |
164 #endif | 164 #endif |
165 | 165 |
166 #if defined(OS_MACOSX) | 166 #if defined(OS_MACOSX) && !defined(USE_AURA) |
167 // Informs the plugin that the geometry has changed, as with UpdateGeometry, | 167 // Informs the plugin that the geometry has changed, as with UpdateGeometry, |
168 // but also includes the new buffer context for that new geometry. | 168 // but also includes the new buffer context for that new geometry. |
169 void UpdateGeometryAndContext(const gfx::Rect& window_rect, | 169 void UpdateGeometryAndContext(const gfx::Rect& window_rect, |
170 const gfx::Rect& clip_rect, | 170 const gfx::Rect& clip_rect, |
171 gfx::NativeDrawingContext context); | 171 gfx::NativeDrawingContext context); |
172 // Informs the delegate that the plugin called NPN_Invalidate*. Used as a | 172 // Informs the delegate that the plugin called NPN_Invalidate*. Used as a |
173 // trigger for Core Animation drawing. | 173 // trigger for Core Animation drawing. |
174 void PluginDidInvalidate(); | 174 void PluginDidInvalidate(); |
175 // Returns the delegate currently processing events. | 175 // Returns the delegate currently processing events. |
176 static WebPluginDelegateImpl* GetActiveDelegate(); | 176 static WebPluginDelegateImpl* GetActiveDelegate(); |
(...skipping 27 matching lines...) Expand all Loading... |
204 // Indicates that it's time to send the plugin a null event. | 204 // Indicates that it's time to send the plugin a null event. |
205 void FireIdleEvent(); | 205 void FireIdleEvent(); |
206 #endif | 206 #endif |
207 | 207 |
208 // TODO(caryclark): This is a temporary workaround to allow the Darwin / Skia | 208 // TODO(caryclark): This is a temporary workaround to allow the Darwin / Skia |
209 // port to share code with the Darwin / CG port. Later, this will be removed | 209 // port to share code with the Darwin / CG port. Later, this will be removed |
210 // and all callers will use the Paint defined above. | 210 // and all callers will use the Paint defined above. |
211 void CGPaint(CGContextRef context, const gfx::Rect& rect); | 211 void CGPaint(CGContextRef context, const gfx::Rect& rect); |
212 | 212 |
213 bool AllowBufferFlipping(); | 213 bool AllowBufferFlipping(); |
214 #endif // OS_MACOSX | 214 #endif // OS_MACOSX && !USE_AURA |
215 | 215 |
216 gfx::PluginWindowHandle windowed_handle() const { | 216 gfx::PluginWindowHandle windowed_handle() const { |
217 return windowed_handle_; | 217 return windowed_handle_; |
218 } | 218 } |
219 | 219 |
220 #if defined(OS_MACOSX) | 220 #if defined(OS_MACOSX) |
221 // Allow setting a "fake" window handle to associate this plug-in with | 221 // Allow setting a "fake" window handle to associate this plug-in with |
222 // an IOSurface in the browser. Used for accelerated drawing surfaces. | 222 // an IOSurface in the browser. Used for accelerated drawing surfaces. |
223 void set_windowed_handle(gfx::PluginWindowHandle handle); | 223 void set_windowed_handle(gfx::PluginWindowHandle handle); |
224 #endif | 224 #endif |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 // GetProcAddress intercepter for windowless plugins. | 417 // GetProcAddress intercepter for windowless plugins. |
418 static FARPROC WINAPI GetProcAddressPatch(HMODULE module, LPCSTR name); | 418 static FARPROC WINAPI GetProcAddressPatch(HMODULE module, LPCSTR name); |
419 | 419 |
420 // The mouse hook proc which handles mouse capture in windowed plugins. | 420 // The mouse hook proc which handles mouse capture in windowed plugins. |
421 static LRESULT CALLBACK MouseHookProc(int code, WPARAM wParam, | 421 static LRESULT CALLBACK MouseHookProc(int code, WPARAM wParam, |
422 LPARAM lParam); | 422 LPARAM lParam); |
423 | 423 |
424 // Calls SetCapture/ReleaseCapture based on the message type. | 424 // Calls SetCapture/ReleaseCapture based on the message type. |
425 static void HandleCaptureForMessage(HWND window, UINT message); | 425 static void HandleCaptureForMessage(HWND window, UINT message); |
426 | 426 |
427 #elif defined(OS_MACOSX) | 427 #elif defined(OS_MACOSX) && !defined(USE_AURA) |
428 // Sets window_rect_ to |rect| | 428 // Sets window_rect_ to |rect| |
429 void SetPluginRect(const gfx::Rect& rect); | 429 void SetPluginRect(const gfx::Rect& rect); |
430 // Sets content_area_origin to |origin| | 430 // Sets content_area_origin to |origin| |
431 void SetContentAreaOrigin(const gfx::Point& origin); | 431 void SetContentAreaOrigin(const gfx::Point& origin); |
432 // Updates everything that depends on the plugin's absolute screen location. | 432 // Updates everything that depends on the plugin's absolute screen location. |
433 void PluginScreenLocationChanged(); | 433 void PluginScreenLocationChanged(); |
434 // Updates anything that depends on plugin visibility. | 434 // Updates anything that depends on plugin visibility. |
435 void PluginVisibilityChanged(); | 435 void PluginVisibilityChanged(); |
436 | 436 |
437 // Starts an IME session. | 437 // Starts an IME session. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 bool initial_window_focus_; | 486 bool initial_window_focus_; |
487 bool container_is_visible_; | 487 bool container_is_visible_; |
488 bool have_called_set_window_; | 488 bool have_called_set_window_; |
489 | 489 |
490 gfx::Rect cached_clip_rect_; | 490 gfx::Rect cached_clip_rect_; |
491 | 491 |
492 bool ime_enabled_; | 492 bool ime_enabled_; |
493 int keyup_ignore_count_; | 493 int keyup_ignore_count_; |
494 | 494 |
495 scoped_ptr<ExternalDragTracker> external_drag_tracker_; | 495 scoped_ptr<ExternalDragTracker> external_drag_tracker_; |
496 #endif // OS_MACOSX | 496 #endif // OS_MACOSX && !USE_AURA |
497 | 497 |
498 // Called by the message filter hook when the plugin enters a modal loop. | 498 // Called by the message filter hook when the plugin enters a modal loop. |
499 void OnModalLoopEntered(); | 499 void OnModalLoopEntered(); |
500 | 500 |
501 // Returns true if the message passed in corresponds to a user gesture. | 501 // Returns true if the message passed in corresponds to a user gesture. |
502 static bool IsUserGesture(const WebKit::WebInputEvent& event); | 502 static bool IsUserGesture(const WebKit::WebInputEvent& event); |
503 | 503 |
504 // The url with which the plugin was instantiated. | 504 // The url with which the plugin was instantiated. |
505 std::string plugin_url_; | 505 std::string plugin_url_; |
506 | 506 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // True if NPP_New did not return an error. | 551 // True if NPP_New did not return an error. |
552 bool creation_succeeded_; | 552 bool creation_succeeded_; |
553 | 553 |
554 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 554 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
555 }; | 555 }; |
556 | 556 |
557 } // namespace npapi | 557 } // namespace npapi |
558 } // namespace webkit | 558 } // namespace webkit |
559 | 559 |
560 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 560 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |