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

Side by Side Diff: components/printing/renderer/print_web_view_helper.cc

Issue 1480043002: [WIP] Call WebTestProxyBase::CheckDone() in didStopLoading() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 void FinishPrinting(); 600 void FinishPrinting();
601 601
602 bool IsLoadingSelection() { 602 bool IsLoadingSelection() {
603 // It's not selection if not |owns_web_view_|. 603 // It's not selection if not |owns_web_view_|.
604 return owns_web_view_ && frame() && frame()->isLoading(); 604 return owns_web_view_ && frame() && frame()->isLoading();
605 } 605 }
606 606
607 private: 607 private:
608 // blink::WebViewClient: 608 // blink::WebViewClient:
609 void didStopLoading() override; 609 void didStopLoading(blink::WebLocalFrame*) override;
610 // TODO(ojan): Remove this override and have this class use a non-null 610 // TODO(ojan): Remove this override and have this class use a non-null
611 // layerTreeView. 611 // layerTreeView.
612 bool allowsBrokenNullLayerTreeView() const override; 612 bool allowsBrokenNullLayerTreeView() const override;
613 613
614 // blink::WebFrameClient: 614 // blink::WebFrameClient:
615 blink::WebFrame* createChildFrame( 615 blink::WebFrame* createChildFrame(
616 blink::WebLocalFrame* parent, 616 blink::WebLocalFrame* parent,
617 blink::WebTreeScopeType scope, 617 blink::WebTreeScopeType scope,
618 const blink::WebString& name, 618 const blink::WebString& name,
619 blink::WebSandboxFlags sandboxFlags, 619 blink::WebSandboxFlags sandboxFlags,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 // When loading is done this will call didStopLoading() and that will do the 742 // When loading is done this will call didStopLoading() and that will do the
743 // actual printing. 743 // actual printing.
744 frame()->loadRequest(blink::WebURLRequest(GURL(url_str))); 744 frame()->loadRequest(blink::WebURLRequest(GURL(url_str)));
745 } 745 }
746 746
747 bool PrepareFrameAndViewForPrint::allowsBrokenNullLayerTreeView() const { 747 bool PrepareFrameAndViewForPrint::allowsBrokenNullLayerTreeView() const {
748 return true; 748 return true;
749 } 749 }
750 750
751 void PrepareFrameAndViewForPrint::didStopLoading() { 751 void PrepareFrameAndViewForPrint::didStopLoading(blink::WebLocalFrame*) {
752 DCHECK(!on_ready_.is_null()); 752 DCHECK(!on_ready_.is_null());
753 // Don't call callback here, because it can delete |this| and WebView that is 753 // Don't call callback here, because it can delete |this| and WebView that is
754 // called didStopLoading. 754 // called didStopLoading.
755 base::ThreadTaskRunnerHandle::Get()->PostTask( 755 base::ThreadTaskRunnerHandle::Get()->PostTask(
756 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, 756 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady,
757 weak_ptr_factory_.GetWeakPtr())); 757 weak_ptr_factory_.GetWeakPtr()));
758 } 758 }
759 759
760 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( 760 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
761 blink::WebLocalFrame* parent, 761 blink::WebLocalFrame* parent,
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 blink::WebConsoleMessage::LevelWarning, message)); 2253 blink::WebConsoleMessage::LevelWarning, message));
2254 return false; 2254 return false;
2255 } 2255 }
2256 2256
2257 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2257 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2258 // Reset counter on successful print. 2258 // Reset counter on successful print.
2259 count_ = 0; 2259 count_ = 0;
2260 } 2260 }
2261 2261
2262 } // namespace printing 2262 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698