summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing/print_view_manager.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 23:37:55 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 23:37:55 +0000
commit87c0254db050a6df147be484e2496aaa4b4f95a1 (patch)
treef0db8c3d0ab2c5e92ae48e43cbf210ca1e3042dd /chrome/browser/printing/print_view_manager.cc
parent0fc9dca2aae7f778a5a43aee1f898af7d93b15b8 (diff)
downloadchromium_src-87c0254db050a6df147be484e2496aaa4b4f95a1.zip
chromium_src-87c0254db050a6df147be484e2496aaa4b4f95a1.tar.gz
chromium_src-87c0254db050a6df147be484e2496aaa4b4f95a1.tar.bz2
Roll back r8821
Review URL: http://codereview.chromium.org/19453 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing/print_view_manager.cc')
-rw-r--r--chrome/browser/printing/print_view_manager.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 436742a..6813a15 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -254,8 +254,14 @@ void PrintViewManager::OnNotifyPrintJobInitEvent(
owner_.render_view_host()->IsRenderViewLive() &&
(!old_print_params.Equals(print_params_) ||
!event_details.document()->page_count())) {
- // TODO(maruel): Will never happen, this code is about to be deleted.
- NOTREACHED();
+ // This will generate a DidGetPrintedPagesCount() callback.
+ if (!owner_.render_view_host()->GetPrintedPagesCount(print_params_)) {
+ NOTREACHED();
+ if (inside_inner_message_loop_) {
+ MessageLoop::current()->Quit();
+ return;
+ }
+ }
}
// Continue even if owner_.render_view_host() is dead because we may already
@@ -471,8 +477,10 @@ void PrintViewManager::PrintNowInternal() {
if (!print_job_->document() ||
!print_job_->document()->IsComplete()) {
- // TODO(maruel): Will never happen. This code is about to be deleted.
- NOTREACHED();
+ ViewMsg_PrintPages_Params params;
+ params.params = print_params_;
+ params.pages = PageRange::GetPages(print_job_->settings().ranges);
+ owner_.render_view_host()->PrintPages(params);
}
}