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

Side by Side Diff: printing/page_setup.h

Issue 8328001: For no margins, or printable area margins, don't factor in the header/footer size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment 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
« no previous file with comments | « no previous file | printing/page_setup.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef PRINTING_PAGE_SETUP_H_ 5 #ifndef PRINTING_PAGE_SETUP_H_
6 #define PRINTING_PAGE_SETUP_H_ 6 #define PRINTING_PAGE_SETUP_H_
7 7
8 #include "printing/printing_export.h" 8 #include "printing/printing_export.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const gfx::Size& physical_size() const { return physical_size_; } 58 const gfx::Size& physical_size() const { return physical_size_; }
59 const gfx::Rect& overlay_area() const { return overlay_area_; } 59 const gfx::Rect& overlay_area() const { return overlay_area_; }
60 const gfx::Rect& content_area() const { return content_area_; } 60 const gfx::Rect& content_area() const { return content_area_; }
61 const gfx::Rect& printable_area() const { return printable_area_; } 61 const gfx::Rect& printable_area() const { return printable_area_; }
62 const PageMargins& effective_margins() const { 62 const PageMargins& effective_margins() const {
63 return effective_margins_; 63 return effective_margins_;
64 } 64 }
65 65
66 private: 66 private:
67 // Calculate overlay_area_, effective_margins_, and content_area_, based on 67 // Calculate overlay_area_, effective_margins_, and content_area_, based on
68 // a constraint of |bounds|. 68 // a constraint of |bounds| and |text_height|.
69 void CalculateSizesWithinRect(const gfx::Rect& bounds); 69 void CalculateSizesWithinRect(const gfx::Rect& bounds, int text_height);
70 70
71 // Physical size of the page, including non-printable margins. 71 // Physical size of the page, including non-printable margins.
72 gfx::Size physical_size_; 72 gfx::Size physical_size_;
73 73
74 // The printable area as specified by the printer driver. We can't get 74 // The printable area as specified by the printer driver. We can't get
75 // larger than this. 75 // larger than this.
76 gfx::Rect printable_area_; 76 gfx::Rect printable_area_;
77 77
78 // The printable area for headers and footers. 78 // The printable area for headers and footers.
79 gfx::Rect overlay_area_; 79 gfx::Rect overlay_area_;
80 80
81 // The printable area as selected by the user's margins. 81 // The printable area as selected by the user's margins.
82 gfx::Rect content_area_; 82 gfx::Rect content_area_;
83 83
84 // Effective margins. 84 // Effective margins.
85 PageMargins effective_margins_; 85 PageMargins effective_margins_;
86 86
87 // Requested margins. 87 // Requested margins.
88 PageMargins requested_margins_; 88 PageMargins requested_margins_;
89 89
90 // Space that must be kept free for the overlays. 90 // Space that must be kept free for the overlays.
91 int text_height_; 91 int text_height_;
92 }; 92 };
93 93
94 } // namespace printing 94 } // namespace printing
95 95
96 #endif // PRINTING_PAGE_SETUP_H_ 96 #endif // PRINTING_PAGE_SETUP_H_
OLDNEW
« no previous file with comments | « no previous file | printing/page_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698