| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Informs the plugin that the window it is in has gained or lost focus. | 155 // Informs the plugin that the window it is in has gained or lost focus. |
| 156 void SetWindowHasFocus(bool has_focus); | 156 void SetWindowHasFocus(bool has_focus); |
| 157 // Returns whether or not the window the plugin is in has focus. | 157 // Returns whether or not the window the plugin is in has focus. |
| 158 bool GetWindowHasFocus() const { return containing_window_has_focus_; } | 158 bool GetWindowHasFocus() const { return containing_window_has_focus_; } |
| 159 // Informs the plugin that its tab or window has been hidden or shown. | 159 // Informs the plugin that its tab or window has been hidden or shown. |
| 160 void SetContainerVisibility(bool is_visible); | 160 void SetContainerVisibility(bool is_visible); |
| 161 // Informs the plugin that its containing window's frame has changed. | 161 // Informs the plugin that its containing window's frame has changed. |
| 162 // Frames are in screen coordinates. | 162 // Frames are in screen coordinates. |
| 163 void WindowFrameChanged(const gfx::Rect& window_frame, | 163 void WindowFrameChanged(const gfx::Rect& window_frame, |
| 164 const gfx::Rect& view_frame); | 164 const gfx::Rect& view_frame); |
| 165 // Informs the plugin that IME composition has been confirmed. | 165 // Informs the plugin that IME composition has completed. |
| 166 void ImeCompositionConfirmed(const string16& text); | 166 // If |text| is empty, IME was cancelled. |
| 167 void ImeCompositionCompleted(const string16& text); |
| 167 // Informs the delegate that the plugin set a Carbon ThemeCursor. | 168 // Informs the delegate that the plugin set a Carbon ThemeCursor. |
| 168 void SetThemeCursor(ThemeCursor cursor); | 169 void SetThemeCursor(ThemeCursor cursor); |
| 169 // Informs the delegate that the plugin set a Carbon Cursor. | 170 // Informs the delegate that the plugin set a Carbon Cursor. |
| 170 void SetCursor(const Cursor* cursor); | 171 void SetCursor(const Cursor* cursor); |
| 171 // Informs the delegate that the plugin set a Cocoa NSCursor. | 172 // Informs the delegate that the plugin set a Cocoa NSCursor. |
| 172 void SetNSCursor(NSCursor* cursor); | 173 void SetNSCursor(NSCursor* cursor); |
| 173 | 174 |
| 174 #ifndef NP_NO_CARBON | 175 #ifndef NP_NO_CARBON |
| 175 // Indicates that it's time to send the plugin a null event. | 176 // Indicates that it's time to send the plugin a null event. |
| 176 void FireIdleEvent(); | 177 void FireIdleEvent(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 #elif defined(OS_MACOSX) | 385 #elif defined(OS_MACOSX) |
| 385 // Sets window_rect_ to |rect| | 386 // Sets window_rect_ to |rect| |
| 386 void SetPluginRect(const gfx::Rect& rect); | 387 void SetPluginRect(const gfx::Rect& rect); |
| 387 // Sets content_area_origin to |origin| | 388 // Sets content_area_origin to |origin| |
| 388 void SetContentAreaOrigin(const gfx::Point& origin); | 389 void SetContentAreaOrigin(const gfx::Point& origin); |
| 389 // Updates everything that depends on the plugin's absolute screen location. | 390 // Updates everything that depends on the plugin's absolute screen location. |
| 390 void PluginScreenLocationChanged(); | 391 void PluginScreenLocationChanged(); |
| 391 // Updates anything that depends on plugin visibility. | 392 // Updates anything that depends on plugin visibility. |
| 392 void PluginVisibilityChanged(); | 393 void PluginVisibilityChanged(); |
| 393 | 394 |
| 394 // Enables/disables IME. | 395 // Starts an IME session. |
| 395 void SetImeEnabled(bool enabled); | 396 void StartIme(); |
| 396 | 397 |
| 397 // Informs the browser about the updated accelerated drawing surface. | 398 // Informs the browser about the updated accelerated drawing surface. |
| 398 void UpdateAcceleratedSurface(); | 399 void UpdateAcceleratedSurface(); |
| 399 | 400 |
| 400 // Uses a CARenderer to draw the plug-in's layer in our OpenGL surface. | 401 // Uses a CARenderer to draw the plug-in's layer in our OpenGL surface. |
| 401 void DrawLayerInSurface(); | 402 void DrawLayerInSurface(); |
| 402 | 403 |
| 404 // Returns true if plugin IME is supported. |
| 405 bool IsImeSupported(); |
| 406 |
| 403 #ifndef NP_NO_CARBON | 407 #ifndef NP_NO_CARBON |
| 404 // Moves our dummy window to match the current screen location of the plugin. | 408 // Moves our dummy window to match the current screen location of the plugin. |
| 405 void UpdateDummyWindowBounds(const gfx::Point& plugin_origin); | 409 void UpdateDummyWindowBounds(const gfx::Point& plugin_origin); |
| 406 | 410 |
| 407 #ifndef NP_NO_QUICKDRAW | 411 #ifndef NP_NO_QUICKDRAW |
| 408 // Sets the mode used for QuickDraw plugin drawing. If enabled is true the | 412 // Sets the mode used for QuickDraw plugin drawing. If enabled is true the |
| 409 // plugin draws into a GWorld that's not connected to a window (the faster | 413 // plugin draws into a GWorld that's not connected to a window (the faster |
| 410 // path), otherwise the plugin draws into our invisible dummy window (which is | 414 // path), otherwise the plugin draws into our invisible dummy window (which is |
| 411 // slower, since the call we use to scrape the window contents is much more | 415 // slower, since the call we use to scrape the window contents is much more |
| 412 // expensive than copying between GWorlds). | 416 // expensive than copying between GWorlds). |
| (...skipping 26 matching lines...) Expand all Loading... |
| 439 gfx::Point content_area_origin_; | 443 gfx::Point content_area_origin_; |
| 440 | 444 |
| 441 bool containing_window_has_focus_; | 445 bool containing_window_has_focus_; |
| 442 bool initial_window_focus_; | 446 bool initial_window_focus_; |
| 443 bool container_is_visible_; | 447 bool container_is_visible_; |
| 444 bool have_called_set_window_; | 448 bool have_called_set_window_; |
| 445 | 449 |
| 446 gfx::Rect cached_clip_rect_; | 450 gfx::Rect cached_clip_rect_; |
| 447 | 451 |
| 448 bool ime_enabled_; | 452 bool ime_enabled_; |
| 453 int keyup_ignore_count_; |
| 449 | 454 |
| 450 scoped_ptr<ExternalDragTracker> external_drag_tracker_; | 455 scoped_ptr<ExternalDragTracker> external_drag_tracker_; |
| 451 #endif // OS_MACOSX | 456 #endif // OS_MACOSX |
| 452 | 457 |
| 453 // Called by the message filter hook when the plugin enters a modal loop. | 458 // Called by the message filter hook when the plugin enters a modal loop. |
| 454 void OnModalLoopEntered(); | 459 void OnModalLoopEntered(); |
| 455 | 460 |
| 456 // Returns true if the message passed in corresponds to a user gesture. | 461 // Returns true if the message passed in corresponds to a user gesture. |
| 457 static bool IsUserGesture(const WebKit::WebInputEvent& event); | 462 static bool IsUserGesture(const WebKit::WebInputEvent& event); |
| 458 | 463 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 // True if NPP_New did not return an error. | 511 // True if NPP_New did not return an error. |
| 507 bool creation_succeeded_; | 512 bool creation_succeeded_; |
| 508 | 513 |
| 509 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 514 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
| 510 }; | 515 }; |
| 511 | 516 |
| 512 } // namespace npapi | 517 } // namespace npapi |
| 513 } // namespace webkit | 518 } // namespace webkit |
| 514 | 519 |
| 515 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 520 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |