| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/debugging_flags.h" | 12 #include "base/debug/debugging_flags.h" |
| 13 #include "base/debug/profiler.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/defaults.h" | 20 #include "chrome/browser/defaults.h" |
| 20 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_util.h" | 22 #include "chrome/browser/extensions/extension_util.h" |
| 22 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
| (...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 profile()->GetPrefs()) != IncognitoModePrefs::FORCED; | 1160 profile()->GetPrefs()) != IncognitoModePrefs::FORCED; |
| 1160 const bool guest_session = profile()->IsGuestSession(); | 1161 const bool guest_session = profile()->IsGuestSession(); |
| 1161 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, options_enabled); | 1162 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, options_enabled); |
| 1162 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, | 1163 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, |
| 1163 options_enabled && !guest_session); | 1164 options_enabled && !guest_session); |
| 1164 | 1165 |
| 1165 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 1166 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
| 1166 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 1167 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
| 1167 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 1168 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
| 1168 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 1169 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
| 1169 #if BUILDFLAG(ENABLE_PROFILING) && !defined(NO_TCMALLOC) | 1170 |
| 1170 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); | 1171 if (base::debug::IsProfilingSupported()) |
| 1171 #endif | 1172 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); |
| 1172 | 1173 |
| 1173 // Disable explicit fullscreen toggling when in metro snap mode. | 1174 // Disable explicit fullscreen toggling when in metro snap mode. |
| 1174 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP; | 1175 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP; |
| 1175 #if !defined(OS_MACOSX) | 1176 #if !defined(OS_MACOSX) |
| 1176 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && | 1177 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && |
| 1177 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { | 1178 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { |
| 1178 // Disable toggling into fullscreen mode if disallowed by pref. | 1179 // Disable toggling into fullscreen mode if disallowed by pref. |
| 1179 fullscreen_enabled = false; | 1180 fullscreen_enabled = false; |
| 1180 } | 1181 } |
| 1181 #endif | 1182 #endif |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 | 1270 |
| 1270 BrowserWindow* BrowserCommandController::window() { | 1271 BrowserWindow* BrowserCommandController::window() { |
| 1271 return browser_->window(); | 1272 return browser_->window(); |
| 1272 } | 1273 } |
| 1273 | 1274 |
| 1274 Profile* BrowserCommandController::profile() { | 1275 Profile* BrowserCommandController::profile() { |
| 1275 return browser_->profile(); | 1276 return browser_->profile(); |
| 1276 } | 1277 } |
| 1277 | 1278 |
| 1278 } // namespace chrome | 1279 } // namespace chrome |
| OLD | NEW |