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

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: Removed an unused include 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..0b71906c4140cc8f0efa584bf6d7734f661a89ca 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/chrome/renderer/printing/print_web_view_helper.h
@@ -66,7 +66,25 @@ class PrintWebViewHelper
: public content::RenderViewObserver,
public content::RenderViewObserverTracker<PrintWebViewHelper> {
public:
- explicit PrintWebViewHelper(content::RenderView* render_view);
+
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+
+ // Cancels prerender if it's currently in progress and returns |true| if
+ // the cancellation was done with success.
+ virtual bool CancelPrerender(content::RenderView* render_view,
+ int routing_id) = 0;
+
+ // Returns the element to be printed. Returns a null WebElement if
+ // a pdf plugin element can't be extracted from the frame.
+ virtual blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) = 0;
+ };
+
+ PrintWebViewHelper(content::RenderView* render_view,
+ bool out_of_process_pdf_enabled,
+ bool print_preview_disabled,
+ scoped_ptr<Delegate> delegate);
~PrintWebViewHelper() override;
// Disable print preview and switch to system dialog printing even if full
@@ -327,6 +345,12 @@ 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 check the prerendering status.
+ const scoped_ptr<Delegate> 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