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

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

Issue 2036403002: Always use the WebFrameWidget when attaching the root graphics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding comments Created 4 years, 5 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
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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 bool allowsBrokenNullLayerTreeView() const override; 615 bool allowsBrokenNullLayerTreeView() const override;
616 616
617 // blink::WebFrameClient: 617 // blink::WebFrameClient:
618 blink::WebFrame* createChildFrame( 618 blink::WebFrame* createChildFrame(
619 blink::WebLocalFrame* parent, 619 blink::WebLocalFrame* parent,
620 blink::WebTreeScopeType scope, 620 blink::WebTreeScopeType scope,
621 const blink::WebString& name, 621 const blink::WebString& name,
622 const blink::WebString& unique_name, 622 const blink::WebString& unique_name,
623 blink::WebSandboxFlags sandbox_flags, 623 blink::WebSandboxFlags sandbox_flags,
624 const blink::WebFrameOwnerProperties& frame_owner_properties) override; 624 const blink::WebFrameOwnerProperties& frame_owner_properties) override;
625 void frameDetached(blink::WebFrame* frame, DetachType type) override; 625 void frameDetached(blink::WebLocalFrame* frame, DetachType type) override;
626 626
627 void CallOnReady(); 627 void CallOnReady();
628 void ResizeForPrinting(); 628 void ResizeForPrinting();
629 void RestoreSize(); 629 void RestoreSize();
630 void CopySelection(const WebPreferences& preferences); 630 void CopySelection(const WebPreferences& preferences);
631 631
632 FrameReference frame_; 632 FrameReference frame_;
633 blink::WebNode node_to_print_; 633 blink::WebNode node_to_print_;
634 bool owns_web_view_; 634 bool owns_web_view_;
635 blink::WebPrintParams web_print_params_; 635 blink::WebPrintParams web_print_params_;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 blink::WebTreeScopeType scope, 770 blink::WebTreeScopeType scope,
771 const blink::WebString& name, 771 const blink::WebString& name,
772 const blink::WebString& unique_name, 772 const blink::WebString& unique_name,
773 blink::WebSandboxFlags sandbox_flags, 773 blink::WebSandboxFlags sandbox_flags,
774 const blink::WebFrameOwnerProperties& frame_owner_properties) { 774 const blink::WebFrameOwnerProperties& frame_owner_properties) {
775 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); 775 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this);
776 parent->appendChild(frame); 776 parent->appendChild(frame);
777 return frame; 777 return frame;
778 } 778 }
779 779
780 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, 780 void PrepareFrameAndViewForPrint::frameDetached(blink::WebLocalFrame* frame,
781 DetachType type) { 781 DetachType type) {
782 DCHECK(type == DetachType::Remove); 782 DCHECK(type == DetachType::Remove);
783 if (frame->parent()) 783 if (frame->parent())
784 frame->parent()->removeChild(frame); 784 frame->parent()->removeChild(frame);
785 frame->close(); 785 frame->close();
786 } 786 }
787 787
788 void PrepareFrameAndViewForPrint::CallOnReady() { 788 void PrepareFrameAndViewForPrint::CallOnReady() {
789 return on_ready_.Run(); // Can delete |this|. 789 return on_ready_.Run(); // Can delete |this|.
790 } 790 }
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 blink::WebConsoleMessage::LevelWarning, message)); 2250 blink::WebConsoleMessage::LevelWarning, message));
2251 return false; 2251 return false;
2252 } 2252 }
2253 2253
2254 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2254 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2255 // Reset counter on successful print. 2255 // Reset counter on successful print.
2256 count_ = 0; 2256 count_ = 0;
2257 } 2257 }
2258 2258
2259 } // namespace printing 2259 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.h » ('j') | third_party/WebKit/Source/web/WebViewImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698