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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/ui/browser_commands_mac.h" | 44 #include "chrome/browser/ui/browser_commands_mac.h" |
45 #endif | 45 #endif |
46 | 46 |
47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
48 #include "base/win/metro.h" | 48 #include "base/win/metro.h" |
49 #include "base/win/windows_version.h" | 49 #include "base/win/windows_version.h" |
50 #include "chrome/browser/ui/apps/apps_metro_handler_win.h" | 50 #include "chrome/browser/ui/apps/apps_metro_handler_win.h" |
51 #endif | 51 #endif |
52 | 52 |
53 #if defined(USE_ASH) | 53 #if defined(USE_ASH) |
| 54 #include "ash/accelerators/accelerator_commands.h" |
54 #include "chrome/browser/ui/ash/ash_util.h" | 55 #include "chrome/browser/ui/ash/ash_util.h" |
55 #endif | 56 #endif |
56 | 57 |
57 using content::NavigationEntry; | 58 using content::NavigationEntry; |
58 using content::NavigationController; | 59 using content::NavigationController; |
59 using content::WebContents; | 60 using content::WebContents; |
60 | 61 |
61 namespace { | 62 namespace { |
62 | 63 |
63 enum WindowState { | 64 enum WindowState { |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 chrome::ToggleFullscreenWithChromeOrFallback(browser_); | 438 chrome::ToggleFullscreenWithChromeOrFallback(browser_); |
438 #else | 439 #else |
439 chrome::ToggleFullscreenMode(browser_); | 440 chrome::ToggleFullscreenMode(browser_); |
440 #endif | 441 #endif |
441 break; | 442 break; |
442 | 443 |
443 #if defined(USE_ASH) | 444 #if defined(USE_ASH) |
444 case IDC_TOGGLE_ASH_DESKTOP: | 445 case IDC_TOGGLE_ASH_DESKTOP: |
445 chrome::ToggleAshDesktop(); | 446 chrome::ToggleAshDesktop(); |
446 break; | 447 break; |
| 448 case IDC_MINIMIZE_WINDOW: |
| 449 ash::accelerators::ToggleMinimized(); |
| 450 break; |
| 451 // If Ash needs many more commands here we should implement a general |
| 452 // mechanism to pass accelerators back into Ash. http://crbug.com/285308 |
447 #endif | 453 #endif |
448 | 454 |
449 #if defined(OS_WIN) | 455 #if defined(OS_WIN) |
450 // Windows 8 specific commands. | 456 // Windows 8 specific commands. |
451 case IDC_METRO_SNAP_ENABLE: | 457 case IDC_METRO_SNAP_ENABLE: |
452 browser_->SetMetroSnapMode(true); | 458 browser_->SetMetroSnapMode(true); |
453 break; | 459 break; |
454 case IDC_METRO_SNAP_DISABLE: | 460 case IDC_METRO_SNAP_DISABLE: |
455 browser_->SetMetroSnapMode(false); | 461 browser_->SetMetroSnapMode(false); |
456 break; | 462 break; |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 834 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
829 #else | 835 #else |
830 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 836 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
831 #endif | 837 #endif |
832 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); | 838 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); |
833 #if defined(OS_WIN) && defined(USE_ASH) && !defined(NDEBUG) | 839 #if defined(OS_WIN) && defined(USE_ASH) && !defined(NDEBUG) |
834 if (base::win::GetVersion() < base::win::VERSION_WIN8 && | 840 if (base::win::GetVersion() < base::win::VERSION_WIN8 && |
835 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) | 841 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) |
836 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); | 842 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); |
837 #endif | 843 #endif |
| 844 #if defined(USE_ASH) |
| 845 command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); |
| 846 #endif |
838 | 847 |
839 // Page-related commands | 848 // Page-related commands |
840 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); | 849 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); |
841 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 850 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
842 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); | 851 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); |
843 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); | 852 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); |
844 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); | 853 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); |
845 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); | 854 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); |
846 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); | 855 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); |
847 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); | 856 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1270 |
1262 BrowserWindow* BrowserCommandController::window() { | 1271 BrowserWindow* BrowserCommandController::window() { |
1263 return browser_->window(); | 1272 return browser_->window(); |
1264 } | 1273 } |
1265 | 1274 |
1266 Profile* BrowserCommandController::profile() { | 1275 Profile* BrowserCommandController::profile() { |
1267 return browser_->profile(); | 1276 return browser_->profile(); |
1268 } | 1277 } |
1269 | 1278 |
1270 } // namespace chrome | 1279 } // namespace chrome |
OLD | NEW |