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

Unified Diff: printing/printing_context.cc

Issue 294923005: Add media size capability to PDF printer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment to the new query stopping code. Created 6 years, 7 months 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: printing/printing_context.cc
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index 817d59c93b283cc974b581b78e03cd364356ef01..8d438d0594a1ae3b09c536c384ac10f7a7384ef1 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -48,6 +48,24 @@ PrintingContext::Result PrintingContext::OnError() {
return abort_printing_ ? CANCEL : FAILED;
}
+PrintingContext::Result PrintingContext::UsePdfSettings() {
+ scoped_ptr<base::DictionaryValue> pdf_settings(new base::DictionaryValue);
+ pdf_settings->SetBoolean(kSettingHeaderFooterEnabled, false);
+ pdf_settings->SetBoolean(kSettingShouldPrintBackgrounds, false);
+ pdf_settings->SetBoolean(kSettingShouldPrintSelectionOnly, false);
+ pdf_settings->SetInteger(kSettingMarginsType, printing::NO_MARGINS);
+ pdf_settings->SetBoolean(kSettingCollate, true);
+ pdf_settings->SetInteger(kSettingCopies, 1);
+ pdf_settings->SetInteger(kSettingColor, printing::COLOR);
+ pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX);
+ pdf_settings->SetBoolean(kSettingLandscape, false);
+ pdf_settings->SetString(kSettingDeviceName, "");
+ pdf_settings->SetBoolean(kSettingPrintToPDF, true);
+ pdf_settings->SetBoolean(kSettingCloudPrintDialog, false);
+ pdf_settings->SetBoolean(kSettingPrintWithPrivet, false);
+ return UpdatePrintSettings(*pdf_settings, PageRanges());
+}
+
PrintingContext::Result PrintingContext::UpdatePrintSettings(
const base::DictionaryValue& job_settings,
const PageRanges& ranges) {

Powered by Google App Engine
This is Rietveld 408576698