Chromium Code Reviews| Index: chrome/service/cloud_print/cdd_conversion_win.cc |
| diff --git a/chrome/service/cloud_print/cdd_conversion_win.cc b/chrome/service/cloud_print/cdd_conversion_win.cc |
| index bfcb9202a40792c8cb6b310a519b72817cee963b..98a41764b75f85c1521c4a3e75f0f3e66fdce304 100644 |
| --- a/chrome/service/cloud_print/cdd_conversion_win.cc |
| +++ b/chrome/service/cloud_print/cdd_conversion_win.cc |
| @@ -4,6 +4,7 @@ |
| #include "chrome/service/cloud_print/cdd_conversion_win.h" |
| +#include "base/strings/string_number_conversions.h" |
| #include "components/cloud_devices/common/printer_description.h" |
| #include "printing/backend/win_helper.h" |
| @@ -111,11 +112,13 @@ scoped_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode( |
| static const size_t kFromUm = 100; // Windows uses 0.1mm. |
| int width = media.value().width_um / kFromUm; |
| int height = media.value().height_um / kFromUm; |
| - if (width > 0) { |
| + uint32 id = 0; |
| + if (base::HexStringToUInt(media.value().vendor_id, &id) && id) { |
| + dev_mode->dmFields |= DM_PAPERSIZE; |
| + dev_mode->dmPaperSize = static_cast<short>(id); |
| + } else if (width > 0 && height > 0) { |
|
Noam Samuel
2014/06/16 18:24:25
OK to no longer supports width-only or height-only
Vitaly Buka (NO REVIEWS)
2014/06/16 18:58:38
The rest of out printing code is not designed for
|
| dev_mode->dmFields |= DM_PAPERWIDTH; |
| dev_mode->dmPaperWidth = width; |
| - } |
| - if (height > 0) { |
| dev_mode->dmFields |= DM_PAPERLENGTH; |
| dev_mode->dmPaperLength = height; |
| } |