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 <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
16 #include "content/public/test/mock_render_thread.h" | 17 #include "content/public/test/mock_render_thread.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class DictionaryValue; | 20 class DictionaryValue; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 bool* cancel); | 89 bool* cancel); |
89 #endif | 90 #endif |
90 | 91 |
91 // For print preview, PrintWebViewHelper will update settings. | 92 // For print preview, PrintWebViewHelper will update settings. |
92 void OnUpdatePrintSettings(int document_cookie, | 93 void OnUpdatePrintSettings(int document_cookie, |
93 const base::DictionaryValue& job_settings, | 94 const base::DictionaryValue& job_settings, |
94 PrintMsg_PrintPages_Params* params, | 95 PrintMsg_PrintPages_Params* params, |
95 bool* canceled); | 96 bool* canceled); |
96 | 97 |
97 // A mock printer device used for printing tests. | 98 // A mock printer device used for printing tests. |
98 scoped_ptr<MockPrinter> printer_; | 99 std::unique_ptr<MockPrinter> printer_; |
99 | 100 |
100 // True to simulate user clicking print. False to cancel. | 101 // True to simulate user clicking print. False to cancel. |
101 bool print_dialog_user_response_; | 102 bool print_dialog_user_response_; |
102 | 103 |
103 // Simulates cancelling print preview if |print_preview_pages_remaining_| | 104 // Simulates cancelling print preview if |print_preview_pages_remaining_| |
104 // equals this. | 105 // equals this. |
105 int print_preview_cancel_page_number_; | 106 int print_preview_cancel_page_number_; |
106 | 107 |
107 // Number of pages to generate for print preview. | 108 // Number of pages to generate for print preview. |
108 int print_preview_pages_remaining_; | 109 int print_preview_pages_remaining_; |
109 #endif | 110 #endif |
110 | 111 |
111 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 112 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
112 | 113 |
113 DISALLOW_COPY_AND_ASSIGN(PrintMockRenderThread); | 114 DISALLOW_COPY_AND_ASSIGN(PrintMockRenderThread); |
114 }; | 115 }; |
115 | 116 |
116 #endif // COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ | 117 #endif // COMPONENTS_PRINTING_TEST_PRINT_MOCK_RENDER_THREAD_H_ |
OLD | NEW |