| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 break; | 549 break; |
| 550 case IDC_VIEW_PASSWORDS: | 550 case IDC_VIEW_PASSWORDS: |
| 551 ShowPasswordManager(browser_); | 551 ShowPasswordManager(browser_); |
| 552 break; | 552 break; |
| 553 case IDC_CLEAR_BROWSING_DATA: | 553 case IDC_CLEAR_BROWSING_DATA: |
| 554 ShowClearBrowsingDataDialog(browser_); | 554 ShowClearBrowsingDataDialog(browser_); |
| 555 break; | 555 break; |
| 556 case IDC_IMPORT_SETTINGS: | 556 case IDC_IMPORT_SETTINGS: |
| 557 ShowImportDialog(browser_); | 557 ShowImportDialog(browser_); |
| 558 break; | 558 break; |
| 559 case IDC_TOGGLE_REQUEST_TABLET_SITE: |
| 560 ToggleRequestTabletSite(browser_); |
| 561 break; |
| 559 case IDC_ABOUT: | 562 case IDC_ABOUT: |
| 560 ShowAboutChrome(browser_); | 563 ShowAboutChrome(browser_); |
| 561 break; | 564 break; |
| 562 case IDC_UPGRADE_DIALOG: | 565 case IDC_UPGRADE_DIALOG: |
| 563 OpenUpdateChromeDialog(browser_); | 566 OpenUpdateChromeDialog(browser_); |
| 564 break; | 567 break; |
| 565 case IDC_VIEW_INCOMPATIBILITIES: | 568 case IDC_VIEW_INCOMPATIBILITIES: |
| 566 ShowConflicts(browser_); | 569 ShowConflicts(browser_); |
| 567 break; | 570 break; |
| 568 case IDC_HELP_PAGE_VIA_KEYBOARD: | 571 case IDC_HELP_PAGE_VIA_KEYBOARD: |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 | 913 |
| 911 // Show various bits of UI | 914 // Show various bits of UI |
| 912 // TODO(pinkerton): Disable app-mode in the model until we implement it | 915 // TODO(pinkerton): Disable app-mode in the model until we implement it |
| 913 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | 916 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 |
| 914 #if !defined(OS_MACOSX) | 917 #if !defined(OS_MACOSX) |
| 915 command_updater_.UpdateCommandEnabled( | 918 command_updater_.UpdateCommandEnabled( |
| 916 IDC_CREATE_SHORTCUTS, | 919 IDC_CREATE_SHORTCUTS, |
| 917 CanCreateApplicationShortcuts(browser_)); | 920 CanCreateApplicationShortcuts(browser_)); |
| 918 #endif | 921 #endif |
| 919 | 922 |
| 923 command_updater_.UpdateCommandEnabled( |
| 924 IDC_TOGGLE_REQUEST_TABLET_SITE, |
| 925 CanRequestTabletSite(current_web_contents)); |
| 926 |
| 920 UpdateCommandsForContentRestrictionState(); | 927 UpdateCommandsForContentRestrictionState(); |
| 921 UpdateCommandsForBookmarkEditing(); | 928 UpdateCommandsForBookmarkEditing(); |
| 922 } | 929 } |
| 923 | 930 |
| 924 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { | 931 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { |
| 925 int restrictions = GetContentRestrictions(browser_); | 932 int restrictions = GetContentRestrictions(browser_); |
| 926 | 933 |
| 927 command_updater_.UpdateCommandEnabled( | 934 command_updater_.UpdateCommandEnabled( |
| 928 IDC_COPY, !(restrictions & content::CONTENT_RESTRICTION_COPY)); | 935 IDC_COPY, !(restrictions & content::CONTENT_RESTRICTION_COPY)); |
| 929 command_updater_.UpdateCommandEnabled( | 936 command_updater_.UpdateCommandEnabled( |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 | 1095 |
| 1089 BrowserWindow* BrowserCommandController::window() { | 1096 BrowserWindow* BrowserCommandController::window() { |
| 1090 return browser_->window(); | 1097 return browser_->window(); |
| 1091 } | 1098 } |
| 1092 | 1099 |
| 1093 Profile* BrowserCommandController::profile() { | 1100 Profile* BrowserCommandController::profile() { |
| 1094 return browser_->profile(); | 1101 return browser_->profile(); |
| 1095 } | 1102 } |
| 1096 | 1103 |
| 1097 } // namespace chrome | 1104 } // namespace chrome |
| OLD | NEW |