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 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_ | 5 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_ |
6 #define CHROME_RENDERER_MOCK_PRINTER_H_ | 6 #define CHROME_RENDERER_MOCK_PRINTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/string16.h" | |
15 #include "printing/image.h" | 16 #include "printing/image.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 | 18 |
18 struct PrintMsg_Print_Params; | 19 struct PrintMsg_Print_Params; |
19 struct PrintMsg_PrintPages_Params; | 20 struct PrintMsg_PrintPages_Params; |
20 struct PrintHostMsg_DidPrintPage_Params; | 21 struct PrintHostMsg_DidPrintPage_Params; |
21 | 22 |
22 // A class which represents an output page used in the MockPrinter class. | 23 // A class which represents an output page used in the MockPrinter class. |
23 // The MockPrinter class stores output pages in a vector, so, this class | 24 // The MockPrinter class stores output pages in a vector, so, this class |
24 // inherits the base::RefCounted<> class so that the MockPrinter class can use | 25 // inherits the base::RefCounted<> class so that the MockPrinter class can use |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 Status printer_status_; | 128 Status printer_status_; |
128 | 129 |
129 // The output of a printing job. | 130 // The output of a printing job. |
130 int number_pages_; | 131 int number_pages_; |
131 int page_number_; | 132 int page_number_; |
132 | 133 |
133 // Used only in the preview sequence. | 134 // Used only in the preview sequence. |
134 bool is_first_request_; | 135 bool is_first_request_; |
135 int preview_request_id_; | 136 int preview_request_id_; |
136 | 137 |
138 // Used for displaying headers and footers. | |
139 bool display_header_footer_; | |
140 string16 date_; | |
141 string16 title_; | |
142 string16 url_; | |
143 | |
137 std::vector<scoped_refptr<MockPrinterPage> > pages_; | 144 std::vector<scoped_refptr<MockPrinterPage> > pages_; |
138 | 145 |
139 DISALLOW_COPY_AND_ASSIGN(MockPrinter); | 146 DISALLOW_COPY_AND_ASSIGN(MockPrinter); |
140 }; | 147 }; |
141 | 148 |
149 // A clone of PrintMsg_Print_Params struct. | |
150 class PrintMsg_Print_Params_Clone { | |
151 public: | |
152 PrintMsg_Print_Params_Clone(); | |
153 ~PrintMsg_Print_Params_Clone(); | |
154 // Resets the members of |params| to 0. Checks to see if | |
kmadhusu
2011/08/16 18:08:34
Add a blank line before this.
Aayush Kumar
2011/08/16 20:32:52
Done.
| |
155 // PrintMsg_Print_Params and PrintMsg_Print_Params_Clone have identical | |
156 // member variables. | |
157 void ResetParams(PrintMsg_Print_Params* params); | |
158 private: | |
kmadhusu
2011/08/16 18:08:34
Add a blank line before this.
Aayush Kumar
2011/08/16 20:32:52
Done.
| |
159 gfx::Size page_size_; | |
160 gfx::Size printable_size_; | |
161 int margin_top_; | |
162 int margin_left_; | |
163 double dpi_; | |
164 double min_shrink_; | |
165 double max_shrink_; | |
166 int desired_dpi_; | |
167 int document_cookie_; | |
168 bool selection_only_; | |
169 bool supports_alpha_blend_; | |
170 int preview_request_id_; | |
171 bool is_first_request_; | |
172 bool display_header_footer_; | |
173 string16 date_; | |
174 string16 title_; | |
175 string16 url_; | |
176 }; | |
kmadhusu
2011/08/16 18:08:34
Add "DISALLOW_COPY_AND_ASSIGN" in both the classes
Aayush Kumar
2011/08/16 20:32:52
Done.
| |
177 | |
178 // A clone of PrintMsg_PrintPages_Params struct. | |
179 class PrintMsg_PrintPages_Params_Clone { | |
180 public: | |
181 PrintMsg_PrintPages_Params_Clone(); | |
182 ~PrintMsg_PrintPages_Params_Clone(); | |
183 // Resets the members of |params| to 0. Checks to see if | |
kmadhusu
2011/08/16 18:08:34
Add a blank line before this.
Aayush Kumar
2011/08/16 20:32:52
Done.
| |
184 // PrintMsg_PrintPages_Params and PrintMsg_PrintPages_Params_Clone have | |
185 // identical member variables. | |
186 void ResetParams(PrintMsg_PrintPages_Params* params); | |
187 | |
188 private: | |
189 PrintMsg_Print_Params_Clone params_; | |
190 std::vector<int> pages_; | |
191 }; | |
192 | |
142 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ | 193 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ |
OLD | NEW |