| 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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 return false; | 930 return false; |
| 931 | 931 |
| 932 // If preview is enabled, then the print dialog is tab modal, and the user | 932 // If preview is enabled, then the print dialog is tab modal, and the user |
| 933 // can always close the tab on a mis-behaving page (the system print dialog | 933 // can always close the tab on a mis-behaving page (the system print dialog |
| 934 // is app modal). If the print was initiated through user action, don't | 934 // is app modal). If the print was initiated through user action, don't |
| 935 // throttle. Or, if the command line flag to skip throttling has been set. | 935 // throttle. Or, if the command line flag to skip throttling has been set. |
| 936 return user_initiated || g_is_preview_enabled || | 936 return user_initiated || g_is_preview_enabled || |
| 937 scripting_throttler_.IsAllowed(frame); | 937 scripting_throttler_.IsAllowed(frame); |
| 938 } | 938 } |
| 939 | 939 |
| 940 void PrintWebViewHelper::DidStartProvisionalLoad() { | 940 void PrintWebViewHelper::DidStartProvisionalLoad( |
| 941 blink::WebDataSource* data_source) { |
| 941 is_loading_ = true; | 942 is_loading_ = true; |
| 942 } | 943 } |
| 943 | 944 |
| 944 void PrintWebViewHelper::DidFailProvisionalLoad( | 945 void PrintWebViewHelper::DidFailProvisionalLoad( |
| 945 const blink::WebURLError& error) { | 946 const blink::WebURLError& error) { |
| 946 DidFinishLoad(); | 947 DidFinishLoad(); |
| 947 } | 948 } |
| 948 | 949 |
| 949 void PrintWebViewHelper::DidFinishLoad() { | 950 void PrintWebViewHelper::DidFinishLoad() { |
| 950 is_loading_ = false; | 951 is_loading_ = false; |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2359 blink::WebConsoleMessage::LevelWarning, message)); | 2360 blink::WebConsoleMessage::LevelWarning, message)); |
| 2360 return false; | 2361 return false; |
| 2361 } | 2362 } |
| 2362 | 2363 |
| 2363 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2364 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2364 // Reset counter on successful print. | 2365 // Reset counter on successful print. |
| 2365 count_ = 0; | 2366 count_ = 0; |
| 2366 } | 2367 } |
| 2367 | 2368 |
| 2368 } // namespace printing | 2369 } // namespace printing |
| OLD | NEW |