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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 10890054: Reign in print throttling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase only Created 8 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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.h
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 1180a5dcaa891f970c5ec8c81fa620a7ff5c7650..c30677d4a9114d344100650565b13ffe45544621 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -138,7 +138,7 @@ class PrintWebViewHelper
// RenderViewObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- virtual void PrintPage(WebKit::WebFrame* frame) OVERRIDE;
+ virtual void PrintPage(WebKit::WebFrame* frame, bool user_initiated) OVERRIDE;
// Message handlers ---------------------------------------------------------
@@ -331,8 +331,11 @@ class PrintWebViewHelper
// Script Initiated Printing ------------------------------------------------
- // Return true if script initiated printing is currently allowed.
- bool IsScriptInitiatedPrintAllowed(WebKit::WebFrame* frame);
+ // Return true if script initiated printing is currently
+ // allowed. |user_initiated| should be true when a user event triggered the
+ // script, most likely by pressing a print button on the page.
+ bool IsScriptInitiatedPrintAllowed(WebKit::WebFrame* frame,
+ bool user_initiated);
// Returns true if script initiated printing occurs too often.
bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame);
@@ -363,6 +366,7 @@ class PrintWebViewHelper
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_;
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698