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

Unified Diff: chrome/browser/printing/print_view_manager.h

Issue 7202012: Print Preview: Display a throbber when the user requests the system print (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add missing file. Created 9 years, 6 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/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 308400dba0323195c7feab8b33675c8640ceaa6a..7dbabf0a853d2002f27caf9844ab3bf4a7482123 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -22,6 +22,7 @@ namespace printing {
class JobEventDetails;
class PrintJob;
class PrintJobWorkerOwner;
+class PrintViewManagerDelegate;
// Manages the print commands in relation to a TabContents. TabContents
// delegates a few printing related commands to this instance.
@@ -38,8 +39,10 @@ class PrintViewManager : public NotificationObserver,
// Prints the current document immediately. Since the rendering is
// asynchronous, the actual printing will not be completed on the return of
- // this function. Returns false if printing is impossible at the moment.
- bool PrintNow();
+ // this function. |delegate| is optional and may be used to be notified when
+ // the print dialog is shown. Returns false if printing is impossible at the
+ // moment.
+ bool PrintNow(PrintViewManagerDelegate* delegate);
Lei Zhang 2011/06/21 01:54:46 Since we expect |delegate| to be NULL most of the
James Hawkins 2011/06/22 23:47:24 I'd rather not, as that complicates the API unnece
// Initiate print preview of the current document by first notifying the
// renderer. Since this happens asynchronous, the print preview tab creation
@@ -71,6 +74,7 @@ class PrintViewManager : public NotificationObserver,
private:
// IPC Message handlers.
void OnDidGetPrintedPagesCount(int cookie, int number_pages);
+ void OnDidShowPrintDialog();
void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params);
void OnPrintingFailed(int cookie);
@@ -150,6 +154,9 @@ class PrintViewManager : public NotificationObserver,
bool is_title_overridden_;
string16 overridden_title_;
+ // Weak pointer to a delegate that is notified when the print dialog is shown.
+ PrintViewManagerDelegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(PrintViewManager);
};

Powered by Google App Engine
This is Rietveld 408576698