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 598 matching lines...) Loading... |
609 void didStopLoading() override; | 609 void didStopLoading() 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 const blink::WebString& unique_name, |
620 const blink::WebFrameOwnerProperties& frameOwnerProperties) override; | 620 blink::WebSandboxFlags sandbox_flags, |
| 621 const blink::WebFrameOwnerProperties& frame_owner_properties) override; |
621 void frameDetached(blink::WebFrame* frame, DetachType type) override; | 622 void frameDetached(blink::WebFrame* frame, DetachType type) override; |
622 | 623 |
623 void CallOnReady(); | 624 void CallOnReady(); |
624 void ResizeForPrinting(); | 625 void ResizeForPrinting(); |
625 void RestoreSize(); | 626 void RestoreSize(); |
626 void CopySelection(const WebPreferences& preferences); | 627 void CopySelection(const WebPreferences& preferences); |
627 | 628 |
628 FrameReference frame_; | 629 FrameReference frame_; |
629 blink::WebNode node_to_print_; | 630 blink::WebNode node_to_print_; |
630 bool owns_web_view_; | 631 bool owns_web_view_; |
(...skipping 123 matching lines...) Loading... |
754 // called didStopLoading. | 755 // called didStopLoading. |
755 base::ThreadTaskRunnerHandle::Get()->PostTask( | 756 base::ThreadTaskRunnerHandle::Get()->PostTask( |
756 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, | 757 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, |
757 weak_ptr_factory_.GetWeakPtr())); | 758 weak_ptr_factory_.GetWeakPtr())); |
758 } | 759 } |
759 | 760 |
760 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( | 761 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( |
761 blink::WebLocalFrame* parent, | 762 blink::WebLocalFrame* parent, |
762 blink::WebTreeScopeType scope, | 763 blink::WebTreeScopeType scope, |
763 const blink::WebString& name, | 764 const blink::WebString& name, |
764 blink::WebSandboxFlags sandboxFlags, | 765 const blink::WebString& unique_name, |
765 const blink::WebFrameOwnerProperties& frameOwnerProperties) { | 766 blink::WebSandboxFlags sandbox_flags, |
| 767 const blink::WebFrameOwnerProperties& frame_owner_properties) { |
766 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); | 768 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); |
767 parent->appendChild(frame); | 769 parent->appendChild(frame); |
768 return frame; | 770 return frame; |
769 } | 771 } |
770 | 772 |
771 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, | 773 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, |
772 DetachType type) { | 774 DetachType type) { |
773 DCHECK(type == DetachType::Remove); | 775 DCHECK(type == DetachType::Remove); |
774 if (frame->parent()) | 776 if (frame->parent()) |
775 frame->parent()->removeChild(frame); | 777 frame->parent()->removeChild(frame); |
(...skipping 1460 matching lines...) Loading... |
2236 blink::WebConsoleMessage::LevelWarning, message)); | 2238 blink::WebConsoleMessage::LevelWarning, message)); |
2237 return false; | 2239 return false; |
2238 } | 2240 } |
2239 | 2241 |
2240 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2242 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
2241 // Reset counter on successful print. | 2243 // Reset counter on successful print. |
2242 count_ = 0; | 2244 count_ = 0; |
2243 } | 2245 } |
2244 | 2246 |
2245 } // namespace printing | 2247 } // namespace printing |
OLD | NEW |