diff options
author | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-11 19:02:15 +0000 |
---|---|---|
committer | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-11 19:02:15 +0000 |
commit | b44dbd15aeb4dbe7a5be36f7f5c55e6cddf0bac9 (patch) | |
tree | 128c569144246a05d04d8f2e4b451de6706df7d8 /chrome/browser/plugin_process_host.cc | |
parent | 77ea4960c1d0d70ce9edb0eb8b00c5f32939fb2f (diff) | |
download | chromium_src-b44dbd15aeb4dbe7a5be36f7f5c55e6cddf0bac9.zip chromium_src-b44dbd15aeb4dbe7a5be36f7f5c55e6cddf0bac9.tar.gz chromium_src-b44dbd15aeb4dbe7a5be36f7f5c55e6cddf0bac9.tar.bz2 |
Change Mac fullscreen mode to be a stack, not a flag. This fixes crashes and
misbehavior of fullscreen browser windows and plugins, especially when they
interact.
BUG=23571,24216
TEST=open up multiple browser windows, make them fullscreen, and go to pages
(such as video players) that can invoke full screen plugins. The menu bar
should hide when the first window becomes fullscreen, show again after the
last window stops being fullscreen, and not crash at any of those transitions.
Review URL: http://codereview.chromium.org/269022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_process_host.cc')
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 573e0a9..350319b 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -70,6 +70,7 @@ #endif #if defined(OS_MACOSX) +#include "base/mac_util.h" #include "chrome/common/plugin_carbon_interpose_constants_mac.h" #endif @@ -329,16 +330,19 @@ PluginProcessHost::~PluginProcessHost() { PostMessage(*window_index, WM_CLOSE, 0, 0); } #elif defined(OS_MACOSX) - // If the plugin process crashed but had windows open at the time, make - // sure that the menu bar is visible. - // TODO: only do this if the browser window is not also in fullscreen mode. - // (see http://code.google.com/p/chromium/issues/detail?id=23571) - if (!plugin_visible_windows_set_.empty()) { - SystemUIMode mode; - SystemUIOptions options; - GetSystemUIMode(&mode, &options); - if (mode != kUIModeNormal) - SetSystemUIMode(kUIModeNormal, 0); + // If the plugin process crashed but had fullscreen windows open at the time, + // make sure that the menu bar is visible. + std::set<uint32>::iterator window_index; + for (window_index = plugin_fullscreen_windows_set_.begin(); + window_index != plugin_fullscreen_windows_set_.end(); + window_index++) { + if (MessageLoop::current() == + ChromeThread::GetMessageLoop(ChromeThread::UI)) { + mac_util::ReleaseFullScreen(); + } else { + ChromeThread::GetMessageLoop(ChromeThread::UI)->PostTask(FROM_HERE, + NewRunnableFunction(mac_util::ReleaseFullScreen)); + } } #endif } |