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

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

Issue 550033002: Fixed print_web_view_helper for CEF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Sep 8 02:31:11 PDT 2014 Created 6 years, 3 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 4ce36b87be3db316141dd015ac3fb4bedd2cc58a..b51b9721a010cdea5ef1c407a5c446e98ee87fab 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/chrome/renderer/printing/print_web_view_helper.h
@@ -66,7 +66,9 @@ class PrintWebViewHelper
: public content::RenderViewObserver,
public content::RenderViewObserverTracker<PrintWebViewHelper> {
public:
- explicit PrintWebViewHelper(content::RenderView* render_view);
+ PrintWebViewHelper(content::RenderView* render_view,
+ bool preview_enabled,
+ bool scripted_print_throttling_disabled);
virtual ~PrintWebViewHelper();
bool IsPrintingEnabled();
@@ -284,13 +286,24 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame,
bool user_initiated);
- // Shows scripted print preview when options from plugin are available.
+ // Returns true if script initiated printing occurs too often.
+ bool IsScriptInitiatedPrintTooFrequent(blink::WebFrame* frame);
+
+ // Reset the counter for script initiated printing.
+ // Scripted printing will be allowed to continue.
+ void ResetScriptedPrintCount();
+
+ // Increment the counter for script initiated printing.
+ // Scripted printing will be blocked for a limited amount of time.
+ void IncrementScriptedPrintCount();
+
+ // Shows scripted print preview when options from plugin are availible.
void ShowScriptedPrintPreview();
void RequestPrintPreview(PrintPreviewRequestType type);
// Checks whether print preview should continue or not.
- // Returns true if canceling, false if continuing.
+ // Returns true if cancelling, false if continuing.
bool CheckForCancel();
// Notifies the browser a print preview page has been rendered.
@@ -307,9 +320,14 @@ class PrintWebViewHelper
bool reset_prep_frame_view_;
scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
+ bool is_preview_enabled_;
+ bool is_scripted_print_throttling_disabled_;
bool is_print_ready_metafile_sent_;
bool ignore_css_margins_;
+
// Used for scripted initiated printing blocking.
+ base::Time last_cancelled_script_print_;
+ int user_cancelled_scripted_print_count_;
bool is_scripted_printing_blocked_;
// Let the browser process know of a printing failure. Only set to false when
« no previous file with comments | « no previous file | chrome/renderer/printing/print_web_view_helper.cc » ('j') | chrome/renderer/printing/print_web_view_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698