| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 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(); |
| 95 |
| 88 // Returns true if printing is overridden and the default behavior should be | 96 // Returns true if printing is overridden and the default behavior should be |
| 89 // skipped for |frame|. | 97 // skipped for |frame|. |
| 90 virtual bool OverridePrint(blink::WebLocalFrame* frame) = 0; | 98 virtual bool OverridePrint(blink::WebLocalFrame* frame) = 0; |
| 91 }; | 99 }; |
| 92 | 100 |
| 93 PrintWebViewHelper(content::RenderView* render_view, | 101 PrintWebViewHelper(content::RenderView* render_view, |
| 94 scoped_ptr<Delegate> delegate); | 102 scoped_ptr<Delegate> delegate); |
| 95 ~PrintWebViewHelper() override; | 103 ~PrintWebViewHelper() override; |
| 96 | 104 |
| 97 // Disable print preview and switch to system dialog printing even if full | 105 // Disable print preview and switch to system dialog printing even if full |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 base::Closure on_stop_loading_closure_; | 502 base::Closure on_stop_loading_closure_; |
| 495 | 503 |
| 496 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 504 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
| 497 | 505 |
| 498 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 506 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 499 }; | 507 }; |
| 500 | 508 |
| 501 } // namespace printing | 509 } // namespace printing |
| 502 | 510 |
| 503 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 511 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |