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 COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
6 #define COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 int routing_id) = 0; | 77 int routing_id) = 0; |
78 | 78 |
79 // Returns the element to be printed. Returns a null WebElement if | 79 // Returns the element to be printed. Returns a null WebElement if |
80 // a pdf plugin element can't be extracted from the frame. | 80 // a pdf plugin element can't be extracted from the frame. |
81 virtual blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) = 0; | 81 virtual blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) = 0; |
82 }; | 82 }; |
83 | 83 |
84 PrintWebViewHelper(content::RenderView* render_view, | 84 PrintWebViewHelper(content::RenderView* render_view, |
85 bool out_of_process_pdf_enabled, | 85 bool out_of_process_pdf_enabled, |
86 bool print_preview_disabled, | 86 bool print_preview_disabled, |
| 87 bool should_ask_print_settings, |
87 scoped_ptr<Delegate> delegate); | 88 scoped_ptr<Delegate> delegate); |
88 ~PrintWebViewHelper() override; | 89 ~PrintWebViewHelper() override; |
89 | 90 |
90 // Disable print preview and switch to system dialog printing even if full | 91 // Disable print preview and switch to system dialog printing even if full |
91 // printing is build-in. This method is used by CEF. | 92 // printing is build-in. This method is used by CEF. |
92 static void DisablePreview(); | 93 static void DisablePreview(); |
93 | 94 |
94 bool IsPrintingEnabled(); | 95 bool IsPrintingEnabled(); |
95 | 96 |
96 void PrintNode(const blink::WebNode& node); | 97 void PrintNode(const blink::WebNode& node); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // Let the browser process know of a printing failure. Only set to false when | 342 // Let the browser process know of a printing failure. Only set to false when |
342 // the failure came from the browser in the first place. | 343 // the failure came from the browser in the first place. |
343 bool notify_browser_of_print_failure_; | 344 bool notify_browser_of_print_failure_; |
344 | 345 |
345 // True, when printing from print preview. | 346 // True, when printing from print preview. |
346 bool print_for_preview_; | 347 bool print_for_preview_; |
347 | 348 |
348 // Whether the content to print could be nested in an iframe. | 349 // Whether the content to print could be nested in an iframe. |
349 const bool out_of_process_pdf_enabled_; | 350 const bool out_of_process_pdf_enabled_; |
350 | 351 |
| 352 // Whether settings should be asked when printing. |
| 353 const bool should_ask_print_settings_; |
| 354 |
351 // Used to check the prerendering status. | 355 // Used to check the prerendering status. |
352 const scoped_ptr<Delegate> delegate_; | 356 const scoped_ptr<Delegate> delegate_; |
353 | 357 |
354 // Keeps track of the state of print preview between messages. | 358 // Keeps track of the state of print preview between messages. |
355 // TODO(vitalybuka): Create PrintPreviewContext when needed and delete after | 359 // TODO(vitalybuka): Create PrintPreviewContext when needed and delete after |
356 // use. Now it's interaction with various messages is confusing. | 360 // use. Now it's interaction with various messages is confusing. |
357 class PrintPreviewContext { | 361 class PrintPreviewContext { |
358 public: | 362 public: |
359 PrintPreviewContext(); | 363 PrintPreviewContext(); |
360 ~PrintPreviewContext(); | 364 ~PrintPreviewContext(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 base::Closure on_stop_loading_closure_; | 494 base::Closure on_stop_loading_closure_; |
491 | 495 |
492 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 496 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
493 | 497 |
494 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 498 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
495 }; | 499 }; |
496 | 500 |
497 } // namespace printing | 501 } // namespace printing |
498 | 502 |
499 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 503 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |