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

Side by Side Diff: printing/print_settings.cc

Issue 8173016: Patch up excessive margins until we can get the real fix plumbed through. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix headers and footers 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "printing/print_settings.h" 5 #include "printing/print_settings.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "printing/print_job_constants.h"
8 #include "printing/units.h" 9 #include "printing/units.h"
9 10
10 namespace printing { 11 namespace printing {
11 12
12 // Global SequenceNumber used for generating unique cookie values. 13 // Global SequenceNumber used for generating unique cookie values.
13 static base::AtomicSequenceNumber cookie_seq(base::LINKER_INITIALIZED); 14 static base::AtomicSequenceNumber cookie_seq(base::LINKER_INITIALIZED);
14 15
15 PrintSettings::PrintSettings() 16 PrintSettings::PrintSettings()
16 : min_shrink(1.25), 17 : min_shrink(1.25),
17 max_shrink(2.0), 18 max_shrink(2.0),
(...skipping 29 matching lines...) Expand all
47 48
48 void PrintSettings::SetPrinterPrintableArea( 49 void PrintSettings::SetPrinterPrintableArea(
49 gfx::Size const& physical_size_device_units, 50 gfx::Size const& physical_size_device_units,
50 gfx::Rect const& printable_area_device_units, 51 gfx::Rect const& printable_area_device_units,
51 int units_per_inch) { 52 int units_per_inch) {
52 53
53 int header_footer_text_height = 0; 54 int header_footer_text_height = 0;
54 int margin_printer_units = 0; 55 int margin_printer_units = 0;
55 if (use_overlays) { 56 if (use_overlays) {
56 // Hard-code text_height = 0.5cm = ~1/5 of inch. 57 // Hard-code text_height = 0.5cm = ~1/5 of inch.
57 header_footer_text_height = ConvertUnit(500, kHundrethsMMPerInch, 58 header_footer_text_height = ConvertUnit(kSettingHeaderFooterInterstice,
58 units_per_inch); 59 kPointsPerInch, units_per_inch);
59 // Default margins 1.0cm = ~2/5 of an inch. 60 // Default margins 1.0cm = ~2/5 of an inch.
60 margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch, 61 margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch,
61 units_per_inch); 62 units_per_inch);
62 } 63 }
63 // Start by setting the user configuration 64 // Start by setting the user configuration
64 page_setup_device_units_.Init(physical_size_device_units, 65 page_setup_device_units_.Init(physical_size_device_units,
65 printable_area_device_units, 66 printable_area_device_units,
66 header_footer_text_height); 67 header_footer_text_height);
67 68
68 69
(...skipping 30 matching lines...) Expand all
99 } 100 }
100 101
101 void PrintSettings::SetOrientation(bool landscape) { 102 void PrintSettings::SetOrientation(bool landscape) {
102 if (landscape_ != landscape) { 103 if (landscape_ != landscape) {
103 landscape_ = landscape; 104 landscape_ = landscape;
104 page_setup_device_units_.FlipOrientation(); 105 page_setup_device_units_.FlipOrientation();
105 } 106 }
106 } 107 }
107 108
108 } // namespace printing 109 } // namespace printing
OLDNEW
« printing/print_job_constants.cc ('K') | « printing/print_job_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698