| 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 #include "chrome/renderer/printing/print_web_view_helper.h" | 5 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 reset_prep_frame_view_(false), | 777 reset_prep_frame_view_(false), |
| 778 is_print_ready_metafile_sent_(false), | 778 is_print_ready_metafile_sent_(false), |
| 779 ignore_css_margins_(false), | 779 ignore_css_margins_(false), |
| 780 is_scripted_printing_blocked_(false), | 780 is_scripted_printing_blocked_(false), |
| 781 notify_browser_of_print_failure_(true), | 781 notify_browser_of_print_failure_(true), |
| 782 print_for_preview_(false), | 782 print_for_preview_(false), |
| 783 print_node_in_progress_(false), | 783 print_node_in_progress_(false), |
| 784 is_loading_(false), | 784 is_loading_(false), |
| 785 is_scripted_preview_delayed_(false), | 785 is_scripted_preview_delayed_(false), |
| 786 weak_ptr_factory_(this) { | 786 weak_ptr_factory_(this) { |
| 787 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 788 switches::kDisablePrintPreview)) { | |
| 789 DisablePreview(); | |
| 790 } | |
| 791 } | 787 } |
| 792 | 788 |
| 793 PrintWebViewHelper::~PrintWebViewHelper() {} | 789 PrintWebViewHelper::~PrintWebViewHelper() {} |
| 794 | 790 |
| 795 // static | 791 // static |
| 796 void PrintWebViewHelper::DisablePreview() { | 792 void PrintWebViewHelper::DisablePreview() { |
| 797 g_is_preview_enabled_ = false; | 793 g_is_preview_enabled_ = false; |
| 798 } | 794 } |
| 799 | 795 |
| 800 bool PrintWebViewHelper::IsScriptInitiatedPrintAllowed( | 796 bool PrintWebViewHelper::IsScriptInitiatedPrintAllowed( |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 blink::WebConsoleMessage::LevelWarning, message)); | 2017 blink::WebConsoleMessage::LevelWarning, message)); |
| 2022 return false; | 2018 return false; |
| 2023 } | 2019 } |
| 2024 | 2020 |
| 2025 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2021 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2026 // Reset counter on successful print. | 2022 // Reset counter on successful print. |
| 2027 count_ = 0; | 2023 count_ = 0; |
| 2028 } | 2024 } |
| 2029 | 2025 |
| 2030 } // namespace printing | 2026 } // namespace printing |
| OLD | NEW |