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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, options_enabled); | 1093 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, options_enabled); |
1094 | 1094 |
1095 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 1095 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
1096 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 1096 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
1097 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 1097 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
1098 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 1098 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
1099 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) | 1099 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) |
1100 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); | 1100 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); |
1101 #endif | 1101 #endif |
1102 | 1102 |
1103 // Disable explicit fullscreen toggling when in metro snap mode. | 1103 // Disable explicit fullscreen toggling for app-panels and when in metro snap |
1104 bool fullscreen_enabled = !browser_->is_type_panel() && | 1104 // mode. |
1105 !browser_->is_app() && | 1105 bool fullscreen_enabled = |
1106 fullscreen_mode != FULLSCREEN_METRO_SNAP; | 1106 !(browser_->is_type_panel() && browser_->is_app()) && |
| 1107 fullscreen_mode != FULLSCREEN_METRO_SNAP; |
1107 #if defined(OS_MACOSX) | 1108 #if defined(OS_MACOSX) |
1108 // The Mac implementation doesn't support switching to fullscreen while | 1109 // The Mac implementation doesn't support switching to fullscreen while |
1109 // a tab modal dialog is displayed. | 1110 // a tab modal dialog is displayed. |
1110 int tabIndex = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); | 1111 int tabIndex = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); |
1111 bool has_blocked_tab = tabIndex != browser_->tab_strip_model()->count(); | 1112 bool has_blocked_tab = tabIndex != browser_->tab_strip_model()->count(); |
1112 fullscreen_enabled &= !has_blocked_tab; | 1113 fullscreen_enabled &= !has_blocked_tab; |
1113 #endif | 1114 #endif |
1114 | 1115 |
1115 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); | 1116 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); |
1116 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, | 1117 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 | 1185 |
1185 BrowserWindow* BrowserCommandController::window() { | 1186 BrowserWindow* BrowserCommandController::window() { |
1186 return browser_->window(); | 1187 return browser_->window(); |
1187 } | 1188 } |
1188 | 1189 |
1189 Profile* BrowserCommandController::profile() { | 1190 Profile* BrowserCommandController::profile() { |
1190 return browser_->profile(); | 1191 return browser_->profile(); |
1191 } | 1192 } |
1192 | 1193 |
1193 } // namespace chrome | 1194 } // namespace chrome |
OLD | NEW |