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