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 |
| 155 // Resets the members of |params| to 0. Checks to see if |
| 156 // PrintMsg_Print_Params and PrintMsg_Print_Params_Clone have identical |
| 157 // member variables. |
| 158 void ResetParams(PrintMsg_Print_Params* params); |
| 159 |
| 160 private: |
| 161 gfx::Size page_size_; |
| 162 gfx::Size printable_size_; |
| 163 int margin_top_; |
| 164 int margin_left_; |
| 165 double dpi_; |
| 166 double min_shrink_; |
| 167 double max_shrink_; |
| 168 int desired_dpi_; |
| 169 int document_cookie_; |
| 170 bool selection_only_; |
| 171 bool supports_alpha_blend_; |
| 172 int preview_request_id_; |
| 173 bool is_first_request_; |
| 174 bool display_header_footer_; |
| 175 string16 date_; |
| 176 string16 title_; |
| 177 string16 url_; |
| 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(PrintMsg_Print_Params_Clone); |
| 180 }; |
| 181 |
| 182 // A clone of PrintMsg_PrintPages_Params struct. |
| 183 class PrintMsg_PrintPages_Params_Clone { |
| 184 public: |
| 185 PrintMsg_PrintPages_Params_Clone(); |
| 186 ~PrintMsg_PrintPages_Params_Clone(); |
| 187 |
| 188 // Resets the members of |params| to 0. Checks to see if |
| 189 // PrintMsg_PrintPages_Params and PrintMsg_PrintPages_Params_Clone have |
| 190 // identical member variables. |
| 191 void ResetParams(PrintMsg_PrintPages_Params* params); |
| 192 |
| 193 private: |
| 194 PrintMsg_Print_Params_Clone params_; |
| 195 std::vector<int> pages_; |
| 196 |
| 197 DISALLOW_COPY_AND_ASSIGN(PrintMsg_PrintPages_Params_Clone); |
| 198 }; |
| 199 |
142 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ | 200 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ |
OLD | NEW |