| 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();
|
| }
|
| }
|
|
|