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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 9762004: Block scripted printing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/print_messages.h ('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
===================================================================
--- chrome/renderer/print_web_view_helper.h (revision 127745)
+++ chrome/renderer/print_web_view_helper.h (working copy)
@@ -183,6 +183,8 @@
void OnPrintingDone(bool success);
+ void SetScriptedPrintBlocked(bool blocked);
+
// Main printing code -------------------------------------------------------
void Print(WebKit::WebFrame* frame, const WebKit::WebNode& node);
@@ -312,6 +314,9 @@
// Script Initiated Printing ------------------------------------------------
+ // Return true if script initiated printing is currently allowed.
+ bool IsScriptInitiatedPrintAllowed(WebKit::WebFrame* frame);
+
// Returns true if script initiated printing occurs too often.
bool IsScriptInitiatedPrintTooFrequent(WebKit::WebFrame* frame);
@@ -354,6 +359,7 @@
// 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
// the failure came from the browser in the first place.
« no previous file with comments | « chrome/common/print_messages.h ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698