| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "printing/printing_context.h" | 5 #include "printing/printing_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "printing/features/features.h" | 9 #include "printing/features/features.h" |
| 10 #include "printing/page_setup.h" | 10 #include "printing/page_setup.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 PrintingContext::Result PrintingContext::UsePdfSettings() { | 58 PrintingContext::Result PrintingContext::UsePdfSettings() { |
| 59 std::unique_ptr<base::DictionaryValue> pdf_settings( | 59 std::unique_ptr<base::DictionaryValue> pdf_settings( |
| 60 new base::DictionaryValue); | 60 new base::DictionaryValue); |
| 61 pdf_settings->SetBoolean(kSettingHeaderFooterEnabled, false); | 61 pdf_settings->SetBoolean(kSettingHeaderFooterEnabled, false); |
| 62 pdf_settings->SetBoolean(kSettingShouldPrintBackgrounds, false); | 62 pdf_settings->SetBoolean(kSettingShouldPrintBackgrounds, false); |
| 63 pdf_settings->SetBoolean(kSettingShouldPrintSelectionOnly, false); | 63 pdf_settings->SetBoolean(kSettingShouldPrintSelectionOnly, false); |
| 64 pdf_settings->SetInteger(kSettingMarginsType, printing::NO_MARGINS); | 64 pdf_settings->SetInteger(kSettingMarginsType, printing::NO_MARGINS); |
| 65 pdf_settings->SetBoolean(kSettingCollate, true); | 65 pdf_settings->SetBoolean(kSettingCollate, true); |
| 66 pdf_settings->SetInteger(kSettingCopies, 1); | 66 pdf_settings->SetInteger(kSettingCopies, 1); |
| 67 pdf_settings->SetInteger(kSettingColor, printing::COLOR); | 67 pdf_settings->SetInteger(kSettingColor, printing::COLOR); |
| 68 pdf_settings->SetInteger(kSettingDpiHorizontal, kPointsPerInch); |
| 69 pdf_settings->SetInteger(kSettingDpiVertical, kPointsPerInch); |
| 68 pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX); | 70 pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX); |
| 69 pdf_settings->SetBoolean(kSettingLandscape, false); | 71 pdf_settings->SetBoolean(kSettingLandscape, false); |
| 70 pdf_settings->SetString(kSettingDeviceName, ""); | 72 pdf_settings->SetString(kSettingDeviceName, ""); |
| 71 pdf_settings->SetBoolean(kSettingPrintToPDF, true); | 73 pdf_settings->SetBoolean(kSettingPrintToPDF, true); |
| 72 pdf_settings->SetBoolean(kSettingCloudPrintDialog, false); | 74 pdf_settings->SetBoolean(kSettingCloudPrintDialog, false); |
| 73 pdf_settings->SetBoolean(kSettingPrintWithPrivet, false); | 75 pdf_settings->SetBoolean(kSettingPrintWithPrivet, false); |
| 74 pdf_settings->SetBoolean(kSettingPrintWithExtension, false); | 76 pdf_settings->SetBoolean(kSettingPrintWithExtension, false); |
| 75 pdf_settings->SetInteger(kSettingScaleFactor, 100); | 77 pdf_settings->SetInteger(kSettingScaleFactor, 100); |
| 76 pdf_settings->SetBoolean(kSettingRasterizePdf, false); | 78 pdf_settings->SetBoolean(kSettingRasterizePdf, false); |
| 77 return UpdatePrintSettings(*pdf_settings); | 79 return UpdatePrintSettings(*pdf_settings); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 #endif | 135 #endif |
| 134 | 136 |
| 135 int page_count = 0; | 137 int page_count = 0; |
| 136 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); | 138 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); |
| 137 | 139 |
| 138 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, | 140 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, |
| 139 page_count); | 141 page_count); |
| 140 } | 142 } |
| 141 | 143 |
| 142 } // namespace printing | 144 } // namespace printing |
| OLD | NEW |