| 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 web_frame->setScrollOffset(prev_scroll_offset_); | 796 web_frame->setScrollOffset(prev_scroll_offset_); |
| 797 } | 797 } |
| 798 } | 798 } |
| 799 | 799 |
| 800 void PrepareFrameAndViewForPrint::FinishPrinting() { | 800 void PrepareFrameAndViewForPrint::FinishPrinting() { |
| 801 blink::WebLocalFrame* frame = frame_.GetFrame(); | 801 blink::WebLocalFrame* frame = frame_.GetFrame(); |
| 802 if (frame) { | 802 if (frame) { |
| 803 blink::WebView* web_view = frame->view(); | 803 blink::WebView* web_view = frame->view(); |
| 804 if (is_printing_started_) { | 804 if (is_printing_started_) { |
| 805 is_printing_started_ = false; | 805 is_printing_started_ = false; |
| 806 frame->printEnd(); | |
| 807 if (!owns_web_view_) { | 806 if (!owns_web_view_) { |
| 808 web_view->settings()->setShouldPrintBackgrounds(false); | 807 web_view->settings()->setShouldPrintBackgrounds(false); |
| 809 RestoreSize(); | 808 RestoreSize(); |
| 810 } | 809 } |
| 810 frame->printEnd(); |
| 811 } | 811 } |
| 812 if (owns_web_view_) { | 812 if (owns_web_view_) { |
| 813 DCHECK(!frame->isLoading()); | 813 DCHECK(!frame->isLoading()); |
| 814 owns_web_view_ = false; | 814 owns_web_view_ = false; |
| 815 frame->frameWidget()->close(); | 815 frame->frameWidget()->close(); |
| 816 web_view->close(); | 816 web_view->close(); |
| 817 } | 817 } |
| 818 } | 818 } |
| 819 frame_.Reset(NULL); | 819 frame_.Reset(NULL); |
| 820 on_ready_.Reset(); | 820 on_ready_.Reset(); |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2250 blink::WebConsoleMessage::LevelWarning, message)); | 2250 blink::WebConsoleMessage::LevelWarning, message)); |
| 2251 return false; | 2251 return false; |
| 2252 } | 2252 } |
| 2253 | 2253 |
| 2254 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2254 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2255 // Reset counter on successful print. | 2255 // Reset counter on successful print. |
| 2256 count_ = 0; | 2256 count_ = 0; |
| 2257 } | 2257 } |
| 2258 | 2258 |
| 2259 } // namespace printing | 2259 } // namespace printing |
| OLD | NEW |