| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 job_settings->SetInteger(kSettingCopies, settings.copies()); | 234 job_settings->SetInteger(kSettingCopies, settings.copies()); |
| 235 job_settings->SetInteger(kSettingColor, settings.color()); | 235 job_settings->SetInteger(kSettingColor, settings.color()); |
| 236 job_settings->SetInteger(kSettingDuplexMode, settings.duplex_mode()); | 236 job_settings->SetInteger(kSettingDuplexMode, settings.duplex_mode()); |
| 237 job_settings->SetBoolean(kSettingLandscape, settings.landscape()); | 237 job_settings->SetBoolean(kSettingLandscape, settings.landscape()); |
| 238 job_settings->SetString(kSettingDeviceName, settings.device_name()); | 238 job_settings->SetString(kSettingDeviceName, settings.device_name()); |
| 239 | 239 |
| 240 // Following values are not read form JSON by InitSettings, so do not have | 240 // Following values are not read form JSON by InitSettings, so do not have |
| 241 // common public constants. So just serialize in "debug" section. | 241 // common public constants. So just serialize in "debug" section. |
| 242 base::DictionaryValue* debug = new base::DictionaryValue; | 242 base::DictionaryValue* debug = new base::DictionaryValue; |
| 243 job_settings->Set("debug", debug); | 243 job_settings->Set("debug", debug); |
| 244 debug->SetInteger("desiredDpi", settings.desired_dpi()); | |
| 245 debug->SetInteger("dpi", settings.dpi()); | 244 debug->SetInteger("dpi", settings.dpi()); |
| 246 debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch()); | 245 debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch()); |
| 247 debug->SetBoolean("support_alpha_blend", settings.should_print_backgrounds()); | 246 debug->SetBoolean("support_alpha_blend", settings.should_print_backgrounds()); |
| 248 debug->SetString("media_vendor_od", settings.requested_media().vendor_id); | 247 debug->SetString("media_vendor_id", settings.requested_media().vendor_id); |
| 249 SetSizeToJobSettings( | 248 SetSizeToJobSettings( |
| 250 "media_size", settings.requested_media().size_microns, debug); | 249 "media_size", settings.requested_media().size_microns, debug); |
| 251 SetMarginsToJobSettings("requested_custom_margins_in_points", | 250 SetMarginsToJobSettings("requested_custom_margins_in_points", |
| 252 settings.requested_custom_margins_in_points(), | 251 settings.requested_custom_margins_in_points(), |
| 253 debug); | 252 debug); |
| 254 const PageSetup& page_setup = settings.page_setup_device_units(); | 253 const PageSetup& page_setup = settings.page_setup_device_units(); |
| 255 SetMarginsToJobSettings( | 254 SetMarginsToJobSettings( |
| 256 "effective_margins", page_setup.effective_margins(), debug); | 255 "effective_margins", page_setup.effective_margins(), debug); |
| 257 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug); | 256 SetSizeToJobSettings("physical_size", page_setup.physical_size(), debug); |
| 258 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug); | 257 SetRectToJobSettings("overlay_area", page_setup.overlay_area(), debug); |
| 259 SetRectToJobSettings("content_area", page_setup.content_area(), debug); | 258 SetRectToJobSettings("content_area", page_setup.content_area(), debug); |
| 260 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug); | 259 SetRectToJobSettings("printable_area", page_setup.printable_area(), debug); |
| 261 } | 260 } |
| 262 | 261 |
| 263 } // namespace printing | 262 } // namespace printing |
| OLD | NEW |