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 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 #endif // defined(ENABLE_PRINT_PREVIEW) | 935 #endif // defined(ENABLE_PRINT_PREVIEW) |
936 IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, | 936 IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, |
937 SetScriptedPrintBlocked) | 937 SetScriptedPrintBlocked) |
938 IPC_MESSAGE_UNHANDLED(handled = false) | 938 IPC_MESSAGE_UNHANDLED(handled = false) |
939 IPC_END_MESSAGE_MAP() | 939 IPC_END_MESSAGE_MAP() |
940 | 940 |
941 --ipc_nesting_level_; | 941 --ipc_nesting_level_; |
942 return handled; | 942 return handled; |
943 } | 943 } |
944 | 944 |
| 945 void PrintWebViewHelper::OnDestruct() { |
| 946 delete this; |
| 947 } |
| 948 |
945 bool PrintWebViewHelper::GetPrintFrame(blink::WebLocalFrame** frame) { | 949 bool PrintWebViewHelper::GetPrintFrame(blink::WebLocalFrame** frame) { |
946 DCHECK(frame); | 950 DCHECK(frame); |
947 blink::WebView* webView = render_view()->GetWebView(); | 951 blink::WebView* webView = render_view()->GetWebView(); |
948 DCHECK(webView); | 952 DCHECK(webView); |
949 if (!webView) | 953 if (!webView) |
950 return false; | 954 return false; |
951 | 955 |
952 // If the user has selected text in the currently focused frame we print | 956 // If the user has selected text in the currently focused frame we print |
953 // only that frame (this makes print selection work for multiple frames). | 957 // only that frame (this makes print selection work for multiple frames). |
954 blink::WebLocalFrame* focusedFrame = | 958 blink::WebLocalFrame* focusedFrame = |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 blink::WebConsoleMessage::LevelWarning, message)); | 2249 blink::WebConsoleMessage::LevelWarning, message)); |
2246 return false; | 2250 return false; |
2247 } | 2251 } |
2248 | 2252 |
2249 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2253 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
2250 // Reset counter on successful print. | 2254 // Reset counter on successful print. |
2251 count_ = 0; | 2255 count_ = 0; |
2252 } | 2256 } |
2253 | 2257 |
2254 } // namespace printing | 2258 } // namespace printing |
OLD | NEW |