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

Side by Side Diff: printing/print_settings_conversion.cc

Issue 2114583002: Windows: Make it possible to print text with GDI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again, resolve conflicts Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « printing/print_settings.cc ('k') | printing/printing_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/print_settings_conversion.h" 5 #include "printing/print_settings_conversion.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return false; 184 return false;
185 } 185 }
186 186
187 settings->set_collate(collate); 187 settings->set_collate(collate);
188 settings->set_copies(copies); 188 settings->set_copies(copies);
189 settings->SetOrientation(landscape); 189 settings->SetOrientation(landscape);
190 settings->set_device_name(device_name); 190 settings->set_device_name(device_name);
191 settings->set_duplex_mode(static_cast<DuplexMode>(duplex_mode)); 191 settings->set_duplex_mode(static_cast<DuplexMode>(duplex_mode));
192 settings->set_color(static_cast<ColorModel>(color)); 192 settings->set_color(static_cast<ColorModel>(color));
193 193
194 #if defined(OS_WIN)
195 // Modifiable implies HTML and not other formats like PDF.
196 bool can_modify = false;
197 if (job_settings.GetBoolean(kSettingPreviewModifiable, &can_modify))
198 settings->set_print_text_with_gdi(can_modify);
199 #endif
200
194 return true; 201 return true;
195 } 202 }
196 203
197 void PrintSettingsToJobSettingsDebug(const PrintSettings& settings, 204 void PrintSettingsToJobSettingsDebug(const PrintSettings& settings,
198 base::DictionaryValue* job_settings) { 205 base::DictionaryValue* job_settings) {
199 job_settings->SetBoolean(kSettingHeaderFooterEnabled, 206 job_settings->SetBoolean(kSettingHeaderFooterEnabled,
200 settings.display_header_footer()); 207 settings.display_header_footer());
201 job_settings->SetString(kSettingHeaderFooterTitle, settings.title()); 208 job_settings->SetString(kSettingHeaderFooterTitle, settings.title());
202 job_settings->SetString(kSettingHeaderFooterURL, settings.url()); 209 job_settings->SetString(kSettingHeaderFooterURL, settings.url());
203 job_settings->SetBoolean(kSettingShouldPrintBackgrounds, 210 job_settings->SetBoolean(kSettingShouldPrintBackgrounds,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 const PageSetup& page_setup = settings.page_setup_device_units(); 247 const PageSetup& page_setup = settings.page_setup_device_units();
241 SetMarginsToJobSettings( 248 SetMarginsToJobSettings(
242 "effective_margins", page_setup.effective_margins(), debug); 249 "effective_margins", page_setup.effective_margins(), debug);
243 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug); 250 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug);
244 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug); 251 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug);
245 SetRectToJobSettings("content_area", page_setup.content_area(), debug); 252 SetRectToJobSettings("content_area", page_setup.content_area(), debug);
246 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug); 253 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug);
247 } 254 }
248 255
249 } // namespace printing 256 } // namespace printing
OLDNEW
« no previous file with comments | « printing/print_settings.cc ('k') | printing/printing_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698