OLD | NEW |
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/units.h" | 8 #include "printing/units.h" |
9 | 9 |
10 namespace printing { | 10 namespace printing { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 bool PrintSettings::Equals(const PrintSettings& rhs) const { | 77 bool PrintSettings::Equals(const PrintSettings& rhs) const { |
78 // Do not test the display device name (printer_name_) for equality since it | 78 // Do not test the display device name (printer_name_) for equality since it |
79 // may sometimes be chopped off at 30 chars. As long as device_name is the | 79 // may sometimes be chopped off at 30 chars. As long as device_name is the |
80 // same, that's fine. | 80 // same, that's fine. |
81 return ranges == rhs.ranges && | 81 return ranges == rhs.ranges && |
82 min_shrink == rhs.min_shrink && | 82 min_shrink == rhs.min_shrink && |
83 max_shrink == rhs.max_shrink && | 83 max_shrink == rhs.max_shrink && |
84 desired_dpi == rhs.desired_dpi && | 84 desired_dpi == rhs.desired_dpi && |
85 overlays.Equals(rhs.overlays) && | |
86 device_name_ == rhs.device_name_ && | 85 device_name_ == rhs.device_name_ && |
87 page_setup_device_units_.Equals(rhs.page_setup_device_units_) && | 86 page_setup_device_units_.Equals(rhs.page_setup_device_units_) && |
88 dpi_ == rhs.dpi_ && | 87 dpi_ == rhs.dpi_ && |
89 landscape_ == rhs.landscape_; | 88 landscape_ == rhs.landscape_; |
90 } | 89 } |
91 | 90 |
92 int PrintSettings::NewCookie() { | 91 int PrintSettings::NewCookie() { |
93 // A cookie of 0 is used to mark a document as unassigned, count from 1. | 92 // A cookie of 0 is used to mark a document as unassigned, count from 1. |
94 return cookie_seq.GetNext() + 1; | 93 return cookie_seq.GetNext() + 1; |
95 } | 94 } |
96 | 95 |
97 void PrintSettings::SetOrientation(bool landscape) { | 96 void PrintSettings::SetOrientation(bool landscape) { |
98 if (landscape_ != landscape) { | 97 if (landscape_ != landscape) { |
99 landscape_ = landscape; | 98 landscape_ = landscape; |
100 page_setup_device_units_.FlipOrientation(); | 99 page_setup_device_units_.FlipOrientation(); |
101 } | 100 } |
102 } | 101 } |
103 | 102 |
104 } // namespace printing | 103 } // namespace printing |
OLD | NEW |