Commit 213a4f71 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Change print settings dpi from array to gfx::Size

Bug: None
Change-Id: Icd11e38860cf3eee024ebdf3fb847a528e8050c8
Reviewed-on: https://chromium-review.googlesource.com/843016Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527088}
parent dd98ffe7
...@@ -171,8 +171,7 @@ void PrintSettings::Clear() { ...@@ -171,8 +171,7 @@ void PrintSettings::Clear() {
device_name_.clear(); device_name_.clear();
requested_media_ = RequestedMedia(); requested_media_ = RequestedMedia();
page_setup_device_units_.Clear(); page_setup_device_units_.Clear();
dpi_[0] = 0; dpi_ = gfx::Size();
dpi_[1] = 0;
scale_factor_ = 1.0f; scale_factor_ = 1.0f;
rasterize_pdf_ = false; rasterize_pdf_ = false;
landscape_ = false; landscape_ = false;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "printing/print_job_constants.h" #include "printing/print_job_constants.h"
#include "printing/printing_export.h" #include "printing/printing_export.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
namespace printing { namespace printing {
...@@ -101,17 +102,14 @@ class PRINTING_EXPORT PrintSettings { ...@@ -101,17 +102,14 @@ class PRINTING_EXPORT PrintSettings {
} }
const base::string16& device_name() const { return device_name_; } const base::string16& device_name() const { return device_name_; }
void set_dpi(int dpi) { void set_dpi(int dpi) { dpi_ = gfx::Size(dpi, dpi); }
dpi_[0] = dpi;
dpi_[1] = dpi;
}
void set_dpi_xy(int dpi_horizontal, int dpi_vertical) { void set_dpi_xy(int dpi_horizontal, int dpi_vertical) {
dpi_[0] = dpi_horizontal; dpi_ = gfx::Size(dpi_horizontal, dpi_vertical);
dpi_[1] = dpi_vertical;
} }
int dpi() const { return std::max(dpi_[0], dpi_[1]); }
int dpi_horizontal() const { return dpi_[0]; } int dpi() const { return std::max(dpi_.width(), dpi_.height()); }
int dpi_vertical() const { return dpi_[1]; } int dpi_horizontal() const { return dpi_.width(); }
int dpi_vertical() const { return dpi_.height(); }
void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; } void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; }
double scale_factor() const { return scale_factor_; } double scale_factor() const { return scale_factor_; }
...@@ -238,7 +236,7 @@ class PRINTING_EXPORT PrintSettings { ...@@ -238,7 +236,7 @@ class PRINTING_EXPORT PrintSettings {
// Printer's device effective dots per inch in both axes. The two values will // Printer's device effective dots per inch in both axes. The two values will
// generally be identical. However, on Windows, there are a few rare printers // generally be identical. However, on Windows, there are a few rare printers
// that support resolutions with different DPI in different dimensions. // that support resolutions with different DPI in different dimensions.
int dpi_[2]; gfx::Size dpi_;
// Scale factor // Scale factor
double scale_factor_; double scale_factor_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment