Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 2376193006: Disable Ctrl+Shift+P on Chrome OS (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index c6c2df58e8479b9893ad163e3752236404b47824..a7908bb0b1645624dc24b147311e2584660b2b19 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -445,9 +445,13 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
#if defined(ENABLE_BASIC_PRINTING)
case IDC_BASIC_PRINT:
+#if defined(OS_CHROMEOS)
+ NOTREACHED(); // System dialog is disabled for Chrome OS.
+#else
content::RecordAction(base::UserMetricsAction("Accel_Advanced_Print"));
BasicPrint(browser_);
break;
+#endif // OS_CHROMEOS
#endif // ENABLE_BASIC_PRINTING
case IDC_SAVE_CREDIT_CARD_FOR_PAGE:
@@ -1097,8 +1101,12 @@ void BrowserCommandController::UpdatePrintingState() {
bool print_enabled = CanPrint(browser_);
command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled);
#if defined(ENABLE_BASIC_PRINTING)
+#if defined(OS_CHROMEOS)
+ command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT, false);
Lei Zhang 2016/10/03 18:33:03 Why not just make CanBasicPrint() return false?
skau 2016/10/03 21:52:04 I wasn't sure if it was used elsewhere. I've doub
+#else
command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT,
CanBasicPrint(browser_));
+#endif // OS_CHROMEOS
#endif // ENABLE_BASIC_PRINTING
}

Powered by Google App Engine
This is Rietveld 408576698