diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 23:02:15 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 23:02:15 +0000 |
commit | ad3b050141388c16418bdabafac8a9e324ce7a5a (patch) | |
tree | bc9457658d7c49121ed52f3742d5f948cd731b22 /chrome/service | |
parent | d32c02a827060c757864e8053228886dd4910c61 (diff) | |
download | chromium_src-ad3b050141388c16418bdabafac8a9e324ce7a5a.zip chromium_src-ad3b050141388c16418bdabafac8a9e324ce7a5a.tar.gz chromium_src-ad3b050141388c16418bdabafac8a9e324ce7a5a.tar.bz2 |
Add paper size support for local printing on Windows.
Set windows paper is as ventor_id.
Use windows paper id in Cloud Print Connector.
BUG=239879,382338
Review URL: https://codereview.chromium.org/333993003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r-- | chrome/service/cloud_print/cdd_conversion_win.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/service/cloud_print/cdd_conversion_win.cc b/chrome/service/cloud_print/cdd_conversion_win.cc index bfcb920..4ab9c46 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) { + unsigned id = 0; + if (base::StringToUint(media.value().vendor_id, &id) && id) { + dev_mode->dmFields |= DM_PAPERSIZE; + dev_mode->dmPaperSize = static_cast<short>(id); + } else if (width > 0 && height > 0) { dev_mode->dmFields |= DM_PAPERWIDTH; dev_mode->dmPaperWidth = width; - } - if (height > 0) { dev_mode->dmFields |= DM_PAPERLENGTH; dev_mode->dmPaperLength = height; } |