| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 void didStopLoading() override; | 673 void didStopLoading() override; |
| 674 // TODO(ojan): Remove this override and have this class use a non-null | 674 // TODO(ojan): Remove this override and have this class use a non-null |
| 675 // layerTreeView. | 675 // layerTreeView. |
| 676 bool allowsBrokenNullLayerTreeView() const override; | 676 bool allowsBrokenNullLayerTreeView() const override; |
| 677 | 677 |
| 678 // blink::WebFrameClient: | 678 // blink::WebFrameClient: |
| 679 blink::WebLocalFrame* createChildFrame( | 679 blink::WebLocalFrame* createChildFrame( |
| 680 blink::WebLocalFrame* parent, | 680 blink::WebLocalFrame* parent, |
| 681 blink::WebTreeScopeType scope, | 681 blink::WebTreeScopeType scope, |
| 682 const blink::WebString& name, | 682 const blink::WebString& name, |
| 683 const blink::WebString& unique_name, | 683 const blink::WebString& fallback_name, |
| 684 blink::WebSandboxFlags sandbox_flags, | 684 blink::WebSandboxFlags sandbox_flags, |
| 685 const blink::WebFrameOwnerProperties& frame_owner_properties) override; | 685 const blink::WebFrameOwnerProperties& frame_owner_properties) override; |
| 686 | 686 |
| 687 void CallOnReady(); | 687 void CallOnReady(); |
| 688 void ResizeForPrinting(); | 688 void ResizeForPrinting(); |
| 689 void RestoreSize(); | 689 void RestoreSize(); |
| 690 void CopySelection(const WebPreferences& preferences); | 690 void CopySelection(const WebPreferences& preferences); |
| 691 | 691 |
| 692 FrameReference frame_; | 692 FrameReference frame_; |
| 693 blink::WebNode node_to_print_; | 693 blink::WebNode node_to_print_; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 // called didStopLoading. | 832 // called didStopLoading. |
| 833 base::ThreadTaskRunnerHandle::Get()->PostTask( | 833 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 834 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, | 834 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, |
| 835 weak_ptr_factory_.GetWeakPtr())); | 835 weak_ptr_factory_.GetWeakPtr())); |
| 836 } | 836 } |
| 837 | 837 |
| 838 blink::WebLocalFrame* PrepareFrameAndViewForPrint::createChildFrame( | 838 blink::WebLocalFrame* PrepareFrameAndViewForPrint::createChildFrame( |
| 839 blink::WebLocalFrame* parent, | 839 blink::WebLocalFrame* parent, |
| 840 blink::WebTreeScopeType scope, | 840 blink::WebTreeScopeType scope, |
| 841 const blink::WebString& name, | 841 const blink::WebString& name, |
| 842 const blink::WebString& unique_name, | 842 const blink::WebString& fallback_name, |
| 843 blink::WebSandboxFlags sandbox_flags, | 843 blink::WebSandboxFlags sandbox_flags, |
| 844 const blink::WebFrameOwnerProperties& frame_owner_properties) { | 844 const blink::WebFrameOwnerProperties& frame_owner_properties) { |
| 845 blink::WebLocalFrame* frame = | 845 blink::WebLocalFrame* frame = |
| 846 blink::WebLocalFrame::create(scope, this, nullptr, nullptr); | 846 blink::WebLocalFrame::create(scope, this, nullptr, nullptr); |
| 847 parent->appendChild(frame); | 847 parent->appendChild(frame); |
| 848 return frame; | 848 return frame; |
| 849 } | 849 } |
| 850 | 850 |
| 851 void PrepareFrameAndViewForPrint::CallOnReady() { | 851 void PrepareFrameAndViewForPrint::CallOnReady() { |
| 852 return on_ready_.Run(); // Can delete |this|. | 852 return on_ready_.Run(); // Can delete |this|. |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 blink::WebConsoleMessage::LevelWarning, message)); | 2368 blink::WebConsoleMessage::LevelWarning, message)); |
| 2369 return false; | 2369 return false; |
| 2370 } | 2370 } |
| 2371 | 2371 |
| 2372 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2372 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2373 // Reset counter on successful print. | 2373 // Reset counter on successful print. |
| 2374 count_ = 0; | 2374 count_ = 0; |
| 2375 } | 2375 } |
| 2376 | 2376 |
| 2377 } // namespace printing | 2377 } // namespace printing |
| OLD | NEW |