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 26 matching lines...) Expand all Loading... |
37 #include "content/public/browser/notification_source.h" | 37 #include "content/public/browser/notification_source.h" |
38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
39 #include "content/public/common/content_restriction.h" | 39 #include "content/public/common/content_restriction.h" |
40 #include "content/public/common/url_constants.h" | 40 #include "content/public/common/url_constants.h" |
41 #include "ui/base/keycodes/keyboard_codes.h" | 41 #include "ui/base/keycodes/keyboard_codes.h" |
42 | 42 |
43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
44 #include "base/win/metro.h" | 44 #include "base/win/metro.h" |
45 #endif | 45 #endif |
46 | 46 |
| 47 #if defined(USE_ASH) |
| 48 #include "chrome/browser/ui/ash/ash_util.h" |
| 49 #endif |
| 50 |
47 using content::WebContents; | 51 using content::WebContents; |
48 using content::NavigationEntry; | 52 using content::NavigationEntry; |
49 using content::NavigationController; | 53 using content::NavigationController; |
50 using content::WebContents; | 54 using content::WebContents; |
51 | 55 |
52 namespace { | 56 namespace { |
53 | 57 |
54 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. | 58 // Returns |true| if entry has an internal chrome:// URL, |false| otherwise. |
55 bool HasInternalURL(const NavigationEntry* entry) { | 59 bool HasInternalURL(const NavigationEntry* entry) { |
56 if (!entry) | 60 if (!entry) |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 case IDC_RESTORE_TAB: | 397 case IDC_RESTORE_TAB: |
394 RestoreTab(browser_); | 398 RestoreTab(browser_); |
395 break; | 399 break; |
396 case IDC_SHOW_AS_TAB: | 400 case IDC_SHOW_AS_TAB: |
397 ConvertPopupToTabbedBrowser(browser_); | 401 ConvertPopupToTabbedBrowser(browser_); |
398 break; | 402 break; |
399 case IDC_FULLSCREEN: | 403 case IDC_FULLSCREEN: |
400 chrome::ToggleFullscreenMode(browser_); | 404 chrome::ToggleFullscreenMode(browser_); |
401 break; | 405 break; |
402 | 406 |
| 407 #if defined(USE_ASH) |
| 408 case IDC_TOGGLE_ASH_DESKTOP: |
| 409 chrome::ToggleAshDesktop(); |
| 410 break; |
| 411 #endif |
| 412 |
403 #if defined(OS_WIN) | 413 #if defined(OS_WIN) |
404 // Windows 8 specific commands. | 414 // Windows 8 specific commands. |
405 case IDC_METRO_SNAP_ENABLE: | 415 case IDC_METRO_SNAP_ENABLE: |
406 browser_->SetMetroSnapMode(true); | 416 browser_->SetMetroSnapMode(true); |
407 break; | 417 break; |
408 case IDC_METRO_SNAP_DISABLE: | 418 case IDC_METRO_SNAP_DISABLE: |
409 browser_->SetMetroSnapMode(false); | 419 browser_->SetMetroSnapMode(false); |
410 break; | 420 break; |
411 case IDC_WIN8_DESKTOP_RESTART: | 421 case IDC_WIN8_DESKTOP_RESTART: |
412 browser::AttemptRestartWithModeSwitch(); | 422 browser::AttemptRestartWithModeSwitch(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); | 783 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); |
774 | 784 |
775 // Window management commands | 785 // Window management commands |
776 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); | 786 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); |
777 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); | 787 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); |
778 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); | 788 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); |
779 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); | 789 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); |
780 command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, false); | 790 command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, false); |
781 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 791 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
782 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); | 792 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); |
| 793 #if defined(USE_ASH) |
| 794 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); |
| 795 #endif |
783 | 796 |
784 // Page-related commands | 797 // Page-related commands |
785 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); | 798 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); |
786 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 799 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
787 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); | 800 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); |
788 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); | 801 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); |
789 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); | 802 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); |
790 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); | 803 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); |
791 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); | 804 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); |
792 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); | 805 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 | 1179 |
1167 BrowserWindow* BrowserCommandController::window() { | 1180 BrowserWindow* BrowserCommandController::window() { |
1168 return browser_->window(); | 1181 return browser_->window(); |
1169 } | 1182 } |
1170 | 1183 |
1171 Profile* BrowserCommandController::profile() { | 1184 Profile* BrowserCommandController::profile() { |
1172 return browser_->profile(); | 1185 return browser_->profile(); |
1173 } | 1186 } |
1174 | 1187 |
1175 } // namespace chrome | 1188 } // namespace chrome |
OLD | NEW |