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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 break; | 771 break; |
772 case IDC_HELP_PAGE_VIA_KEYBOARD: | 772 case IDC_HELP_PAGE_VIA_KEYBOARD: |
773 ShowHelp(browser_, HELP_SOURCE_KEYBOARD); | 773 ShowHelp(browser_, HELP_SOURCE_KEYBOARD); |
774 break; | 774 break; |
775 case IDC_HELP_PAGE_VIA_MENU: | 775 case IDC_HELP_PAGE_VIA_MENU: |
776 ShowHelp(browser_, HELP_SOURCE_MENU); | 776 ShowHelp(browser_, HELP_SOURCE_MENU); |
777 break; | 777 break; |
778 case IDC_SHOW_SIGNIN: | 778 case IDC_SHOW_SIGNIN: |
779 ShowBrowserSigninOrSettings(browser_, signin_metrics::SOURCE_MENU); | 779 ShowBrowserSigninOrSettings(browser_, signin_metrics::SOURCE_MENU); |
780 break; | 780 break; |
781 case IDC_TOGGLE_SPEECH_INPUT: | |
782 ToggleSpeechInput(browser_); | |
783 break; | |
784 case IDC_DISTILL_PAGE: | 781 case IDC_DISTILL_PAGE: |
785 DistillCurrentPage(browser_); | 782 DistillCurrentPage(browser_); |
786 break; | 783 break; |
787 #if defined(OS_CHROMEOS) | 784 #if defined(OS_CHROMEOS) |
788 case IDC_TOUCH_HUD_PROJECTION_TOGGLE: | 785 case IDC_TOUCH_HUD_PROJECTION_TOGGLE: |
789 ash::accelerators::ToggleTouchHudProjection(); | 786 ash::accelerators::ToggleTouchHudProjection(); |
790 break; | 787 break; |
791 #endif | 788 #endif |
792 case IDC_ROUTE_MEDIA: | 789 case IDC_ROUTE_MEDIA: |
793 RouteMedia(browser_); | 790 RouteMedia(browser_); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 int restart_mode = metro ? IDC_WIN_DESKTOP_RESTART : | 1026 int restart_mode = metro ? IDC_WIN_DESKTOP_RESTART : |
1030 (base::win::GetVersion() >= base::win::VERSION_WIN8 ? | 1027 (base::win::GetVersion() >= base::win::VERSION_WIN8 ? |
1031 IDC_WIN8_METRO_RESTART : IDC_WIN_CHROMEOS_RESTART); | 1028 IDC_WIN8_METRO_RESTART : IDC_WIN_CHROMEOS_RESTART); |
1032 command_updater_.UpdateCommandEnabled(restart_mode, normal_window); | 1029 command_updater_.UpdateCommandEnabled(restart_mode, normal_window); |
1033 #endif | 1030 #endif |
1034 | 1031 |
1035 // These are always enabled; the menu determines their menu item visibility. | 1032 // These are always enabled; the menu determines their menu item visibility. |
1036 command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true); | 1033 command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true); |
1037 command_updater_.UpdateCommandEnabled(IDC_VIEW_INCOMPATIBILITIES, true); | 1034 command_updater_.UpdateCommandEnabled(IDC_VIEW_INCOMPATIBILITIES, true); |
1038 | 1035 |
1039 // Toggle speech input | |
1040 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_SPEECH_INPUT, true); | |
1041 | |
1042 // Distill current page. | 1036 // Distill current page. |
1043 command_updater_.UpdateCommandEnabled( | 1037 command_updater_.UpdateCommandEnabled( |
1044 IDC_DISTILL_PAGE, base::CommandLine::ForCurrentProcess()->HasSwitch( | 1038 IDC_DISTILL_PAGE, base::CommandLine::ForCurrentProcess()->HasSwitch( |
1045 switches::kEnableDomDistiller)); | 1039 switches::kEnableDomDistiller)); |
1046 | 1040 |
1047 // Initialize other commands whose state changes based on various conditions. | 1041 // Initialize other commands whose state changes based on various conditions. |
1048 UpdateCommandsForFullscreenMode(); | 1042 UpdateCommandsForFullscreenMode(); |
1049 UpdateCommandsForContentRestrictionState(); | 1043 UpdateCommandsForContentRestrictionState(); |
1050 UpdateCommandsForBookmarkEditing(); | 1044 UpdateCommandsForBookmarkEditing(); |
1051 UpdateCommandsForIncognitoAvailability(); | 1045 UpdateCommandsForIncognitoAvailability(); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 | 1376 |
1383 BrowserWindow* BrowserCommandController::window() { | 1377 BrowserWindow* BrowserCommandController::window() { |
1384 return browser_->window(); | 1378 return browser_->window(); |
1385 } | 1379 } |
1386 | 1380 |
1387 Profile* BrowserCommandController::profile() { | 1381 Profile* BrowserCommandController::profile() { |
1388 return browser_->profile(); | 1382 return browser_->profile(); |
1389 } | 1383 } |
1390 | 1384 |
1391 } // namespace chrome | 1385 } // namespace chrome |
OLD | NEW |