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

Side by Side Diff: printing/units.cc

Issue 21475: Move units to new module printing. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 unified diff | Download patch
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/browser/printing/units.cc:r69-2775
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/units.h" 5 #include "printing/units.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace printing { 9 namespace printing {
10 10
11 int ConvertUnit(int value, int old_unit, int new_unit) { 11 int ConvertUnit(int value, int old_unit, int new_unit) {
12 DCHECK_GT(new_unit, 0); 12 DCHECK_GT(new_unit, 0);
13 DCHECK_GT(old_unit, 0); 13 DCHECK_GT(old_unit, 0);
14 // With integer arithmetic, to divide a value with correct rounding, you need 14 // With integer arithmetic, to divide a value with correct rounding, you need
15 // to add half of the divisor value to the dividend value. You need to do the 15 // to add half of the divisor value to the dividend value. You need to do the
(...skipping 17 matching lines...) Expand all
33 // 0.001" == 25.4 um 33 // 0.001" == 25.4 um
34 // 0.001" == 2.54 cmm 34 // 0.001" == 2.54 cmm
35 return ConvertUnit(milli_inch, 100, 254); 35 return ConvertUnit(milli_inch, 100, 254);
36 } 36 }
37 37
38 int ConvertHundredThousanthMeterToMilliInch(int cmm) { 38 int ConvertHundredThousanthMeterToMilliInch(int cmm) {
39 return ConvertUnit(cmm, 254, 100); 39 return ConvertUnit(cmm, 254, 100);
40 } 40 }
41 41
42 } // namespace printing 42 } // namespace printing
43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698