| 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/page_setup.h" | 9 #include "printing/page_setup.h" |
| 10 #include "printing/page_size_margins.h" | 10 #include "printing/page_size_margins.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 PrintingContext::~PrintingContext() { | 28 PrintingContext::~PrintingContext() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void PrintingContext::set_margin_type(MarginType type) { | 31 void PrintingContext::set_margin_type(MarginType type) { |
| 32 DCHECK(type != CUSTOM_MARGINS); | 32 DCHECK(type != CUSTOM_MARGINS); |
| 33 settings_.set_margin_type(type); | 33 settings_.set_margin_type(type); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void PrintingContext::set_is_modifiable(bool is_modifiable) { |
| 37 #if defined(OS_WIN) |
| 38 settings_.set_print_text_with_gdi(is_modifiable); |
| 39 #endif |
| 40 } |
| 41 |
| 36 void PrintingContext::ResetSettings() { | 42 void PrintingContext::ResetSettings() { |
| 37 ReleaseContext(); | 43 ReleaseContext(); |
| 38 | 44 |
| 39 settings_.Clear(); | 45 settings_.Clear(); |
| 40 | 46 |
| 41 in_print_job_ = false; | 47 in_print_job_ = false; |
| 42 abort_printing_ = false; | 48 abort_printing_ = false; |
| 43 } | 49 } |
| 44 | 50 |
| 45 PrintingContext::Result PrintingContext::OnError() { | 51 PrintingContext::Result PrintingContext::OnError() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #endif | 130 #endif |
| 125 | 131 |
| 126 int page_count = 0; | 132 int page_count = 0; |
| 127 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); | 133 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); |
| 128 | 134 |
| 129 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, | 135 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, |
| 130 page_count); | 136 page_count); |
| 131 } | 137 } |
| 132 | 138 |
| 133 } // namespace printing | 139 } // namespace printing |
| OLD | NEW |