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 dd8d24d5b42458d47c615562d768d84f8d291e8f..295de64afd2bfa99efbc2acfef0ae1495eab7e50 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" |
@@ -138,7 +139,7 @@ class PrintWebViewHelper |
OK, |
FAIL_PRINT_INIT, |
FAIL_PRINT, |
-#if defined(ENABLE_PRINT_PREVIEW) |
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
FAIL_PREVIEW, |
#endif |
}; |
@@ -170,15 +171,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 |
@@ -191,7 +192,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(); |
@@ -208,7 +209,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. |
@@ -216,12 +217,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); |
@@ -237,7 +238,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); |
@@ -248,7 +249,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. |
@@ -259,7 +260,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); |
@@ -267,7 +268,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) |
@@ -323,7 +324,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, |
@@ -333,7 +334,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); |
@@ -345,7 +346,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(); |
@@ -361,7 +362,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); |