Chromium Code Reviews| Index: chrome/renderer/printing/print_web_view_helper.cc |
| diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc |
| index cd318a23956851c0337b17716dfce50090de5f6a..351d49ae41f32978c54382c7dee757297be7d634 100644 |
| --- a/chrome/renderer/printing/print_web_view_helper.cc |
| +++ b/chrome/renderer/printing/print_web_view_helper.cc |
| @@ -62,17 +62,18 @@ enum PrintPreviewHelperEvents { |
| const double kMinDpi = 1.0; |
| +#if defined(ENABLE_PRINT_PREVIEW) |
| const char kPageLoadScriptFormat[] = |
| "document.open(); document.write(%s); document.close();"; |
| const char kPageSetupScriptFormat[] = "setup(%s);"; |
| -#if defined(ENABLE_PRINT_PREVIEW) |
| bool g_is_preview_enabled_ = true; |
| #else |
| bool g_is_preview_enabled_ = false; |
| #endif |
|
Vitaly Buka (NO REVIEWS)
2014/11/06 19:34:24
why not to combine both blocks?
newt (away)
2014/11/06 19:50:38
Done.
|
| +#if defined(ENABLE_PRINT_PREVIEW) |
| void ExecuteScript(blink::WebFrame* frame, |
| const char* script_format, |
| const base::Value& parameters) { |
| @@ -81,6 +82,7 @@ void ExecuteScript(blink::WebFrame* frame, |
| std::string script = base::StringPrintf(script_format, json.c_str()); |
| frame->executeScript(blink::WebString(base::UTF8ToUTF16(script))); |
| } |
| +#endif // defined(ENABLE_PRINT_PREVIEW) |
| int GetDPI(const PrintMsg_Print_Params* print_params) { |
| #if defined(OS_MACOSX) |
| @@ -443,6 +445,7 @@ blink::WebView* FrameReference::view() { |
| return view_; |
| } |
| +#if defined(ENABLE_PRINT_PREVIEW) |
| // static - Not anonymous so that platform implementations can use it. |
| void PrintWebViewHelper::PrintHeaderAndFooter( |
| blink::WebCanvas* canvas, |
| @@ -505,6 +508,7 @@ void PrintWebViewHelper::PrintHeaderAndFooter( |
| device->setDrawingArea(SkPDFDevice::kContent_DrawingArea); |
| } |
| +#endif // defined(ENABLE_PRINT_PREVIEW) |
| // static - Not anonymous so that platform implementations can use it. |
| float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame, |