Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3126)

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 10947019: Constrained Window Cocoa: Disable fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 2d4c48ca45518fc8f523fdad450afc9614fbd88a..2cd2084174f72d966131b68ca7d996a0d7344fee 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -850,9 +850,6 @@ void BrowserCommandController::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window);
// Window management commands
- // TODO(rohitrao): Disable fullscreen on non-Lion?
- command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN,
- !(browser_->is_type_panel() && browser_->is_app()));
command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window);
command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB,
normal_window);
@@ -875,11 +872,7 @@ void BrowserCommandController::InitCommandState() {
IDC_WIN8_DESKTOP_RESTART : IDC_WIN8_METRO_RESTART;
command_updater_.UpdateCommandEnabled(restart_mode, normal_window);
#endif
-#if defined(OS_MACOSX)
command_updater_.UpdateCommandEnabled(IDC_TABPOSE, normal_window);
- command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE,
- !(browser_->is_type_panel() && browser_->is_app()));
-#endif
// Find-in-page
command_updater_.UpdateCommandEnabled(IDC_FIND, !browser_->is_devtools());
@@ -1094,9 +1087,20 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode(
#endif
// Disable explicit fullscreen toggling when in metro snap mode.
- command_updater_.UpdateCommandEnabled(
- IDC_FULLSCREEN,
- fullscreen_mode != FULLSCREEN_METRO_SNAP);
+ bool fullscreen_enabled = !browser_->is_type_panel() &&
+ !browser_->is_app() &&
+ fullscreen_mode != FULLSCREEN_METRO_SNAP;
+#if defined(OS_MACOSX)
+ // The Mac implementation doesn't support switching to fullscreen while
+ // a tab modal dialog is displayed.
+ int tabIndex = browser_->tab_strip_model()->IndexOfFirstBlockedTab();
+ bool has_blocked_tab = tabIndex != browser_->tab_strip_model()->count();
+ fullscreen_enabled = fullscreen_enabled && !has_blocked_tab;
Robert Sesek 2012/11/05 21:17:32 Could use &= here
sail 2012/11/06 22:00:43 Done.
+#endif
+
+ command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled);
+ command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE,
+ fullscreen_enabled);
UpdateCommandsForBookmarkBar();
UpdateCommandsForMultipleProfiles();
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698