| 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_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ | 6 #define WEBKIT_GLUE_PLUGINS_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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // Informs the plugin that the window it is in has gained or lost focus. | 154 // Informs the plugin that the window it is in has gained or lost focus. |
| 155 void SetWindowHasFocus(bool has_focus); | 155 void SetWindowHasFocus(bool has_focus); |
| 156 // Returns whether or not the window the plugin is in has focus. | 156 // Returns whether or not the window the plugin is in has focus. |
| 157 bool GetWindowHasFocus() const { return containing_window_has_focus_; } | 157 bool GetWindowHasFocus() const { return containing_window_has_focus_; } |
| 158 // Informs the plugin that its tab or window has been hidden or shown. | 158 // Informs the plugin that its tab or window has been hidden or shown. |
| 159 void SetContainerVisibility(bool is_visible); | 159 void SetContainerVisibility(bool is_visible); |
| 160 // Informs the plugin that its containing window's frame has changed. | 160 // Informs the plugin that its containing window's frame has changed. |
| 161 // Frames are in screen coordinates. | 161 // Frames are in screen coordinates. |
| 162 void WindowFrameChanged(const gfx::Rect& window_frame, | 162 void WindowFrameChanged(const gfx::Rect& window_frame, |
| 163 const gfx::Rect& view_frame); | 163 const gfx::Rect& view_frame); |
| 164 // Informs the plugin that IME composition has been confirmed. |
| 165 void ImeCompositionConfirmed(const string16& text); |
| 164 // Informs the delegate that the plugin set a Carbon ThemeCursor. | 166 // Informs the delegate that the plugin set a Carbon ThemeCursor. |
| 165 void SetThemeCursor(ThemeCursor cursor); | 167 void SetThemeCursor(ThemeCursor cursor); |
| 166 // Informs the delegate that the plugin set a Carbon Cursor. | 168 // Informs the delegate that the plugin set a Carbon Cursor. |
| 167 void SetCursor(const Cursor* cursor); | 169 void SetCursor(const Cursor* cursor); |
| 168 // Informs the delegate that the plugin set a Cocoa NSCursor. | 170 // Informs the delegate that the plugin set a Cocoa NSCursor. |
| 169 void SetNSCursor(NSCursor* cursor); | 171 void SetNSCursor(NSCursor* cursor); |
| 170 | 172 |
| 171 #ifndef NP_NO_CARBON | 173 #ifndef NP_NO_CARBON |
| 172 // Indicates that it's time to send the plugin a null event. | 174 // Indicates that it's time to send the plugin a null event. |
| 173 void FireIdleEvent(); | 175 void FireIdleEvent(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // Calls SetCapture/ReleaseCapture based on the message type. | 380 // Calls SetCapture/ReleaseCapture based on the message type. |
| 379 static void HandleCaptureForMessage(HWND window, UINT message); | 381 static void HandleCaptureForMessage(HWND window, UINT message); |
| 380 | 382 |
| 381 #elif defined(OS_MACOSX) | 383 #elif defined(OS_MACOSX) |
| 382 // Sets window_rect_ to |rect| | 384 // Sets window_rect_ to |rect| |
| 383 void SetPluginRect(const gfx::Rect& rect); | 385 void SetPluginRect(const gfx::Rect& rect); |
| 384 // Sets content_area_origin to |origin| | 386 // Sets content_area_origin to |origin| |
| 385 void SetContentAreaOrigin(const gfx::Point& origin); | 387 void SetContentAreaOrigin(const gfx::Point& origin); |
| 386 // Updates everything that depends on the plugin's absolute screen location. | 388 // Updates everything that depends on the plugin's absolute screen location. |
| 387 void PluginScreenLocationChanged(); | 389 void PluginScreenLocationChanged(); |
| 390 // Updates anything that depends on plugin visibility. |
| 391 void PluginVisibilityChanged(); |
| 388 | 392 |
| 389 // Returns the apparent zoom ratio for the given event, as inferred from our | 393 // Enables/disables IME. |
| 390 // current knowledge about about where on screen the plugin is. | 394 void SetImeEnabled(bool enabled); |
| 391 // This is a temporary workaround for <http://crbug.com/9996>; once that is | |
| 392 // fixed we should have correct event coordinates (or an explicit | |
| 393 // notification of zoom level). | |
| 394 float ApparentEventZoomLevel(const WebKit::WebMouseEvent& event); | |
| 395 | 395 |
| 396 // Informs the browser about the updated accelerated drawing surface. | 396 // Informs the browser about the updated accelerated drawing surface. |
| 397 void UpdateAcceleratedSurface(); | 397 void UpdateAcceleratedSurface(); |
| 398 | 398 |
| 399 // Updates anything that depends on plugin visibility. | |
| 400 void PluginVisibilityChanged(); | |
| 401 | |
| 402 // Uses a CARenderer to draw the plug-in's layer in our OpenGL surface. | 399 // Uses a CARenderer to draw the plug-in's layer in our OpenGL surface. |
| 403 void DrawLayerInSurface(); | 400 void DrawLayerInSurface(); |
| 404 | 401 |
| 405 #ifndef NP_NO_CARBON | 402 #ifndef NP_NO_CARBON |
| 406 // Moves our dummy window to match the current screen location of the plugin. | 403 // Moves our dummy window to match the current screen location of the plugin. |
| 407 void UpdateDummyWindowBounds(const gfx::Point& plugin_origin); | 404 void UpdateDummyWindowBounds(const gfx::Point& plugin_origin); |
| 408 | 405 |
| 409 #ifndef NP_NO_QUICKDRAW | 406 #ifndef NP_NO_QUICKDRAW |
| 410 // Sets the mode used for QuickDraw plugin drawing. If enabled is true the | 407 // Sets the mode used for QuickDraw plugin drawing. If enabled is true the |
| 411 // plugin draws into a GWorld that's not connected to a window (the faster | 408 // plugin draws into a GWorld that's not connected to a window (the faster |
| (...skipping 28 matching lines...) Expand all Loading... |
| 440 // relative to an upper-left (0,0). | 437 // relative to an upper-left (0,0). |
| 441 gfx::Point content_area_origin_; | 438 gfx::Point content_area_origin_; |
| 442 | 439 |
| 443 bool containing_window_has_focus_; | 440 bool containing_window_has_focus_; |
| 444 bool initial_window_focus_; | 441 bool initial_window_focus_; |
| 445 bool container_is_visible_; | 442 bool container_is_visible_; |
| 446 bool have_called_set_window_; | 443 bool have_called_set_window_; |
| 447 | 444 |
| 448 gfx::Rect cached_clip_rect_; | 445 gfx::Rect cached_clip_rect_; |
| 449 | 446 |
| 447 bool ime_enabled_; |
| 448 |
| 450 scoped_ptr<ExternalDragTracker> external_drag_tracker_; | 449 scoped_ptr<ExternalDragTracker> external_drag_tracker_; |
| 451 #endif // OS_MACOSX | 450 #endif // OS_MACOSX |
| 452 | 451 |
| 453 // Called by the message filter hook when the plugin enters a modal loop. | 452 // Called by the message filter hook when the plugin enters a modal loop. |
| 454 void OnModalLoopEntered(); | 453 void OnModalLoopEntered(); |
| 455 | 454 |
| 456 // Returns true if the message passed in corresponds to a user gesture. | 455 // Returns true if the message passed in corresponds to a user gesture. |
| 457 static bool IsUserGesture(const WebKit::WebInputEvent& event); | 456 static bool IsUserGesture(const WebKit::WebInputEvent& event); |
| 458 | 457 |
| 459 // The url with which the plugin was instantiated. | 458 // The url with which the plugin was instantiated. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 // True if the containing view currently has focus. | 499 // True if the containing view currently has focus. |
| 501 // Initially set to true so that plugin focus still works in environments | 500 // Initially set to true so that plugin focus still works in environments |
| 502 // where SetContentAreaHasFocus is never called. See | 501 // where SetContentAreaHasFocus is never called. See |
| 503 // https://bugs.webkit.org/show_bug.cgi?id=46013 for details. | 502 // https://bugs.webkit.org/show_bug.cgi?id=46013 for details. |
| 504 bool containing_view_has_focus_; | 503 bool containing_view_has_focus_; |
| 505 | 504 |
| 506 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 505 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
| 507 }; | 506 }; |
| 508 | 507 |
| 509 #endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ | 508 #endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |