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

Unified Diff: chrome/browser/local_discovery/privet_http_impl.cc

Issue 78173002: Pass PWG raster conversion settings from Preview to Converter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: chrome/browser/local_discovery/privet_http_impl.cc
diff --git a/chrome/browser/local_discovery/privet_http_impl.cc b/chrome/browser/local_discovery/privet_http_impl.cc
index 55cb05c7ba64608bbd5085e7563172a3f9dbfcf1..b9de4fe5fed142c937cc0f2070b8d14e27709e11 100644
--- a/chrome/browser/local_discovery/privet_http_impl.cc
+++ b/chrome/browser/local_discovery/privet_http_impl.cc
@@ -369,7 +369,6 @@ PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl(
: privet_client_(privet_client), delegate_(delegate),
use_pdf_(false), has_capabilities_(false), has_extended_workflow_(false),
started_(false), offline_(false), invalid_job_retries_(0),
- pwg_raster_converter_(PWGRasterConverter::CreateDefault()),
weak_factory_(this) {
}
@@ -512,8 +511,11 @@ void PrivetLocalPrintOperationImpl::StartPrinting() {
}
void PrivetLocalPrintOperationImpl::StartConvertToPWG() {
+ if (!pwg_raster_converter_)
+ pwg_raster_converter_ = PWGRasterConverter::CreateDefault();
pwg_raster_converter_->Start(
data_,
+ conversion_settings_,
base::Bind(&PrivetLocalPrintOperationImpl::OnPWGRasterConverted,
base::Unretained(this)));
}
@@ -531,8 +533,7 @@ void PrivetLocalPrintOperationImpl::OnCapabilitiesResponse(
if (value->GetList(kPrivetCDDKeySupportedContentTypes,
&supported_content_types)) {
- for (size_t i = 0; i < supported_content_types->GetSize();
- i++) {
+ for (size_t i = 0; i < supported_content_types->GetSize(); i++) {
const base::DictionaryValue* content_type_value;
std::string content_type;
@@ -673,6 +674,12 @@ void PrivetLocalPrintOperationImpl::SetOffline(bool offline) {
offline_ = offline;
}
+void PrivetLocalPrintOperationImpl::SetConversionSettings(
+ const printing::PdfRenderSettings& conversion_settings) {
+ DCHECK(!started_);
+ conversion_settings_ = conversion_settings;
+}
+
void PrivetLocalPrintOperationImpl::SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) {
pwg_raster_converter_ = pwg_raster_converter.Pass();
« no previous file with comments | « chrome/browser/local_discovery/privet_http_impl.h ('k') | chrome/browser/local_discovery/privet_http_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698