| Index: chrome/browser/printing/print_view_manager.h
|
| diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
|
| index 58fcefbc900a70aff0b5347d7a67eb7b6456a77e..7dd12205bd4af56b6c2ac95d32a3958d45e6bb0c 100644
|
| --- a/chrome/browser/printing/print_view_manager.h
|
| +++ b/chrome/browser/printing/print_view_manager.h
|
| @@ -13,7 +13,7 @@
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "printing/printed_pages_source.h"
|
|
|
| -class RenderViewHost;
|
| +class RenderProcessHost;
|
| class TabContentsWrapper;
|
| struct PrintHostMsg_DidPrintPage_Params;
|
|
|
| @@ -53,6 +53,10 @@ class PrintViewManager : public content::NotificationObserver,
|
| // print preview is impossible at the moment.
|
| bool PrintPreviewNow();
|
|
|
| + // Notify PrintViewManager that print preview has finished. Unfreeze the
|
| + // renderer in the case of scripted print preview.
|
| + void PrintPreviewDone();
|
| +
|
| // Handles cancelled preview printing request.
|
| void PreviewPrintingRequestCancelled();
|
|
|
| @@ -79,6 +83,12 @@ class PrintViewManager : public content::NotificationObserver,
|
| virtual void StopNavigation();
|
|
|
| private:
|
| + enum PrintPreviewState {
|
| + NOT_PREVIEWING,
|
| + USER_INITIATED_PREVIEW,
|
| + SCRIPTED_PREVIEW,
|
| + };
|
| +
|
| // IPC Message handlers.
|
| void OnDidGetPrintedPagesCount(int cookie, int number_pages);
|
| void OnDidGetDocumentCookie(int cookie);
|
| @@ -86,6 +96,9 @@ class PrintViewManager : public content::NotificationObserver,
|
| void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params);
|
| void OnPrintingFailed(int cookie);
|
|
|
| + void OnScriptedPrintPreview(IPC::Message* reply_msg);
|
| + void OnScriptedPrintPreviewReply(IPC::Message* reply_msg);
|
| +
|
| // Processes a NOTIFY_PRINT_JOB_EVENT notification.
|
| void OnNotifyPrintJobEvent(const JobEventDetails& event_details);
|
|
|
| @@ -168,6 +181,12 @@ class PrintViewManager : public content::NotificationObserver,
|
| // The document cookie of the current PrinterQuery.
|
| int cookie_;
|
|
|
| + // Current state of print preview for this view.
|
| + PrintPreviewState print_preview_state_;
|
| +
|
| + // Keeps track of the pending callback during scripted print preview.
|
| + RenderProcessHost* scripted_print_preview_rph_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PrintViewManager);
|
| };
|
|
|
|
|