| 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 COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ | 5 #ifndef COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ |
| 6 #define COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ | 6 #define COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // PrintWebViewHelper expects default print settings. | 73 // PrintWebViewHelper expects default print settings. |
| 74 void OnGetDefaultPrintSettings(PrintMsg_Print_Params* setting); | 74 void OnGetDefaultPrintSettings(PrintMsg_Print_Params* setting); |
| 75 | 75 |
| 76 // PrintWebViewHelper expects final print settings from the user. | 76 // PrintWebViewHelper expects final print settings from the user. |
| 77 void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params, | 77 void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params, |
| 78 PrintMsg_PrintPages_Params* settings); | 78 PrintMsg_PrintPages_Params* settings); |
| 79 | 79 |
| 80 void OnDidGetPrintedPagesCount(int cookie, int number_pages); | 80 void OnDidGetPrintedPagesCount(int cookie, int number_pages); |
| 81 void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); | 81 void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); |
| 82 #if defined(ENABLE_PRINT_PREVIEW) |
| 82 void OnDidGetPreviewPageCount( | 83 void OnDidGetPreviewPageCount( |
| 83 const PrintHostMsg_DidGetPreviewPageCount_Params& params); | 84 const PrintHostMsg_DidGetPreviewPageCount_Params& params); |
| 84 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); | 85 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); |
| 85 void OnCheckForCancel(int32_t preview_ui_id, | 86 void OnCheckForCancel(int32_t preview_ui_id, |
| 86 int preview_request_id, | 87 int preview_request_id, |
| 87 bool* cancel); | 88 bool* cancel); |
| 89 #endif |
| 88 | 90 |
| 89 // For print preview, PrintWebViewHelper will update settings. | 91 // For print preview, PrintWebViewHelper will update settings. |
| 90 void OnUpdatePrintSettings(int document_cookie, | 92 void OnUpdatePrintSettings(int document_cookie, |
| 91 const base::DictionaryValue& job_settings, | 93 const base::DictionaryValue& job_settings, |
| 92 PrintMsg_PrintPages_Params* params, | 94 PrintMsg_PrintPages_Params* params, |
| 93 bool* canceled); | 95 bool* canceled); |
| 94 | 96 |
| 95 // A mock printer device used for printing tests. | 97 // A mock printer device used for printing tests. |
| 96 scoped_ptr<MockPrinter> printer_; | 98 scoped_ptr<MockPrinter> printer_; |
| 97 | 99 |
| 98 // True to simulate user clicking print. False to cancel. | 100 // True to simulate user clicking print. False to cancel. |
| 99 bool print_dialog_user_response_; | 101 bool print_dialog_user_response_; |
| 100 | 102 |
| 101 // Simulates cancelling print preview if |print_preview_pages_remaining_| | 103 // Simulates cancelling print preview if |print_preview_pages_remaining_| |
| 102 // equals this. | 104 // equals this. |
| 103 int print_preview_cancel_page_number_; | 105 int print_preview_cancel_page_number_; |
| 104 | 106 |
| 105 // Number of pages to generate for print preview. | 107 // Number of pages to generate for print preview. |
| 106 int print_preview_pages_remaining_; | 108 int print_preview_pages_remaining_; |
| 107 #endif | 109 #endif |
| 108 | 110 |
| 109 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 111 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 110 | 112 |
| 111 DISALLOW_COPY_AND_ASSIGN(PrintMockRenderThread); | 113 DISALLOW_COPY_AND_ASSIGN(PrintMockRenderThread); |
| 112 }; | 114 }; |
| 113 | 115 |
| 114 #endif // COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ | 116 #endif // COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ |
| OLD | NEW |