| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 float scale_factor, | 301 float scale_factor, |
| 302 scoped_ptr<MetafilePlayer> emf) { | 302 scoped_ptr<MetafilePlayer> emf) { |
| 303 DCHECK(ptd_to_emf_state_); | 303 DCHECK(ptd_to_emf_state_); |
| 304 if (!document_.get() || !emf) { | 304 if (!document_.get() || !emf) { |
| 305 ptd_to_emf_state_.reset(); | 305 ptd_to_emf_state_.reset(); |
| 306 Cancel(); | 306 Cancel(); |
| 307 return; | 307 return; |
| 308 } | 308 } |
| 309 | 309 |
| 310 // Update the rendered document. It will send notifications to the listener. | 310 // Update the rendered document. It will send notifications to the listener. |
| 311 document_->SetPage(page_number, | 311 document_->SetPage(page_number, std::move(emf), scale_factor, |
| 312 emf.Pass(), | |
| 313 scale_factor, | |
| 314 ptd_to_emf_state_->page_size(), | 312 ptd_to_emf_state_->page_size(), |
| 315 ptd_to_emf_state_->content_area()); | 313 ptd_to_emf_state_->content_area()); |
| 316 | 314 |
| 317 ptd_to_emf_state_->GetMorePages( | 315 ptd_to_emf_state_->GetMorePages( |
| 318 base::Bind(&PrintJob::OnPdfToEmfPageConverted, this)); | 316 base::Bind(&PrintJob::OnPdfToEmfPageConverted, this)); |
| 319 } | 317 } |
| 320 | 318 |
| 321 #endif // OS_WIN | 319 #endif // OS_WIN |
| 322 | 320 |
| 323 void PrintJob::UpdatePrintedDocument(PrintedDocument* new_document) { | 321 void PrintJob::UpdatePrintedDocument(PrintedDocument* new_document) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 455 } |
| 458 | 456 |
| 459 JobEventDetails::~JobEventDetails() { | 457 JobEventDetails::~JobEventDetails() { |
| 460 } | 458 } |
| 461 | 459 |
| 462 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 460 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
| 463 | 461 |
| 464 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 462 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
| 465 | 463 |
| 466 } // namespace printing | 464 } // namespace printing |
| OLD | NEW |