| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(kSettingDuplexMode, printing::SIMPLEX); | 68 pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX); |
| 69 pdf_settings->SetBoolean(kSettingLandscape, false); | 69 pdf_settings->SetBoolean(kSettingLandscape, false); |
| 70 pdf_settings->SetString(kSettingDeviceName, ""); | 70 pdf_settings->SetString(kSettingDeviceName, ""); |
| 71 pdf_settings->SetBoolean(kSettingPrintToPDF, true); | 71 pdf_settings->SetBoolean(kSettingPrintToPDF, true); |
| 72 pdf_settings->SetBoolean(kSettingCloudPrintDialog, false); | 72 pdf_settings->SetBoolean(kSettingCloudPrintDialog, false); |
| 73 pdf_settings->SetBoolean(kSettingPrintWithPrivet, false); | 73 pdf_settings->SetBoolean(kSettingPrintWithPrivet, false); |
| 74 pdf_settings->SetBoolean(kSettingPrintWithExtension, false); | 74 pdf_settings->SetBoolean(kSettingPrintWithExtension, false); |
| 75 pdf_settings->SetInteger(kSettingScaleFactor, 100); | 75 pdf_settings->SetInteger(kSettingScaleFactor, 100); |
| 76 pdf_settings->SetBoolean(kSettingRasterizePdf, false); |
| 76 return UpdatePrintSettings(*pdf_settings); | 77 return UpdatePrintSettings(*pdf_settings); |
| 77 } | 78 } |
| 78 | 79 |
| 79 PrintingContext::Result PrintingContext::UpdatePrintSettings( | 80 PrintingContext::Result PrintingContext::UpdatePrintSettings( |
| 80 const base::DictionaryValue& job_settings) { | 81 const base::DictionaryValue& job_settings) { |
| 81 ResetSettings(); | 82 ResetSettings(); |
| 82 | 83 |
| 83 if (!PrintSettingsFromJobSettings(job_settings, &settings_)) { | 84 if (!PrintSettingsFromJobSettings(job_settings, &settings_)) { |
| 84 NOTREACHED(); | 85 NOTREACHED(); |
| 85 return OnError(); | 86 return OnError(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 #endif | 133 #endif |
| 133 | 134 |
| 134 int page_count = 0; | 135 int page_count = 0; |
| 135 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); | 136 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); |
| 136 | 137 |
| 137 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, | 138 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, |
| 138 page_count); | 139 page_count); |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace printing | 142 } // namespace printing |
| OLD | NEW |