Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: android_webview/renderer/print_web_view_helper.cc

Issue 556923002: Use WebLocalFrame::isLoading(), not WebFrame::isLoading(), in print preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // TODO(sgurun) copied from chrome/renderer. Remove after crbug.com/322276 5 // TODO(sgurun) copied from chrome/renderer. Remove after crbug.com/322276
6 6
7 #include "android_webview/renderer/print_web_view_helper.h" 7 #include "android_webview/renderer/print_web_view_helper.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 void PrepareFrameAndViewForPrint::RestoreSize() { 717 void PrepareFrameAndViewForPrint::RestoreSize() {
718 if (frame()) { 718 if (frame()) {
719 blink::WebView* web_view = frame_.GetFrame()->view(); 719 blink::WebView* web_view = frame_.GetFrame()->view();
720 web_view->resize(prev_view_size_); 720 web_view->resize(prev_view_size_);
721 if (blink::WebFrame* web_frame = web_view->mainFrame()) 721 if (blink::WebFrame* web_frame = web_view->mainFrame())
722 web_frame->setScrollOffset(prev_scroll_offset_); 722 web_frame->setScrollOffset(prev_scroll_offset_);
723 } 723 }
724 } 724 }
725 725
726 void PrepareFrameAndViewForPrint::FinishPrinting() { 726 void PrepareFrameAndViewForPrint::FinishPrinting() {
727 blink::WebFrame* frame = frame_.GetFrame(); 727 blink::WebLocalFrame* frame = frame_.GetFrame();
728 if (frame) { 728 if (frame) {
729 blink::WebView* web_view = frame->view(); 729 blink::WebView* web_view = frame->view();
730 if (is_printing_started_) { 730 if (is_printing_started_) {
731 is_printing_started_ = false; 731 is_printing_started_ = false;
732 frame->printEnd(); 732 frame->printEnd();
733 if (!owns_web_view_) { 733 if (!owns_web_view_) {
734 web_view->settings()->setShouldPrintBackgrounds(false); 734 web_view->settings()->setShouldPrintBackgrounds(false);
735 RestoreSize(); 735 RestoreSize();
736 } 736 }
737 } 737 }
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 } 2016 }
2017 2017
2018 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { 2018 void PrintWebViewHelper::PrintPreviewContext::ClearContext() {
2019 prep_frame_view_.reset(); 2019 prep_frame_view_.reset();
2020 metafile_.reset(); 2020 metafile_.reset();
2021 pages_to_render_.clear(); 2021 pages_to_render_.clear();
2022 error_ = PREVIEW_ERROR_NONE; 2022 error_ = PREVIEW_ERROR_NONE;
2023 } 2023 }
2024 2024
2025 } // namespace printing 2025 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698