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

Unified Diff: chrome/browser/resources/print_preview/print_preview_utils.js

Issue 8345025: Print Preview: Adding support for localized margin units and format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments 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
Index: chrome/browser/resources/print_preview/print_preview_utils.js
diff --git a/chrome/browser/resources/print_preview/print_preview_utils.js b/chrome/browser/resources/print_preview/print_preview_utils.js
index 90ecd1603accb153b7e25bd4c5b976d097cdc0e0..f1257086d50ee2b3e0f693481b944db45ac91816 100644
--- a/chrome/browser/resources/print_preview/print_preview_utils.js
+++ b/chrome/browser/resources/print_preview/print_preview_utils.js
@@ -206,6 +206,7 @@ function randomInteger(endPointA, endPointB) {
// Number of points per inch.
POINTS_PER_INCH = 72;
+POINTS_PER_MILLIMETER = 2.83464567;
Evan Stade 2011/10/21 01:33:02 technically should start with var
dpapad 2011/10/21 16:12:48 Done.
/**
* Converts |value| from inches to points.
@@ -224,3 +225,21 @@ function convertInchesToPoints(value) {
function convertPointsToInches(value) {
return value / POINTS_PER_INCH;
}
+
+/**
+ * Converts |value| from centimeters to points.
+ * @param {number} value The number in centimeters.
+ * @return {number} |value| in points.
+ */
+function convertMillimetersToPoints(value) {
Evan Stade 2011/10/21 01:33:02 I would not create these functions. Just multiply
dpapad 2011/10/21 16:12:48 I prefer to keep them (along with convertInchesToP
+ return value * POINTS_PER_MILLIMETER;
+}
+
+/**
+ * Converts |value| from points to centimeters..
Evan Stade 2011/10/21 01:33:02 not cm
dpapad 2011/10/21 16:12:48 Done.
+ * @param {number} value The number in points.
+ * @return {number} |value| in centimeters.
+ */
+function convertPointsToMillimeters(value) {
+ return value / POINTS_PER_MILLIMETER;
+}

Powered by Google App Engine
This is Rietveld 408576698