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

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

Issue 2936423003: Move Get/SetScrollOffset methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: Use WebViewHelper::LocalMainFrame() where possible. Created 3 years, 6 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 | third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h » ('j') | no next file with comments »
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 b7cce0b2882a8ced664176879c5a2104b1b0406f..2011f0cfea5994c213c3db430dfb5ab0691fa958 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -759,8 +759,10 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
// Backup size and offset if it's a local frame.
blink::WebView* web_view = frame_.view();
if (blink::WebFrame* web_frame = web_view->MainFrame()) {
+ // TODO(lukasza, weili): Support restoring scroll offset of a remote main
+ // frame - https://crbug.com/734815.
if (web_frame->IsWebLocalFrame())
- prev_scroll_offset_ = web_frame->GetScrollOffset();
+ prev_scroll_offset_ = web_frame->ToWebLocalFrame()->GetScrollOffset();
}
prev_view_size_ = web_view->Size();
@@ -861,8 +863,10 @@ void PrepareFrameAndViewForPrint::RestoreSize() {
blink::WebView* web_view = frame_.GetFrame()->View();
web_view->Resize(prev_view_size_);
if (blink::WebFrame* web_frame = web_view->MainFrame()) {
+ // TODO(lukasza, weili): Support restoring scroll offset of a remote main
+ // frame - https://crbug.com/734815.
if (web_frame->IsWebLocalFrame())
- web_frame->SetScrollOffset(prev_scroll_offset_);
+ web_frame->ToWebLocalFrame()->SetScrollOffset(prev_scroll_offset_);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698