diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 4 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 24 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host_mac.cc | 19 |
4 files changed, 30 insertions, 19 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 7c37bbb..8daa0d9 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -887,9 +887,9 @@ willPositionSheet:(NSWindow*)sheet // Hide the menubar, and allow it to un-hide when moving the mouse // to the top of the screen. Does this eliminate the need for an // info bubble describing how to exit fullscreen mode? - SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); + mac_util::RequestFullScreen(); } else { - SetSystemUIMode(kUIModeNormal, 0); + mac_util::ReleaseFullScreen(); [[[self window] contentView] addSubview:[toolbarController_ view]]; if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR)) { [bookmarkBarController_ setBookmarkBarEnabled:YES]; 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 } diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index 6c5e17f..e397c4c 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -153,6 +153,8 @@ class PluginProcessHost : public ChildProcessHost, #if defined(OS_MACOSX) // Tracks plugin windows currently visible std::set<uint32> plugin_visible_windows_set_; + // Tracks full screen windows currently visible + std::set<uint32> plugin_fullscreen_windows_set_; #endif DISALLOW_COPY_AND_ASSIGN(PluginProcessHost); 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); } |