|
@@ -12,7 +12,7 @@
|
|
|
#include "base/json/json_writer.h"
|
|
|
#include "base/logging.h"
|
|
|
#include "base/message_loop/message_loop.h"
|
|
|
-#include "base/metrics/histogram.h"
|
|
|
+#include "base/metrics/histogram_macros.h"
|
|
|
#include "base/process/process_handle.h"
|
|
|
#include "base/strings/string_number_conversions.h"
|
|
|
#include "base/strings/stringprintf.h"
|
|
@@ -32,6 +32,7 @@
|
|
|
#include "third_party/WebKit/public/web/WebDocument.h"
|
|
|
#include "third_party/WebKit/public/web/WebElement.h"
|
|
|
#include "third_party/WebKit/public/web/WebFrameClient.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"
|
|
@@ -484,12 +485,9 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
|
|
|
|
|
|
// Backup size and offset if it's a local frame.
|
|
|
blink::WebView* web_view = frame_.view();
|
|
|
- // Backup size and offset.
|
|
|
- if (blink::WebFrame* web_frame = web_view->mainFrame())
|
|
|
- prev_scroll_offset_ = web_frame->scrollOffset();
|
|
|
if (blink::WebFrame* web_frame = web_view->mainFrame()) {
|
|
|
if (web_frame->isWebLocalFrame())
|
|
|
- prev_scroll_offset_ = web_frame->scrollOffset();
|
|
|
+ prev_scroll_offset_ = web_frame->getScrollOffset();
|
|
|
}
|
|
|
prev_view_size_ = web_view->size();
|
|
|
|
|
@@ -535,8 +533,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, nullptr, nullptr);
|
|
|
+ web_view->setMainFrame(main_frame);
|
|
|
+ blink::WebFrameWidget::create(this, web_view, main_frame);
|
|
|
frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
|
|
|
node_to_print_.reset();
|
|
|
|
|
@@ -565,7 +565,8 @@ blink::WebLocalFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
|
|
const blink::WebString& unique_name,
|
|
|
blink::WebSandboxFlags sandbox_flags,
|
|
|
const blink::WebFrameOwnerProperties& frame_owner_properties) {
|
|
|
- blink::WebLocalFrame* frame = blink::WebLocalFrame::create(scope, this);
|
|
|
+ blink::WebLocalFrame* frame = blink::WebLocalFrame::create(
|
|
|
+ scope, this, nullptr, nullptr);
|
|
|
parent->appendChild(frame);
|
|
|
return frame;
|
|
|
}
|