| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 break; | 563 break; |
| 564 case IDC_VIEW_PASSWORDS: | 564 case IDC_VIEW_PASSWORDS: |
| 565 ShowPasswordManager(browser_); | 565 ShowPasswordManager(browser_); |
| 566 break; | 566 break; |
| 567 case IDC_CLEAR_BROWSING_DATA: | 567 case IDC_CLEAR_BROWSING_DATA: |
| 568 ShowClearBrowsingDataDialog(browser_); | 568 ShowClearBrowsingDataDialog(browser_); |
| 569 break; | 569 break; |
| 570 case IDC_IMPORT_SETTINGS: | 570 case IDC_IMPORT_SETTINGS: |
| 571 ShowImportDialog(browser_); | 571 ShowImportDialog(browser_); |
| 572 break; | 572 break; |
| 573 case IDC_TOGGLE_REQUEST_TABLET_SITE: |
| 574 ToggleRequestTabletSite(browser_); |
| 575 break; |
| 573 case IDC_ABOUT: | 576 case IDC_ABOUT: |
| 574 ShowAboutChrome(browser_); | 577 ShowAboutChrome(browser_); |
| 575 break; | 578 break; |
| 576 case IDC_UPGRADE_DIALOG: | 579 case IDC_UPGRADE_DIALOG: |
| 577 OpenUpdateChromeDialog(browser_); | 580 OpenUpdateChromeDialog(browser_); |
| 578 break; | 581 break; |
| 579 case IDC_VIEW_INCOMPATIBILITIES: | 582 case IDC_VIEW_INCOMPATIBILITIES: |
| 580 ShowConflicts(browser_); | 583 ShowConflicts(browser_); |
| 581 break; | 584 break; |
| 582 case IDC_HELP_PAGE_VIA_KEYBOARD: | 585 case IDC_HELP_PAGE_VIA_KEYBOARD: |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 | 927 |
| 925 // Show various bits of UI | 928 // Show various bits of UI |
| 926 // TODO(pinkerton): Disable app-mode in the model until we implement it | 929 // TODO(pinkerton): Disable app-mode in the model until we implement it |
| 927 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | 930 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 |
| 928 #if !defined(OS_MACOSX) | 931 #if !defined(OS_MACOSX) |
| 929 command_updater_.UpdateCommandEnabled( | 932 command_updater_.UpdateCommandEnabled( |
| 930 IDC_CREATE_SHORTCUTS, | 933 IDC_CREATE_SHORTCUTS, |
| 931 CanCreateApplicationShortcuts(browser_)); | 934 CanCreateApplicationShortcuts(browser_)); |
| 932 #endif | 935 #endif |
| 933 | 936 |
| 937 command_updater_.UpdateCommandEnabled( |
| 938 IDC_TOGGLE_REQUEST_TABLET_SITE, |
| 939 CanRequestTabletSite(current_web_contents)); |
| 940 |
| 934 UpdateCommandsForContentRestrictionState(); | 941 UpdateCommandsForContentRestrictionState(); |
| 935 UpdateCommandsForBookmarkEditing(); | 942 UpdateCommandsForBookmarkEditing(); |
| 936 } | 943 } |
| 937 | 944 |
| 938 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { | 945 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { |
| 939 int restrictions = GetContentRestrictions(browser_); | 946 int restrictions = GetContentRestrictions(browser_); |
| 940 | 947 |
| 941 command_updater_.UpdateCommandEnabled( | 948 command_updater_.UpdateCommandEnabled( |
| 942 IDC_COPY, !(restrictions & content::CONTENT_RESTRICTION_COPY)); | 949 IDC_COPY, !(restrictions & content::CONTENT_RESTRICTION_COPY)); |
| 943 command_updater_.UpdateCommandEnabled( | 950 command_updater_.UpdateCommandEnabled( |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 | 1109 |
| 1103 BrowserWindow* BrowserCommandController::window() { | 1110 BrowserWindow* BrowserCommandController::window() { |
| 1104 return browser_->window(); | 1111 return browser_->window(); |
| 1105 } | 1112 } |
| 1106 | 1113 |
| 1107 Profile* BrowserCommandController::profile() { | 1114 Profile* BrowserCommandController::profile() { |
| 1108 return browser_->profile(); | 1115 return browser_->profile(); |
| 1109 } | 1116 } |
| 1110 | 1117 |
| 1111 } // namespace chrome | 1118 } // namespace chrome |
| OLD | NEW |