| 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
|
|
|