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_process_host_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_process_host_mac.cc')
-rw-r--r-- | chrome/browser/plugin_process_host_mac.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/browser/plugin_process_host_mac.cc b/chrome/browser/plugin_process_host_mac.cc new file mode 100644 index 0000000..d222880 --- /dev/null +++ b/chrome/browser/plugin_process_host_mac.cc @@ -0,0 +1,43 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <Carbon/Carbon.h> + +#include "build/build_config.h" + +#include <vector> + +#include "base/logging.h" +#include "chrome/browser/plugin_process_host.h" + +void PluginProcessHost::OnPluginSelectWindow(uint32 window_id, + gfx::Rect window_rect) { + plugin_visible_windows_set_.insert(window_id); +} + +void PluginProcessHost::OnPluginShowWindow(uint32 window_id, + gfx::Rect window_rect) { + plugin_visible_windows_set_.insert(window_id); + CGRect window_bounds = { + { window_rect.x(), window_rect.y() }, + { window_rect.width(), window_rect.height() } + }; + CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); + if (CGRectEqualToRect(window_bounds, main_display_bounds)) { + // If the plugin has just shown a window that's the same dimensions as + // the main display, hide the menubar so that it has the whole screen. + SetSystemUIMode(kUIModeAllSuppressed, kUIOptionAutoShowMenuBar); + } +} + +void PluginProcessHost::OnPluginHideWindow(uint32 window_id, + gfx::Rect window_rect) { + plugin_visible_windows_set_.erase(window_id); + SetSystemUIMode(kUIModeNormal, 0); +} + +void PluginProcessHost::OnPluginDisposeWindow(uint32 window_id, + gfx::Rect window_rect) { + plugin_visible_windows_set_.erase(window_id); +} |