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

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

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: Review fix. 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
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | chrome/browser/printing/print_view_manager_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.cc
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 65b63f0e4e34ab0989f4ed0b11a03b234e9b57ad..3fa10e1c28b9a3730e1f4800c607eee3ed59b8a3 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_preview_tab_controller.h"
#include "chrome/browser/printing/printer_query.h"
+#include "chrome/browser/printing/print_view_manager_observer.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/webui/print_preview_ui.h"
#include "chrome/common/print_messages.h"
@@ -47,7 +48,8 @@ PrintViewManager::PrintViewManager(TabContentsWrapper* tab)
number_pages_(0),
printing_succeeded_(false),
inside_inner_message_loop_(false),
- is_title_overridden_(false) {
+ is_title_overridden_(false),
+ observer_(NULL) {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
expecting_first_page_ = true;
#endif
@@ -80,6 +82,11 @@ void PrintViewManager::PreviewPrintingRequestCancelled() {
rvh->Send(new PrintMsg_PreviewPrintingRequestCancelled(rvh->routing_id()));
}
+void PrintViewManager::set_observer(PrintViewManagerObserver* observer) {
+ DCHECK(!observer || !observer_);
+ observer_ = observer;
+}
+
void PrintViewManager::StopNavigation() {
// Cancel the current job, wait for the worker to finish.
TerminatePrintJob(true);
@@ -123,6 +130,11 @@ void PrintViewManager::OnDidGetPrintedPagesCount(int cookie, int number_pages) {
OpportunisticallyCreatePrintJob(cookie);
}
+void PrintViewManager::OnDidShowPrintDialog() {
+ if (observer_)
+ observer_->OnPrintDialogShown();
+}
+
void PrintViewManager::OnDidPrintPage(
const PrintHostMsg_DidPrintPage_Params& params) {
if (!OpportunisticallyCreatePrintJob(params.document_cookie))
@@ -205,6 +217,7 @@ bool PrintViewManager::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(PrintViewManager, message)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPrintedPagesCount,
OnDidGetPrintedPagesCount)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidShowPrintDialog, OnDidShowPrintDialog)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage)
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintingFailed, OnPrintingFailed)
IPC_MESSAGE_UNHANDLED(handled = false)
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | chrome/browser/printing/print_view_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698