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

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

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove dep patch Created 5 years, 3 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 | content/browser/DEPS » ('j') | content/browser/frame_host/frame_tree_node.h » ('J')
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 <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 14 matching lines...) Expand all
25 #include "grit/components_resources.h" 25 #include "grit/components_resources.h"
26 #include "net/base/escape.h" 26 #include "net/base/escape.h"
27 #include "printing/pdf_metafile_skia.h" 27 #include "printing/pdf_metafile_skia.h"
28 #include "printing/units.h" 28 #include "printing/units.h"
29 #include "third_party/WebKit/public/platform/WebSize.h" 29 #include "third_party/WebKit/public/platform/WebSize.h"
30 #include "third_party/WebKit/public/platform/WebURLRequest.h" 30 #include "third_party/WebKit/public/platform/WebURLRequest.h"
31 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 31 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
32 #include "third_party/WebKit/public/web/WebDocument.h" 32 #include "third_party/WebKit/public/web/WebDocument.h"
33 #include "third_party/WebKit/public/web/WebElement.h" 33 #include "third_party/WebKit/public/web/WebElement.h"
34 #include "third_party/WebKit/public/web/WebFrameClient.h" 34 #include "third_party/WebKit/public/web/WebFrameClient.h"
35 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
35 #include "third_party/WebKit/public/web/WebLocalFrame.h" 36 #include "third_party/WebKit/public/web/WebLocalFrame.h"
36 #include "third_party/WebKit/public/web/WebPlugin.h" 37 #include "third_party/WebKit/public/web/WebPlugin.h"
37 #include "third_party/WebKit/public/web/WebPluginDocument.h" 38 #include "third_party/WebKit/public/web/WebPluginDocument.h"
38 #include "third_party/WebKit/public/web/WebPrintParams.h" 39 #include "third_party/WebKit/public/web/WebPrintParams.h"
39 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" 40 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h"
40 #include "third_party/WebKit/public/web/WebSandboxFlags.h" 41 #include "third_party/WebKit/public/web/WebSandboxFlags.h"
41 #include "third_party/WebKit/public/web/WebScriptSource.h" 42 #include "third_party/WebKit/public/web/WebScriptSource.h"
42 #include "third_party/WebKit/public/web/WebSettings.h" 43 #include "third_party/WebKit/public/web/WebSettings.h"
43 #include "third_party/WebKit/public/web/WebView.h" 44 #include "third_party/WebKit/public/web/WebView.h"
44 #include "third_party/WebKit/public/web/WebViewClient.h" 45 #include "third_party/WebKit/public/web/WebViewClient.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 593
593 protected: 594 protected:
594 // blink::WebViewClient override: 595 // blink::WebViewClient override:
595 virtual void didStopLoading(); 596 virtual void didStopLoading();
596 597
597 // blink::WebFrameClient override: 598 // blink::WebFrameClient override:
598 virtual blink::WebFrame* createChildFrame( 599 virtual blink::WebFrame* createChildFrame(
599 blink::WebLocalFrame* parent, 600 blink::WebLocalFrame* parent,
600 blink::WebTreeScopeType scope, 601 blink::WebTreeScopeType scope,
601 const blink::WebString& name, 602 const blink::WebString& name,
602 blink::WebSandboxFlags sandboxFlags); 603 blink::WebSandboxFlags sandboxFlags,
604 const blink::WebFrameOwnerProperties& frameOwnerProperties);
603 virtual void frameDetached(blink::WebFrame* frame, DetachType type); 605 virtual void frameDetached(blink::WebFrame* frame, DetachType type);
604 606
605 private: 607 private:
606 void CallOnReady(); 608 void CallOnReady();
607 void ResizeForPrinting(); 609 void ResizeForPrinting();
608 void RestoreSize(); 610 void RestoreSize();
609 void CopySelection(const WebPreferences& preferences); 611 void CopySelection(const WebPreferences& preferences);
610 612
611 FrameReference frame_; 613 FrameReference frame_;
612 blink::WebNode node_to_print_; 614 blink::WebNode node_to_print_;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 // called didStopLoading. 738 // called didStopLoading.
737 base::ThreadTaskRunnerHandle::Get()->PostTask( 739 base::ThreadTaskRunnerHandle::Get()->PostTask(
738 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, 740 FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady,
739 weak_ptr_factory_.GetWeakPtr())); 741 weak_ptr_factory_.GetWeakPtr()));
740 } 742 }
741 743
742 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( 744 blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
743 blink::WebLocalFrame* parent, 745 blink::WebLocalFrame* parent,
744 blink::WebTreeScopeType scope, 746 blink::WebTreeScopeType scope,
745 const blink::WebString& name, 747 const blink::WebString& name,
746 blink::WebSandboxFlags sandboxFlags) { 748 blink::WebSandboxFlags sandboxFlags,
749 const blink::WebFrameOwnerProperties& frameOwnerProperties) {
747 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); 750 blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this);
748 parent->appendChild(frame); 751 parent->appendChild(frame);
749 return frame; 752 return frame;
750 } 753 }
751 754
752 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame, 755 void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame,
753 DetachType type) { 756 DetachType type) {
754 DCHECK(type == DetachType::Remove); 757 DCHECK(type == DetachType::Remove);
755 if (frame->parent()) 758 if (frame->parent())
756 frame->parent()->removeChild(frame); 759 frame->parent()->removeChild(frame);
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 blink::WebConsoleMessage::LevelWarning, message)); 2099 blink::WebConsoleMessage::LevelWarning, message));
2097 return false; 2100 return false;
2098 } 2101 }
2099 2102
2100 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2103 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2101 // Reset counter on successful print. 2104 // Reset counter on successful print.
2102 count_ = 0; 2105 count_ = 0;
2103 } 2106 }
2104 2107
2105 } // namespace printing 2108 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | content/browser/DEPS » ('j') | content/browser/frame_host/frame_tree_node.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698