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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 PdfConversionState(gfx::Size page_size, gfx::Rect content_area) | 227 PdfConversionState(gfx::Size page_size, gfx::Rect content_area) |
228 : page_count_(0), | 228 : page_count_(0), |
229 current_page_(0), | 229 current_page_(0), |
230 pages_in_progress_(0), | 230 pages_in_progress_(0), |
231 page_size_(page_size), | 231 page_size_(page_size), |
232 content_area_(content_area) {} | 232 content_area_(content_area) {} |
233 | 233 |
234 void Start(const scoped_refptr<base::RefCountedMemory>& data, | 234 void Start(const scoped_refptr<base::RefCountedMemory>& data, |
235 const PdfRenderSettings& conversion_settings, | 235 const PdfRenderSettings& conversion_settings, |
236 const PdfConverter::StartCallback& start_callback) { | 236 const PdfConverter::StartCallback& start_callback) { |
237 converter_ = std::move(PdfConverter::StartPdfToEmfConverter( | 237 converter_ = std::move(PdfConverter::StartConverter( |
238 data, conversion_settings, start_callback)); | 238 data, conversion_settings, start_callback)); |
239 } | 239 } |
240 | 240 |
241 void GetMorePages(const PdfConverter::GetPageCallback& get_page_callback) { | 241 void GetMorePages(const PdfConverter::GetPageCallback& get_page_callback) { |
242 const int kMaxNumberOfTempFilesPerDocument = 3; | 242 const int kMaxNumberOfTempFilesPerDocument = 3; |
243 while (pages_in_progress_ < kMaxNumberOfTempFilesPerDocument && | 243 while (pages_in_progress_ < kMaxNumberOfTempFilesPerDocument && |
244 current_page_ < page_count_) { | 244 current_page_ < page_count_) { |
245 ++pages_in_progress_; | 245 ++pages_in_progress_; |
246 converter_->GetPage(current_page_++, get_page_callback); | 246 converter_->GetPage(current_page_++, get_page_callback); |
247 } | 247 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 474 } |
475 | 475 |
476 JobEventDetails::~JobEventDetails() { | 476 JobEventDetails::~JobEventDetails() { |
477 } | 477 } |
478 | 478 |
479 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 479 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
480 | 480 |
481 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 481 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
482 | 482 |
483 } // namespace printing | 483 } // namespace printing |
OLD | NEW |