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

Unified Diff: chrome/browser/printing/print_view_manager_common.cc

Issue 2458833005: Move printing defines to buildflag system. (Closed)
Patch Set: Merge Created 4 years, 1 month 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/printing/print_view_manager_common.cc
diff --git a/chrome/browser/printing/print_view_manager_common.cc b/chrome/browser/printing/print_view_manager_common.cc
index 097220415f1ea81bec36122b1a23d4437c74e5eb..b4b3603a2b69e6397e70ff58d5ddbc0c45dab8b9 100644
--- a/chrome/browser/printing/print_view_manager_common.cc
+++ b/chrome/browser/printing/print_view_manager_common.cc
@@ -4,16 +4,18 @@
#include "chrome/browser/printing/print_view_manager_common.h"
+#include "printing/features/features.h"
+
#if defined(ENABLE_EXTENSIONS)
#include "components/guest_view/browser/guest_view_manager.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
#endif // defined(ENABLE_EXTENSIONS)
-#if defined(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
#include "chrome/browser/printing/print_view_manager.h"
#else
#include "chrome/browser/printing/print_view_manager_basic.h"
-#endif // defined(ENABLE_PRINT_PREVIEW)
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
namespace printing {
namespace {
@@ -53,31 +55,31 @@ content::WebContents* GetWebContentsToUse(content::WebContents* contents) {
void StartPrint(content::WebContents* contents,
bool print_preview_disabled,
bool selection_only) {
-#if defined(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
using PrintViewManagerImpl = PrintViewManager;
#else
using PrintViewManagerImpl = PrintViewManagerBasic;
-#endif // defined(ENABLE_PRINT_PREVIEW)
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
auto* print_view_manager =
PrintViewManagerImpl::FromWebContents(GetWebContentsToUse(contents));
if (!print_view_manager)
return;
-#if defined(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (!print_preview_disabled) {
print_view_manager->PrintPreviewNow(selection_only);
return;
}
#endif // ENABLE_PRINT_PREVIEW
-#if defined(ENABLE_BASIC_PRINTING)
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
print_view_manager->PrintNow();
#endif // ENABLE_BASIC_PRINTING
}
-#if defined(ENABLE_BASIC_PRINTING)
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
void StartBasicPrint(content::WebContents* contents) {
-#if defined(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
PrintViewManager* print_view_manager =
PrintViewManager::FromWebContents(GetWebContentsToUse(contents));
if (!print_view_manager)
« no previous file with comments | « chrome/browser/printing/print_view_manager_common.h ('k') | chrome/browser/printing/printing_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698