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

Side by Side Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: improve comments as suggested Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 } 888 }
889 889
890 bool PrintWebViewHelper::Delegate::IsAskPrintSettingsEnabled() { 890 bool PrintWebViewHelper::Delegate::IsAskPrintSettingsEnabled() {
891 return true; 891 return true;
892 } 892 }
893 893
894 bool PrintWebViewHelper::Delegate::IsScriptedPrintEnabled() { 894 bool PrintWebViewHelper::Delegate::IsScriptedPrintEnabled() {
895 return true; 895 return true;
896 } 896 }
897 897
898 #if defined(OS_MACOSX)
899 bool PrintWebViewHelper::Delegate::UseSingleMetafile() {
900 return false;
901 }
902 #endif
903
898 PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame, 904 PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
899 std::unique_ptr<Delegate> delegate) 905 std::unique_ptr<Delegate> delegate)
900 : content::RenderFrameObserver(render_frame), 906 : content::RenderFrameObserver(render_frame),
901 content::RenderFrameObserverTracker<PrintWebViewHelper>(render_frame), 907 content::RenderFrameObserverTracker<PrintWebViewHelper>(render_frame),
902 reset_prep_frame_view_(false), 908 reset_prep_frame_view_(false),
903 is_print_ready_metafile_sent_(false), 909 is_print_ready_metafile_sent_(false),
904 ignore_css_margins_(false), 910 ignore_css_margins_(false),
905 is_printing_enabled_(true), 911 is_printing_enabled_(true),
906 notify_browser_of_print_failure_(true), 912 notify_browser_of_print_failure_(true),
907 print_for_preview_(false), 913 print_for_preview_(false),
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 blink::WebConsoleMessage::LevelWarning, message)); 2374 blink::WebConsoleMessage::LevelWarning, message));
2369 return false; 2375 return false;
2370 } 2376 }
2371 2377
2372 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2378 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2373 // Reset counter on successful print. 2379 // Reset counter on successful print.
2374 count_ = 0; 2380 count_ = 0;
2375 } 2381 }
2376 2382
2377 } // namespace printing 2383 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698