| OLD | NEW |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 job_settings->SetInteger(kSettingCopies, settings.copies()); | 220 job_settings->SetInteger(kSettingCopies, settings.copies()); |
| 221 job_settings->SetInteger(kSettingColor, settings.color()); | 221 job_settings->SetInteger(kSettingColor, settings.color()); |
| 222 job_settings->SetInteger(kSettingDuplexMode, settings.duplex_mode()); | 222 job_settings->SetInteger(kSettingDuplexMode, settings.duplex_mode()); |
| 223 job_settings->SetBoolean(kSettingLandscape, settings.landscape()); | 223 job_settings->SetBoolean(kSettingLandscape, settings.landscape()); |
| 224 job_settings->SetString(kSettingDeviceName, settings.device_name()); | 224 job_settings->SetString(kSettingDeviceName, settings.device_name()); |
| 225 | 225 |
| 226 // Following values are not read form JSON by InitSettings, so do not have | 226 // Following values are not read form JSON by InitSettings, so do not have |
| 227 // common public constants. So just serialize in "debug" section. | 227 // common public constants. So just serialize in "debug" section. |
| 228 base::DictionaryValue* debug = new base::DictionaryValue; | 228 base::DictionaryValue* debug = new base::DictionaryValue; |
| 229 job_settings->Set("debug", debug); | 229 job_settings->Set("debug", debug); |
| 230 debug->SetDouble("minShrink", settings.min_shrink()); | |
| 231 debug->SetDouble("maxShrink", settings.max_shrink()); | |
| 232 debug->SetInteger("desiredDpi", settings.desired_dpi()); | 230 debug->SetInteger("desiredDpi", settings.desired_dpi()); |
| 233 debug->SetInteger("dpi", settings.dpi()); | 231 debug->SetInteger("dpi", settings.dpi()); |
| 234 debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch()); | 232 debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch()); |
| 235 debug->SetBoolean("support_alpha_blend", settings.should_print_backgrounds()); | 233 debug->SetBoolean("support_alpha_blend", settings.should_print_backgrounds()); |
| 236 debug->SetString("media_vendor_od", settings.requested_media().vendor_id); | 234 debug->SetString("media_vendor_od", settings.requested_media().vendor_id); |
| 237 SetSizeToJobSettings( | 235 SetSizeToJobSettings( |
| 238 "media_size", settings.requested_media().size_microns, debug); | 236 "media_size", settings.requested_media().size_microns, debug); |
| 239 SetMarginsToJobSettings("requested_custom_margins_in_points", | 237 SetMarginsToJobSettings("requested_custom_margins_in_points", |
| 240 settings.requested_custom_margins_in_points(), | 238 settings.requested_custom_margins_in_points(), |
| 241 debug); | 239 debug); |
| 242 const PageSetup& page_setup = settings.page_setup_device_units(); | 240 const PageSetup& page_setup = settings.page_setup_device_units(); |
| 243 SetMarginsToJobSettings( | 241 SetMarginsToJobSettings( |
| 244 "effective_margins", page_setup.effective_margins(), debug); | 242 "effective_margins", page_setup.effective_margins(), debug); |
| 245 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug); | 243 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug); |
| 246 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug); | 244 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug); |
| 247 SetRectToJobSettings("content_area", page_setup.content_area(), debug); | 245 SetRectToJobSettings("content_area", page_setup.content_area(), debug); |
| 248 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug); | 246 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug); |
| 249 } | 247 } |
| 250 | 248 |
| 251 } // namespace printing | 249 } // namespace printing |
| OLD | NEW |