Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: printing/print_settings.cc

Issue 8342059: Clarify that the custom margin value is not validated and add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/print_settings.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings.cc
diff --git a/printing/print_settings.cc b/printing/print_settings.cc
index 11828e209fc82263573c9ae17b78e807e7c23b9c..70ace6dcf9da36ad74f3b6a60a1ede083fecf2b3 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;
}
« no previous file with comments | « printing/print_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698