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...) Expand 10 before | Expand all | Expand 10 after 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 const blink::WebString& uniqueName, |
619 blink::WebSandboxFlags sandboxFlags, | 620 blink::WebSandboxFlags sandboxFlags, |
620 const blink::WebFrameOwnerProperties& frameOwnerProperties) override; | 621 const blink::WebFrameOwnerProperties& frameOwnerProperties) 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_; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 // 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 |
753 // called didStopLoading. | 754 // called didStopLoading. |
754 base::ThreadTaskRunnerHandle::Get()->PostTask( | 755 base::ThreadTaskRunnerHandle::Get()->PostTask( |
755 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, | 756 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, |
756 weak_ptr_factory_.GetWeakPtr())); | 757 weak_ptr_factory_.GetWeakPtr())); |
757 } | 758 } |
758 | 759 |
759 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( | 760 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( |
760 blink::WebLocalFrame* parent, | 761 blink::WebLocalFrame* parent, |
761 blink::WebTreeScopeType scope, | 762 blink::WebTreeScopeType scope, |
762 const blink::WebString& name, | 763 const blink::WebString& /* name */, |
763 blink::WebSandboxFlags sandboxFlags, | 764 const blink::WebString& /* uniqueName */, |
764 const blink::WebFrameOwnerProperties& frameOwnerProperties) { | 765 blink::WebSandboxFlags /* sandboxFlags */, |
| 766 const blink::WebFrameOwnerProperties& /* frameOwnerProperties */) { |
765 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); | 767 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); |
766 parent->appendChild(frame); | 768 parent->appendChild(frame); |
767 return frame; | 769 return frame; |
768 } | 770 } |
769 | 771 |
770 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, | 772 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, |
771 DetachType type) { | 773 DetachType type) { |
772 DCHECK(type == DetachType::Remove); | 774 DCHECK(type == DetachType::Remove); |
773 if (frame->parent()) | 775 if (frame->parent()) |
774 frame->parent()->removeChild(frame); | 776 frame->parent()->removeChild(frame); |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 blink::WebConsoleMessage::LevelWarning, message)); | 2250 blink::WebConsoleMessage::LevelWarning, message)); |
2249 return false; | 2251 return false; |
2250 } | 2252 } |
2251 | 2253 |
2252 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2254 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
2253 // Reset counter on successful print. | 2255 // Reset counter on successful print. |
2254 count_ = 0; | 2256 count_ = 0; |
2255 } | 2257 } |
2256 | 2258 |
2257 } // namespace printing | 2259 } // namespace printing |
OLD | NEW |