diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 01:26:32 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 01:26:32 +0000 |
commit | b076a082a0fe88ad5cf48e3ed0c406787edd085d (patch) | |
tree | 6225617fc22614b5f6b09ff2b2600e3908cc36e1 /printing/print_settings.cc | |
parent | f98ead6cf97707ff5a13896aa0206364703aa393 (diff) | |
download | chromium_src-b076a082a0fe88ad5cf48e3ed0c406787edd085d.zip chromium_src-b076a082a0fe88ad5cf48e3ed0c406787edd085d.tar.gz chromium_src-b076a082a0fe88ad5cf48e3ed0c406787edd085d.tar.bz2 |
Clarify that the custom margin value is not validated and add tests.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/8342059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_settings.cc')
-rw-r--r-- | printing/print_settings.cc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/printing/print_settings.cc b/printing/print_settings.cc index 11828e2..70ace6d 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc @@ -184,18 +184,22 @@ void PrintSettings::SetPrinterPrintableArea( case CUSTOM_MARGINS: { margins.header = 0; margins.footer = 0; - margins.top = ConvertUnitDouble(custom_margins_in_points_.top, - kPointsPerInch, - units_per_inch); - margins.bottom = ConvertUnitDouble(custom_margins_in_points_.bottom, - kPointsPerInch, - units_per_inch); - margins.left = ConvertUnitDouble(custom_margins_in_points_.left, - kPointsPerInch, - units_per_inch); - margins.right = ConvertUnitDouble(custom_margins_in_points_.right, - kPointsPerInch, - units_per_inch); + margins.top = ConvertUnitDouble( + requested_custom_margins_in_points_.top, + kPointsPerInch, + units_per_inch); + margins.bottom = ConvertUnitDouble( + requested_custom_margins_in_points_.bottom, + kPointsPerInch, + units_per_inch); + margins.left = ConvertUnitDouble( + requested_custom_margins_in_points_.left, + kPointsPerInch, + units_per_inch); + margins.right = ConvertUnitDouble( + requested_custom_margins_in_points_.right, + kPointsPerInch, + units_per_inch); break; } default: { @@ -209,8 +213,9 @@ void PrintSettings::SetPrinterPrintableArea( page_setup_device_units_.ForceRequestedMargins(margins); } -void PrintSettings::SetCustomMargins(const PageMargins& margins_in_points) { - custom_margins_in_points_ = margins_in_points; +void PrintSettings::SetCustomMargins( + const PageMargins& requested_margins_in_points) { + requested_custom_margins_in_points_ = requested_margins_in_points; margin_type = CUSTOM_MARGINS; } |