OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 1253 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
1254 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 1254 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
1255 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 1255 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
1256 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 1256 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
1257 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) | 1257 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) |
1258 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); | 1258 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); |
1259 #endif | 1259 #endif |
1260 | 1260 |
1261 // Disable explicit fullscreen toggling when in metro snap mode. | 1261 // Disable explicit fullscreen toggling when in metro snap mode. |
1262 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP; | 1262 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP; |
1263 #if !defined(OS_MACOSX) | 1263 #if defined(OS_MACOSX) |
| 1264 // The Mac implementation doesn't support switching to fullscreen while |
| 1265 // a tab modal dialog is displayed. |
| 1266 int tab_index = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); |
| 1267 bool has_blocked_tab = tab_index != browser_->tab_strip_model()->count(); |
| 1268 fullscreen_enabled &= !has_blocked_tab; |
| 1269 #else |
1264 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && | 1270 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && |
1265 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { | 1271 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { |
1266 // Disable toggling into fullscreen mode if disallowed by pref. | 1272 // Disable toggling into fullscreen mode if disallowed by pref. |
1267 fullscreen_enabled = false; | 1273 fullscreen_enabled = false; |
1268 } | 1274 } |
1269 #endif | 1275 #endif |
1270 | 1276 |
1271 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); | 1277 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); |
1272 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, | 1278 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, |
1273 fullscreen_enabled); | 1279 fullscreen_enabled); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1367 |
1362 BrowserWindow* BrowserCommandController::window() { | 1368 BrowserWindow* BrowserCommandController::window() { |
1363 return browser_->window(); | 1369 return browser_->window(); |
1364 } | 1370 } |
1365 | 1371 |
1366 Profile* BrowserCommandController::profile() { | 1372 Profile* BrowserCommandController::profile() { |
1367 return browser_->profile(); | 1373 return browser_->profile(); |
1368 } | 1374 } |
1369 | 1375 |
1370 } // namespace chrome | 1376 } // namespace chrome |
OLD | NEW |