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 // Used to know whether the content to print could be nested in an iframe. | 83 // Used to know whether the content to print could be nested in an iframe. |
84 virtual bool IsOutOfProcessPdfEnabled() = 0; | 84 virtual bool IsOutOfProcessPdfEnabled() = 0; |
85 | 85 |
86 virtual bool IsPrintPreviewEnabled() = 0; | 86 virtual bool IsPrintPreviewEnabled() = 0; |
| 87 |
| 88 // If true, the user can be asked to provide print settings. |
| 89 // The default implementation returns |true|. |
| 90 virtual bool IsAskPrintSettingsEnabled(); |
| 91 |
| 92 // If false, window.print() won't do anything. |
| 93 // The default implementation returns |true|. |
| 94 virtual bool IsScriptedPrintEnabled(); |
87 }; | 95 }; |
88 | 96 |
89 PrintWebViewHelper(content::RenderView* render_view, | 97 PrintWebViewHelper(content::RenderView* render_view, |
90 scoped_ptr<Delegate> delegate); | 98 scoped_ptr<Delegate> delegate); |
91 ~PrintWebViewHelper() override; | 99 ~PrintWebViewHelper() override; |
92 | 100 |
93 // Disable print preview and switch to system dialog printing even if full | 101 // Disable print preview and switch to system dialog printing even if full |
94 // printing is build-in. This method is used by CEF. | 102 // printing is build-in. This method is used by CEF. |
95 static void DisablePreview(); | 103 static void DisablePreview(); |
96 | 104 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 base::Closure on_stop_loading_closure_; | 498 base::Closure on_stop_loading_closure_; |
491 | 499 |
492 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 500 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
493 | 501 |
494 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 502 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
495 }; | 503 }; |
496 | 504 |
497 } // namespace printing | 505 } // namespace printing |
498 | 506 |
499 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 507 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |