Chromium Code Reviews| Index: printing/print_settings.h |
| diff --git a/printing/print_settings.h b/printing/print_settings.h |
| index 1311ddbeb911f30b9ca39335c0b679ec6f711bab..72dbf5eab506d34b64f2a702fc4a4ace783c7817 100644 |
| --- a/printing/print_settings.h |
| +++ b/printing/print_settings.h |
| @@ -5,6 +5,7 @@ |
| #ifndef PRINTING_PRINT_SETTINGS_H_ |
| #define PRINTING_PRINT_SETTINGS_H_ |
| +#include <algorithm> |
| #include <string> |
| #include "base/strings/string16.h" |
| @@ -99,8 +100,11 @@ class PRINTING_EXPORT PrintSettings { |
| } |
| const base::string16& device_name() const { return device_name_; } |
| - void set_dpi(int dpi) { dpi_ = dpi; } |
| - int dpi() const { return dpi_; } |
| + void set_dpi(int dpi) { |
| + dpi_[0] = dpi; |
| + dpi_[1] = dpi; |
| + } |
| + int dpi() const { return std::min(dpi_[0], dpi_[1]); } |
|
rbpotter
2017/04/01 00:08:02
What do you think makes sense here? The previous i
Lei Zhang
2017/04/01 01:14:13
Well, for most printers, it doesn't matter right?
|
| void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; } |
| double scale_factor() const { return scale_factor_; } |
| @@ -108,6 +112,11 @@ class PRINTING_EXPORT PrintSettings { |
| void set_rasterize_pdf(bool rasterize_pdf) { rasterize_pdf_ = rasterize_pdf; } |
| bool rasterize_pdf() const { return rasterize_pdf_; } |
| + void set_dpi(int dpi_horizontal, int dpi_vertical) { |
| + dpi_[0] = dpi_horizontal; |
| + dpi_[1] = dpi_vertical; |
| + } |
| + |
| void set_supports_alpha_blend(bool supports_alpha_blend) { |
| supports_alpha_blend_ = supports_alpha_blend; |
| } |
| @@ -157,7 +166,8 @@ class PRINTING_EXPORT PrintSettings { |
| void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } |
| DuplexMode duplex_mode() const { return duplex_mode_; } |
| - int desired_dpi() const { return desired_dpi_; } |
| + int dpi_horizontal() const { return dpi_[0]; } |
| + int dpi_vertical() const { return dpi_[1]; } |
| #if defined(OS_WIN) |
| void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } |
| @@ -183,10 +193,6 @@ class PRINTING_EXPORT PrintSettings { |
| // This permits printing selected pages only. |
| PageRanges ranges_; |
| - // Desired visible dots per inch rendering for output. Printing should be |
| - // scaled to ScreenDpi/dpix*desired_dpi. |
| - int desired_dpi_; |
| - |
| // Indicates if the user only wants to print the current selection. |
| bool selection_only_; |
| @@ -225,7 +231,7 @@ class PRINTING_EXPORT PrintSettings { |
| PageSetup page_setup_device_units_; |
| // Printer's device effective dots per inch in both axis. |
| - int dpi_; |
| + int dpi_[2]; |
| // Scale factor |
| double scale_factor_; |