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 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 413 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
414 case IDC_USE_SYSTEM_TITLE_BAR: { | 414 case IDC_USE_SYSTEM_TITLE_BAR: { |
415 PrefService* prefs = browser_->profile()->GetPrefs(); | 415 PrefService* prefs = browser_->profile()->GetPrefs(); |
416 prefs->SetBoolean(prefs::kUseCustomChromeFrame, | 416 prefs->SetBoolean(prefs::kUseCustomChromeFrame, |
417 !prefs->GetBoolean(prefs::kUseCustomChromeFrame)); | 417 !prefs->GetBoolean(prefs::kUseCustomChromeFrame)); |
418 break; | 418 break; |
419 } | 419 } |
420 #endif | 420 #endif |
421 | 421 |
422 #if defined(OS_MACOSX) | 422 #if defined(OS_MACOSX) |
423 case IDC_PRESENTATION_MODE: | |
424 chrome::ToggleFullscreenMode(browser_); | |
425 break; | |
426 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: | 423 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: |
427 chrome::ToggleFullscreenToolbar(browser_); | 424 chrome::ToggleFullscreenToolbar(browser_); |
428 break; | 425 break; |
429 #endif | 426 #endif |
430 case IDC_EXIT: | 427 case IDC_EXIT: |
431 Exit(); | 428 Exit(); |
432 break; | 429 break; |
433 | 430 |
434 // Page-related commands | 431 // Page-related commands |
435 case IDC_SAVE_PAGE: | 432 case IDC_SAVE_PAGE: |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 bool fullscreen_enabled = true; | 1158 bool fullscreen_enabled = true; |
1162 #if !defined(OS_MACOSX) | 1159 #if !defined(OS_MACOSX) |
1163 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && | 1160 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && |
1164 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { | 1161 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { |
1165 // Disable toggling into fullscreen mode if disallowed by pref. | 1162 // Disable toggling into fullscreen mode if disallowed by pref. |
1166 fullscreen_enabled = false; | 1163 fullscreen_enabled = false; |
1167 } | 1164 } |
1168 #endif | 1165 #endif |
1169 | 1166 |
1170 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); | 1167 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); |
1171 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, | |
1172 fullscreen_enabled); | |
1173 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_FULLSCREEN_TOOLBAR, | 1168 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_FULLSCREEN_TOOLBAR, |
1174 fullscreen_enabled); | 1169 fullscreen_enabled); |
1175 | 1170 |
1176 UpdateCommandsForBookmarkBar(); | 1171 UpdateCommandsForBookmarkBar(); |
1177 } | 1172 } |
1178 | 1173 |
1179 void BrowserCommandController::UpdatePrintingState() { | 1174 void BrowserCommandController::UpdatePrintingState() { |
1180 bool print_enabled = CanPrint(browser_); | 1175 bool print_enabled = CanPrint(browser_); |
1181 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); | 1176 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); |
1182 #if defined(ENABLE_BASIC_PRINTING) | 1177 #if defined(ENABLE_BASIC_PRINTING) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 | 1251 |
1257 BrowserWindow* BrowserCommandController::window() { | 1252 BrowserWindow* BrowserCommandController::window() { |
1258 return browser_->window(); | 1253 return browser_->window(); |
1259 } | 1254 } |
1260 | 1255 |
1261 Profile* BrowserCommandController::profile() { | 1256 Profile* BrowserCommandController::profile() { |
1262 return browser_->profile(); | 1257 return browser_->profile(); |
1263 } | 1258 } |
1264 | 1259 |
1265 } // namespace chrome | 1260 } // namespace chrome |
OLD | NEW |