OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/printing/print_job.h" | 5 #include "chrome/browser/printing/print_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ptd_to_emf_state_.reset(); | 287 ptd_to_emf_state_.reset(); |
288 Cancel(); | 288 Cancel(); |
289 return; | 289 return; |
290 } | 290 } |
291 ptd_to_emf_state_->set_page_count(page_count); | 291 ptd_to_emf_state_->set_page_count(page_count); |
292 ptd_to_emf_state_->GetMorePages( | 292 ptd_to_emf_state_->GetMorePages( |
293 base::Bind(&PrintJob::OnPdfToEmfPageConverted, this)); | 293 base::Bind(&PrintJob::OnPdfToEmfPageConverted, this)); |
294 } | 294 } |
295 | 295 |
296 void PrintJob::OnPdfToEmfPageConverted(int page_number, | 296 void PrintJob::OnPdfToEmfPageConverted(int page_number, |
297 double scale_factor, | 297 float scale_factor, |
298 scoped_ptr<MetafilePlayer> emf) { | 298 scoped_ptr<MetafilePlayer> emf) { |
299 DCHECK(ptd_to_emf_state_); | 299 DCHECK(ptd_to_emf_state_); |
300 if (!document_.get() || !emf) { | 300 if (!document_.get() || !emf) { |
301 ptd_to_emf_state_.reset(); | 301 ptd_to_emf_state_.reset(); |
302 Cancel(); | 302 Cancel(); |
303 return; | 303 return; |
304 } | 304 } |
305 | 305 |
306 // Update the rendered document. It will send notifications to the listener. | 306 // Update the rendered document. It will send notifications to the listener. |
307 document_->SetPage(page_number, | 307 document_->SetPage(page_number, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 453 } |
454 | 454 |
455 JobEventDetails::~JobEventDetails() { | 455 JobEventDetails::~JobEventDetails() { |
456 } | 456 } |
457 | 457 |
458 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 458 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
459 | 459 |
460 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 460 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
461 | 461 |
462 } // namespace printing | 462 } // namespace printing |
OLD | NEW |