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

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2046793002: Move didMeaningfulLayout calls from WebViewClient to WebWidgetClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: print 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/printing/renderer/print_web_view_helper.cc
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index d824dfe2d5ba37c9e8a9fa3b7c9e67f419e198b4..8ebda25350d56b887e2e3b7f7c8465e65e6a7139 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -39,6 +39,7 @@
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrameClient.h"
#include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
+#include "third_party/WebKit/public/web/WebFrameWidget.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPlugin.h"
#include "third_party/WebKit/public/web/WebPluginDocument.h"
@@ -529,6 +530,8 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebLocalFrame* frame =
blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, NULL);
web_view->setMainFrame(frame);
+ blink::WebFrameWidget* widget =
+ blink::WebFrameWidget::create(nullptr, web_view, frame);
base::StringValue html(ResourceBundle::GetSharedInstance().GetLocalizedString(
IDR_PRINT_PREVIEW_PAGE));
@@ -558,6 +561,7 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
frame->printPage(0, canvas);
frame->printEnd();
+ widget->close();
web_view->close();
frame->close();
}
@@ -744,8 +748,10 @@ void PrepareFrameAndViewForPrint::CopySelection(
blink::WebView::create(this, blink::WebPageVisibilityStateVisible);
owns_web_view_ = true;
content::RenderView::ApplyWebPreferences(prefs, web_view);
- web_view->setMainFrame(
- blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this));
+ blink::WebLocalFrame* main_frame =
+ blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
+ web_view->setMainFrame(main_frame);
+ blink::WebFrameWidget::create(this, web_view, main_frame);
frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
node_to_print_.reset();
@@ -815,6 +821,7 @@ void PrepareFrameAndViewForPrint::FinishPrinting() {
if (owns_web_view_) {
DCHECK(!frame->isLoading());
owns_web_view_ = false;
+ frame->frameWidget()->close();
web_view->close();
}
}
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698