| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 PRINTER_PRINTING, | 63 PRINTER_PRINTING, |
| 64 PRINTER_ERROR, | 64 PRINTER_ERROR, |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 MockPrinter(); | 67 MockPrinter(); |
| 68 ~MockPrinter(); | 68 ~MockPrinter(); |
| 69 | 69 |
| 70 // Functions that changes settings of a pseudo printer. | 70 // Functions that changes settings of a pseudo printer. |
| 71 void ResetPrinter(); | 71 void ResetPrinter(); |
| 72 void SetDefaultPrintSettings(const PrintMsg_Print_Params& params); | 72 void SetDefaultPrintSettings(const PrintMsg_Print_Params& params); |
| 73 void SetScriptedPrintAllowed(bool allowed); |
| 73 void UseInvalidSettings(); | 74 void UseInvalidSettings(); |
| 74 void UseInvalidPageSize(); | 75 void UseInvalidPageSize(); |
| 75 void UseInvalidContentSize(); | 76 void UseInvalidContentSize(); |
| 76 | 77 |
| 77 // Functions that handles IPC events. | 78 // Functions that handles IPC events. |
| 78 void GetDefaultPrintSettings(PrintMsg_Print_Params* params); | 79 void GetDefaultPrintSettings(PrintMsg_Print_Params* params); |
| 80 void OnCheckScriptedPrintAllowed(bool* allowed); |
| 79 void ScriptedPrint(int cookie, | 81 void ScriptedPrint(int cookie, |
| 80 int expected_pages_count, | 82 int expected_pages_count, |
| 81 bool has_selection, | 83 bool has_selection, |
| 82 PrintMsg_PrintPages_Params* settings); | 84 PrintMsg_PrintPages_Params* settings); |
| 83 void UpdateSettings(int cookie, PrintMsg_PrintPages_Params* params, | 85 void UpdateSettings(int cookie, PrintMsg_PrintPages_Params* params, |
| 84 const std::vector<int>& page_range_array, | 86 const std::vector<int>& page_range_array, |
| 85 int margins_type); | 87 int margins_type); |
| 86 void SetPrintedPagesCount(int cookie, int number_pages); | 88 void SetPrintedPagesCount(int cookie, int number_pages); |
| 87 void PrintPage(const PrintHostMsg_DidPrintPage_Params& params); | 89 void PrintPage(const PrintHostMsg_DidPrintPage_Params& params); |
| 88 | 90 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool is_first_request_; | 144 bool is_first_request_; |
| 143 bool print_to_pdf_; | 145 bool print_to_pdf_; |
| 144 int preview_request_id_; | 146 int preview_request_id_; |
| 145 | 147 |
| 146 // Used for displaying headers and footers. | 148 // Used for displaying headers and footers. |
| 147 bool display_header_footer_; | 149 bool display_header_footer_; |
| 148 string16 date_; | 150 string16 date_; |
| 149 string16 title_; | 151 string16 title_; |
| 150 string16 url_; | 152 string16 url_; |
| 151 | 153 |
| 154 // Used for simulating attempted printing from a blocked popup. |
| 155 bool scripted_print_allowed_; |
| 156 |
| 152 // Used for generating invalid settings. | 157 // Used for generating invalid settings. |
| 153 bool use_invalid_settings_; | 158 bool use_invalid_settings_; |
| 154 | 159 |
| 155 std::vector<scoped_refptr<MockPrinterPage> > pages_; | 160 std::vector<scoped_refptr<MockPrinterPage> > pages_; |
| 156 | 161 |
| 157 DISALLOW_COPY_AND_ASSIGN(MockPrinter); | 162 DISALLOW_COPY_AND_ASSIGN(MockPrinter); |
| 158 }; | 163 }; |
| 159 | 164 |
| 160 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ | 165 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ |
| OLD | NEW |