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_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, OnPrintPages); | 103 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, OnPrintPages); |
104 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreview); | 104 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreview); |
105 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreviewCancel); | 105 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreviewCancel); |
106 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreviewFail); | 106 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, OnPrintPreviewFail); |
107 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, | 107 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, |
108 OnPrintForPrintPreview); | 108 OnPrintForPrintPreview); |
109 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, | 109 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, |
110 OnPrintForPrintPreviewFail); | 110 OnPrintForPrintPreviewFail); |
111 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, | 111 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, |
112 OnPrintPreviewForSelectedPages); | 112 OnPrintPreviewForSelectedPages); |
| 113 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, |
| 114 OnPrintPreviewUsingInvalidPrinterSettings); |
| 115 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperPreviewTest, |
| 116 OnPrintForPrintPreviewUsingInvalidPrinterSettings); |
113 | 117 |
114 #if defined(OS_WIN) || defined(OS_MACOSX) | 118 #if defined(OS_WIN) || defined(OS_MACOSX) |
115 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintLayoutTest); | 119 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintLayoutTest); |
116 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintWithIframe); | 120 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintWithIframe); |
117 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 121 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
118 | 122 |
119 // RenderViewObserver implementation. | 123 // RenderViewObserver implementation. |
120 virtual bool OnMessageReceived(const IPC::Message& message); | 124 virtual bool OnMessageReceived(const IPC::Message& message); |
121 virtual void PrintPage(WebKit::WebFrame* frame); | 125 virtual void PrintPage(WebKit::WebFrame* frame); |
122 | 126 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 FAIL_PRINT, | 165 FAIL_PRINT, |
162 FAIL_PREVIEW, | 166 FAIL_PREVIEW, |
163 }; | 167 }; |
164 | 168 |
165 // Notification when printing is done - signal tear-down/free resources. | 169 // Notification when printing is done - signal tear-down/free resources. |
166 void DidFinishPrinting(PrintingResult result); | 170 void DidFinishPrinting(PrintingResult result); |
167 | 171 |
168 // Print Settings ----------------------------------------------------------- | 172 // Print Settings ----------------------------------------------------------- |
169 | 173 |
170 // Initialize print page settings with default settings. | 174 // Initialize print page settings with default settings. |
171 bool InitPrintSettings(WebKit::WebFrame* frame, WebKit::WebNode* node); | 175 bool InitPrintSettings(WebKit::WebFrame* frame, |
| 176 WebKit::WebNode* node, |
| 177 bool is_preview); |
172 | 178 |
173 // Initialize print page settings with default settings and prepare the frame | 179 // Initialize print page settings with default settings and prepare the frame |
174 // for print. A new PrepareFrameAndViewForPrint is created to fulfill the | 180 // for print. A new PrepareFrameAndViewForPrint is created to fulfill the |
175 // request and is filled into the |prepare| argument. | 181 // request and is filled into the |prepare| argument. |
176 bool InitPrintSettingsAndPrepareFrame( | 182 bool InitPrintSettingsAndPrepareFrame( |
177 WebKit::WebFrame* frame, | 183 WebKit::WebFrame* frame, |
178 WebKit::WebNode* node, | 184 WebKit::WebNode* node, |
179 scoped_ptr<PrepareFrameAndViewForPrint>* prepare); | 185 scoped_ptr<PrepareFrameAndViewForPrint>* prepare); |
180 | 186 |
181 // Update the current print settings with new |job_settings|. |job_settings| | 187 // Update the current print settings with new |job_settings|. |job_settings| |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 416 |
411 State state_; | 417 State state_; |
412 }; | 418 }; |
413 | 419 |
414 PrintPreviewContext print_preview_context_; | 420 PrintPreviewContext print_preview_context_; |
415 | 421 |
416 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 422 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
417 }; | 423 }; |
418 | 424 |
419 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 425 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |