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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, options_enabled); | 1087 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, options_enabled); |
1088 | 1088 |
1089 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 1089 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
1090 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 1090 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
1091 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 1091 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
1092 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 1092 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
1093 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) | 1093 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) |
1094 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); | 1094 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); |
1095 #endif | 1095 #endif |
1096 | 1096 |
1097 // Disable explicit fullscreen toggling when in metro snap mode. | 1097 // Disable explicit fullscreen toggling for app-panels and when in metro snap |
1098 bool fullscreen_enabled = !browser_->is_type_panel() && | 1098 // mode. |
1099 !browser_->is_app() && | 1099 bool fullscreen_enabled = |
1100 fullscreen_mode != FULLSCREEN_METRO_SNAP; | 1100 !(browser_->is_type_panel() && browser_->is_app()) && |
| 1101 fullscreen_mode != FULLSCREEN_METRO_SNAP; |
1101 #if defined(OS_MACOSX) | 1102 #if defined(OS_MACOSX) |
1102 // The Mac implementation doesn't support switching to fullscreen while | 1103 // The Mac implementation doesn't support switching to fullscreen while |
1103 // a tab modal dialog is displayed. | 1104 // a tab modal dialog is displayed. |
1104 int tab_index = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); | 1105 int tab_index = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); |
1105 bool has_blocked_tab = tab_index != browser_->tab_strip_model()->count(); | 1106 bool has_blocked_tab = tab_index != browser_->tab_strip_model()->count(); |
1106 fullscreen_enabled &= !has_blocked_tab; | 1107 fullscreen_enabled &= !has_blocked_tab; |
1107 #endif | 1108 #endif |
1108 | 1109 |
1109 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); | 1110 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); |
1110 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, | 1111 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 | 1189 |
1189 BrowserWindow* BrowserCommandController::window() { | 1190 BrowserWindow* BrowserCommandController::window() { |
1190 return browser_->window(); | 1191 return browser_->window(); |
1191 } | 1192 } |
1192 | 1193 |
1193 Profile* BrowserCommandController::profile() { | 1194 Profile* BrowserCommandController::profile() { |
1194 return browser_->profile(); | 1195 return browser_->profile(); |
1195 } | 1196 } |
1196 | 1197 |
1197 } // namespace chrome | 1198 } // namespace chrome |
OLD | NEW |