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

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

Issue 2376193006: Disable Ctrl+Shift+P on Chrome OS (Closed)
Patch Set: declare what you use Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/print_preview_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 4befbb55369bb0e277bf27f0d834506c914958a6..650e5cf1e910585fd6ca30dd24fc7326ecf5d482 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -53,6 +53,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/content_restriction.h"
+#include "chrome/common/features.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
@@ -252,7 +253,7 @@ bool IsShowingWebContentsModalDialog(Browser* browser) {
return manager && manager->IsDialogActive();
}
-#if defined(ENABLE_BASIC_PRINTING)
+#if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG)
bool PrintPreviewShowing(const Browser* browser) {
#if defined(ENABLE_PRINT_PREVIEW)
WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
@@ -264,7 +265,7 @@ bool PrintPreviewShowing(const Browser* browser) {
return false;
#endif
}
-#endif // ENABLE_BASIC_PRINTING
+#endif // BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG)
} // namespace
@@ -901,12 +902,16 @@ void BasicPrint(Browser* browser) {
}
bool CanBasicPrint(Browser* browser) {
+#if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG)
// If printing is not disabled via pref or policy, it is always possible to
// advanced print when the print preview is visible.
return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) &&
- (PrintPreviewShowing(browser) || CanPrint(browser));
+ (PrintPreviewShowing(browser) || CanPrint(browser));
+#else
+ return false; // The print dialog is disabled.
+#endif // BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG)
}
-#endif // ENABLE_BASIC_PRINTING
+#endif // defined(ENABLE_BASIC_PRINTING)
bool CanRouteMedia(Browser* browser) {
// Do not allow user to open Media Router dialog when there is already an
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/print_preview_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698