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

Unified Diff: chrome/renderer/printing/print_web_view_helper.h

Issue 791133006: Delegates for the printing component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pdf_extension_id as std::string, changed back the delegate ownership Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/printing/print_web_view_helper.h
diff --git a/chrome/renderer/printing/print_web_view_helper.h b/chrome/renderer/printing/print_web_view_helper.h
index 9ba081094ee0b3c506e37d4a080a2e831b8cb37a..4af90de4472058f0d8951c5a56212e7191059509 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/chrome/renderer/printing/print_web_view_helper.h
@@ -66,7 +66,19 @@ class PrintWebViewHelper
: public content::RenderViewObserver,
public content::RenderViewObserverTracker<PrintWebViewHelper> {
public:
- explicit PrintWebViewHelper(content::RenderView* render_view);
+
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ virtual bool CancelPrerender(content::RenderView* render_view,
+ int routing_id) = 0;
+ };
+
+ PrintWebViewHelper(content::RenderView* render_view,
+ bool out_of_process_pdf_enabled,
+ bool print_preview_disabled,
+ const std::string& pdf_extension_id,
+ Delegate* delegate);
~PrintWebViewHelper() override;
// Disable print preview and switch to system dialog printing even if full
@@ -327,6 +339,16 @@ class PrintWebViewHelper
// True, when printing from print preview.
bool print_for_preview_;
+ // Whether the content to print could be nested in an iframe.
+ const bool out_of_process_pdf_enabled_;
+
+ // Used to test if the nested iframe holding the content to print is the
+ // pdf extension. Only used when |ENABLE_EXTENSIONS| is defined.
+ const std::string& pdf_extension_id_;
+
+ // Used to check the prerendering status.
+ Delegate* const delegate_;
+
// Keeps track of the state of print preview between messages.
// TODO(vitalybuka): Create PrintPreviewContext when needed and delete after
// use. Now it's interaction with various messages is confusing.

Powered by Google App Engine
This is Rietveld 408576698