| 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_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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const printing::PageSizeMargins& page_layout_in_points, | 153 const printing::PageSizeMargins& page_layout_in_points, |
| 154 gfx::Size* page_size, | 154 gfx::Size* page_size, |
| 155 gfx::Rect* content_area); | 155 gfx::Rect* content_area); |
| 156 | 156 |
| 157 // Update |ignore_css_margins_| based on settings. | 157 // Update |ignore_css_margins_| based on settings. |
| 158 void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); | 158 void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); |
| 159 | 159 |
| 160 // Returns true if the current destination printer is PRINT_TO_PDF. | 160 // Returns true if the current destination printer is PRINT_TO_PDF. |
| 161 bool IsPrintToPdfRequested(const base::DictionaryValue& settings); | 161 bool IsPrintToPdfRequested(const base::DictionaryValue& settings); |
| 162 | 162 |
| 163 // Returns false if |
| 164 // (1) The current destination printer is SAVE_AS_PDF or |
| 165 // (2) Source is PDF. This is the first preview request and print scaling |
| 166 // option is disabled for initiator renderer plugin. |
| 167 // (3) Source is PDF and the user has requested not to fit to printable area |
| 168 // via |job_settings|. |
| 169 // In all other cases returns true to fit the print contents in paper size. |
| 170 bool IsFitToPaperSizeRequested(bool source_is_html, |
| 171 const base::DictionaryValue& job_settings, |
| 172 const PrintMsg_Print_Params& params); |
| 173 |
| 163 // Initiate print preview. | 174 // Initiate print preview. |
| 164 void OnInitiatePrintPreview(); | 175 void OnInitiatePrintPreview(); |
| 165 | 176 |
| 166 // Start the process of generating a print preview using |settings|. | 177 // Start the process of generating a print preview using |settings|. |
| 167 void OnPrintPreview(const base::DictionaryValue& settings); | 178 void OnPrintPreview(const base::DictionaryValue& settings); |
| 168 | 179 |
| 169 // Initialize the print preview document. | 180 // Initialize the print preview document. |
| 170 bool CreatePreviewDocument(); | 181 bool CreatePreviewDocument(); |
| 171 | 182 |
| 172 // Renders a print preview page. |page_number| is 0-based. | 183 // Renders a print preview page. |page_number| is 0-based. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 enum PrintPreviewErrorBuckets error_; | 478 enum PrintPreviewErrorBuckets error_; |
| 468 | 479 |
| 469 State state_; | 480 State state_; |
| 470 }; | 481 }; |
| 471 | 482 |
| 472 PrintPreviewContext print_preview_context_; | 483 PrintPreviewContext print_preview_context_; |
| 473 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 484 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 474 }; | 485 }; |
| 475 | 486 |
| 476 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 487 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |