diff options
Diffstat (limited to 'chrome/browser/plugin_process_host_mac.cc')
-rw-r--r-- | chrome/browser/plugin_process_host_mac.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/plugin_process_host_mac.cc b/chrome/browser/plugin_process_host_mac.cc index 65ead0a..2c64245 100644 --- a/chrome/browser/plugin_process_host_mac.cc +++ b/chrome/browser/plugin_process_host_mac.cc @@ -9,6 +9,8 @@ #include <vector> #include "base/logging.h" +#include "base/mac_util.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/plugin_process_host.h" void PluginProcessHost::OnPluginSelectWindow(uint32 window_id, @@ -25,23 +27,26 @@ void PluginProcessHost::OnPluginShowWindow(uint32 window_id, }; CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); if (CGRectEqualToRect(window_bounds, main_display_bounds)) { + plugin_fullscreen_windows_set_.insert(window_id); // 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); + ChromeThread::GetMessageLoop(ChromeThread::UI)->PostTask(FROM_HERE, + NewRunnableFunction(mac_util::RequestFullScreen)); } } void PluginProcessHost::OnPluginHideWindow(uint32 window_id, gfx::Rect window_rect) { plugin_visible_windows_set_.erase(window_id); - SystemUIMode mode; - SystemUIOptions options; - GetSystemUIMode(&mode, &options); - if (mode != kUIModeNormal) - SetSystemUIMode(kUIModeNormal, 0); + if (plugin_fullscreen_windows_set_.find(window_id) != + plugin_fullscreen_windows_set_.end()) { + plugin_fullscreen_windows_set_.erase(window_id); + ChromeThread::GetMessageLoop(ChromeThread::UI)->PostTask(FROM_HERE, + NewRunnableFunction(mac_util::ReleaseFullScreen)); + } } void PluginProcessHost::OnPluginDisposeWindow(uint32 window_id, gfx::Rect window_rect) { - plugin_visible_windows_set_.erase(window_id); + OnPluginHideWindow(window_id, window_rect); } |