Chromium Code Reviews| Index: printing/print_settings.h |
| diff --git a/printing/print_settings.h b/printing/print_settings.h |
| index 592b7b9edf0557e4a828d0d1fc51528ad56026c5..30823b904d04acdca009ce90b8a5aeb118839a69 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" |
| @@ -98,8 +99,15 @@ 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; |
| + } |
| + void set_dpi(int dpi_horizontal, int dpi_vertical) { |
|
Lei Zhang
2017/04/04 00:03:03
Can we name this something else to avoid overloadi
rbpotter
2017/04/04 00:36:34
Done.
|
| + dpi_[0] = dpi_horizontal; |
| + dpi_[1] = dpi_vertical; |
| + } |
| + int dpi() const { return std::min(dpi_[0], dpi_[1]); } |
| void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; } |
| double scale_factor() const { return scale_factor_; } |
| @@ -156,6 +164,9 @@ class PRINTING_EXPORT PrintSettings { |
| void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } |
| DuplexMode duplex_mode() const { return duplex_mode_; } |
| + int dpi_horizontal() const { return dpi_[0]; } |
|
Lei Zhang
2017/04/04 00:03:03
Can we keep these grouped with dpi() above?
rbpotter
2017/04/04 00:36:34
Done.
|
| + 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; } |
| bool print_text_with_gdi() const { return print_text_with_gdi_; } |
| @@ -180,10 +191,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_; |
| @@ -222,7 +229,7 @@ class PRINTING_EXPORT PrintSettings { |
| PageSetup page_setup_device_units_; |
| // Printer's device effective dots per inch in both axis. |
|
Lei Zhang
2017/04/04 00:03:03
Can we add some notes to say the two values can on
rbpotter
2017/04/04 00:36:34
Done.
|
| - int dpi_; |
| + int dpi_[2]; |
| // Scale factor |
| double scale_factor_; |