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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "content/public/browser/native_web_keyboard_event.h" | 50 #include "content/public/browser/native_web_keyboard_event.h" |
51 #include "content/public/browser/navigation_controller.h" | 51 #include "content/public/browser/navigation_controller.h" |
52 #include "content/public/browser/navigation_entry.h" | 52 #include "content/public/browser/navigation_entry.h" |
53 #include "content/public/browser/user_metrics.h" | 53 #include "content/public/browser/user_metrics.h" |
54 #include "content/public/browser/web_contents.h" | 54 #include "content/public/browser/web_contents.h" |
55 #include "content/public/browser/web_contents_observer.h" | 55 #include "content/public/browser/web_contents_observer.h" |
56 #include "content/public/common/service_manager_connection.h" | 56 #include "content/public/common/service_manager_connection.h" |
57 #include "content/public/common/url_constants.h" | 57 #include "content/public/common/url_constants.h" |
58 #include "extensions/browser/extension_system.h" | 58 #include "extensions/browser/extension_system.h" |
59 #include "mash/public/interfaces/launchable.mojom.h" | 59 #include "mash/public/interfaces/launchable.mojom.h" |
| 60 #include "printing/features/features.h" |
60 #include "services/service_manager/public/cpp/connector.h" | 61 #include "services/service_manager/public/cpp/connector.h" |
61 #include "ui/events/keycodes/keyboard_codes.h" | 62 #include "ui/events/keycodes/keyboard_codes.h" |
62 | 63 |
63 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
64 #include "chrome/browser/ui/browser_commands_mac.h" | 65 #include "chrome/browser/ui/browser_commands_mac.h" |
65 #endif | 66 #endif |
66 | 67 |
67 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
68 #include "base/win/windows_version.h" | 69 #include "base/win/windows_version.h" |
69 #include "content/public/browser/gpu_data_manager.h" | 70 #include "content/public/browser/gpu_data_manager.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 case IDC_VIEW_SOURCE: | 437 case IDC_VIEW_SOURCE: |
437 ViewSelectedSource(browser_); | 438 ViewSelectedSource(browser_); |
438 break; | 439 break; |
439 case IDC_EMAIL_PAGE_LOCATION: | 440 case IDC_EMAIL_PAGE_LOCATION: |
440 EmailPageLocation(browser_); | 441 EmailPageLocation(browser_); |
441 break; | 442 break; |
442 case IDC_PRINT: | 443 case IDC_PRINT: |
443 Print(browser_); | 444 Print(browser_); |
444 break; | 445 break; |
445 | 446 |
446 #if defined(ENABLE_BASIC_PRINTING) | 447 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
447 case IDC_BASIC_PRINT: | 448 case IDC_BASIC_PRINT: |
448 content::RecordAction(base::UserMetricsAction("Accel_Advanced_Print")); | 449 content::RecordAction(base::UserMetricsAction("Accel_Advanced_Print")); |
449 BasicPrint(browser_); | 450 BasicPrint(browser_); |
450 break; | 451 break; |
451 #endif // ENABLE_BASIC_PRINTING | 452 #endif // ENABLE_BASIC_PRINTING |
452 | 453 |
453 case IDC_SAVE_CREDIT_CARD_FOR_PAGE: | 454 case IDC_SAVE_CREDIT_CARD_FOR_PAGE: |
454 SaveCreditCard(browser_); | 455 SaveCreditCard(browser_); |
455 break; | 456 break; |
456 case IDC_TRANSLATE_PAGE: | 457 case IDC_TRANSLATE_PAGE: |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); | 1090 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); |
1090 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_FULLSCREEN_TOOLBAR, | 1091 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_FULLSCREEN_TOOLBAR, |
1091 fullscreen_enabled); | 1092 fullscreen_enabled); |
1092 | 1093 |
1093 UpdateCommandsForBookmarkBar(); | 1094 UpdateCommandsForBookmarkBar(); |
1094 } | 1095 } |
1095 | 1096 |
1096 void BrowserCommandController::UpdatePrintingState() { | 1097 void BrowserCommandController::UpdatePrintingState() { |
1097 bool print_enabled = CanPrint(browser_); | 1098 bool print_enabled = CanPrint(browser_); |
1098 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); | 1099 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); |
1099 #if defined(ENABLE_BASIC_PRINTING) | 1100 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
1100 command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT, | 1101 command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT, |
1101 CanBasicPrint(browser_)); | 1102 CanBasicPrint(browser_)); |
1102 #endif // ENABLE_BASIC_PRINTING | 1103 #endif // ENABLE_BASIC_PRINTING |
1103 } | 1104 } |
1104 | 1105 |
1105 void BrowserCommandController::UpdateSaveAsState() { | 1106 void BrowserCommandController::UpdateSaveAsState() { |
1106 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_)); | 1107 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_)); |
1107 } | 1108 } |
1108 | 1109 |
1109 void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) { | 1110 void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1174 |
1174 BrowserWindow* BrowserCommandController::window() { | 1175 BrowserWindow* BrowserCommandController::window() { |
1175 return browser_->window(); | 1176 return browser_->window(); |
1176 } | 1177 } |
1177 | 1178 |
1178 Profile* BrowserCommandController::profile() { | 1179 Profile* BrowserCommandController::profile() { |
1179 return browser_->profile(); | 1180 return browser_->profile(); |
1180 } | 1181 } |
1181 | 1182 |
1182 } // namespace chrome | 1183 } // namespace chrome |
OLD | NEW |