diff options
author | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-01 19:41:56 +0000 |
---|---|---|
committer | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-01 19:41:56 +0000 |
commit | 1d5ac66b45c8e625fb4ec382d4e38e5357fdb257 (patch) | |
tree | b98aaaafe5243bcd63d0db902d6c8bf1e415dec9 /chrome/browser/plugin_carbon_interpose_mac.cc | |
parent | 4c98db35cdd001ce1585bc703375c92ec3ebea9b (diff) | |
download | chromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.zip chromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.tar.gz chromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.tar.bz2 |
Fix several issues around fullscreen Mac plugins:
* Keystrokes are now properly sent to plugins in fullscreen mode
* When a plugin creates a fullscreen window, we hide the menu bar and restore it when the window is closed
BUG=19534,21020
TEST=Open a page with plugins that can go full screen (example: flash video players). Enter full screen mode and verify that esc, arrow keys, spacebar, etc. work as expected. Verify that the menu bar is hidden when the plugin goes fullscreen and is restored when it exits fullscreen mode.
Review URL: http://codereview.chromium.org/257008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_carbon_interpose_mac.cc')
-rw-r--r-- | chrome/browser/plugin_carbon_interpose_mac.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc index 315cdfa..0443476 100644 --- a/chrome/browser/plugin_carbon_interpose_mac.cc +++ b/chrome/browser/plugin_carbon_interpose_mac.cc @@ -4,8 +4,18 @@ #include <Carbon/Carbon.h> +#include "base/gfx/rect.h" #include "webkit/glue/plugins/fake_plugin_window_tracker_mac.h" +namespace webkit_glue { + +void NotifyBrowserOfPluginSelectWindow(uint32 window_id, CGRect bounds); +void NotifyBrowserOfPluginShowWindow(uint32 window_id, CGRect bounds); +void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds); +void NotifyBrowserOfPluginDisposeWindow(uint32 window_id, CGRect bounds); + +} + // The process that was frontmost when a plugin created a new window; generally // we expect this to be the browser UI process. static ProcessSerialNumber g_saved_front_process = { 0, 0 }; @@ -64,23 +74,38 @@ static Boolean ChromePluginIsWindowHilited(WindowRef window) { return isHilited; } +static CGRect CGRectForWindow(WindowRef window) { + CGRect bounds = { { 0, 0 }, { 0, 0 } }; + HIWindowGetBounds(window, kWindowContentRgn, kHICoordSpace72DPIGlobal, + &bounds); + return bounds; +} + static void ChromePluginSelectWindow(WindowRef window) { SwitchToPluginProcess(); SelectWindow(window); + webkit_glue::NotifyBrowserOfPluginSelectWindow(HIWindowGetCGWindowID(window), + CGRectForWindow(window)); } static void ChromePluginShowWindow(WindowRef window) { SwitchToPluginProcess(); ShowWindow(window); + webkit_glue::NotifyBrowserOfPluginShowWindow(HIWindowGetCGWindowID(window), + CGRectForWindow(window)); } static void ChromePluginDisposeWindow(WindowRef window) { SwitchToSavedProcess(); + webkit_glue::NotifyBrowserOfPluginDisposeWindow(HIWindowGetCGWindowID(window), + CGRectForWindow(window)); DisposeWindow(window); } static void ChromePluginHideWindow(WindowRef window) { SwitchToSavedProcess(); + webkit_glue::NotifyBrowserOfPluginHideWindow(HIWindowGetCGWindowID(window), + CGRectForWindow(window)); HideWindow(window); } |