Index: components/printing/renderer/print_web_view_helper.h |
diff --git a/components/printing/renderer/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h |
index 03e222d60c80fbe6c1dbb4a58ab14eb1e3c822d3..510b912e3c3353472a472a4826efc0c59f5327c4 100644 |
--- a/components/printing/renderer/print_web_view_helper.h |
+++ b/components/printing/renderer/print_web_view_helper.h |
@@ -17,6 +17,7 @@ |
#include "build/build_config.h" |
#include "content/public/renderer/render_view_observer.h" |
#include "content/public/renderer/render_view_observer_tracker.h" |
+#include "printing/features/features.h" |
#include "printing/pdf_metafile_skia.h" |
#include "third_party/WebKit/public/platform/WebCanvas.h" |
#include "third_party/WebKit/public/web/WebNode.h" |
@@ -143,7 +144,7 @@ class PrintWebViewHelper |
OK, |
FAIL_PRINT_INIT, |
FAIL_PRINT, |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
FAIL_PREVIEW, |
#endif |
}; |
@@ -175,15 +176,15 @@ class PrintWebViewHelper |
void OnDestruct() override; |
// Message handlers --------------------------------------------------------- |
-#if defined(ENABLE_BASIC_PRINTING) |
+#if BUILDFLAG(ENABLE_BASIC_PRINTING) |
void OnPrintPages(); |
void OnPrintForSystemDialog(); |
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); |
-#endif // defined(ENABLE_BASIC_PRINTING) |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
void OnInitiatePrintPreview(bool selection_only); |
void OnPrintPreview(const base::DictionaryValue& settings); |
-#endif // defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
void OnPrintingDone(bool success); |
// Get |page_size| and |content_area| information from |
@@ -196,7 +197,7 @@ class PrintWebViewHelper |
// Update |ignore_css_margins_| based on settings. |
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Prepare frame for creating preview document. |
void PrepareFrameForPreviewDocument(); |
@@ -213,7 +214,7 @@ class PrintWebViewHelper |
// Finalize the print ready preview document. |
bool FinalizePrintReadyDocument(); |
-#endif // defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Enable/Disable window.print calls. If |blocked| is true window.print |
// calls will silently fail. Call with |blocked| set to false to reenable. |
@@ -221,12 +222,12 @@ class PrintWebViewHelper |
// Main printing code ------------------------------------------------------- |
-#if defined(ENABLE_BASIC_PRINTING) |
+#if BUILDFLAG(ENABLE_BASIC_PRINTING) |
// |is_scripted| should be true when the call is coming from window.print() |
void Print(blink::WebLocalFrame* frame, |
const blink::WebNode& node, |
bool is_scripted); |
-#endif // defined(ENABLE_BASIC_PRINTING) |
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
// Notification when printing is done - signal tear-down/free resources. |
void DidFinishPrinting(PrintingResult result); |
@@ -242,7 +243,7 @@ class PrintWebViewHelper |
const blink::WebNode& node, |
int* number_of_pages); |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Set options for print preset from source PDF document. |
bool SetOptionsFromPdfDocument( |
PrintHostMsg_SetOptionsFromDocument_Params* options); |
@@ -253,7 +254,7 @@ class PrintWebViewHelper |
bool UpdatePrintSettings(blink::WebLocalFrame* frame, |
const blink::WebNode& node, |
const base::DictionaryValue& passed_job_settings); |
-#endif // defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Get final print settings from the user. |
// Return false if the user cancels or on error. |
@@ -264,7 +265,7 @@ class PrintWebViewHelper |
// Page Printing / Rendering ------------------------------------------------ |
-#if defined(ENABLE_BASIC_PRINTING) |
+#if BUILDFLAG(ENABLE_BASIC_PRINTING) |
void OnFramePreparedForPrintPages(); |
void PrintPages(); |
bool PrintPagesNative(blink::WebLocalFrame* frame, int page_count); |
@@ -272,7 +273,7 @@ class PrintWebViewHelper |
// Render the frame for printing. |
bool RenderPagesForPrint(blink::WebLocalFrame* frame, |
const blink::WebNode& node); |
-#endif // defined(ENABLE_BASIC_PRINTING) |
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
// Prints the page listed in |params|. |
#if defined(OS_MACOSX) |
@@ -328,7 +329,7 @@ class PrintWebViewHelper |
const PrintMsg_PrintPages_Params& params, |
int page_count); |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Given the |device| and |canvas| to draw on, prints the appropriate headers |
// and footers using strings from |header_footer_info| on to the canvas. |
static void PrintHeaderAndFooter(blink::WebCanvas* canvas, |
@@ -338,7 +339,7 @@ class PrintWebViewHelper |
float webkit_scale_factor, |
const PageSizeMargins& page_layout_in_points, |
const PrintMsg_Print_Params& params); |
-#endif // defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
bool GetPrintFrame(blink::WebLocalFrame** frame); |
@@ -350,7 +351,7 @@ class PrintWebViewHelper |
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame, |
bool user_initiated); |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
// Shows scripted print preview when options from plugin are available. |
void ShowScriptedPrintPreview(); |
@@ -366,7 +367,7 @@ class PrintWebViewHelper |
// |metafile| is the rendered page. Otherwise |metafile| is NULL. |
// Returns true if print preview should continue, false on failure. |
bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); |
-#endif // defined(ENABLE_PRINT_PREVIEW) |
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); |