Index: chrome/renderer/print_web_view_helper.cc |
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc |
index c46a383165995a6e00ffcc8c042480b9cb26b5f5..1389cd729cf9141c071ea9b41fd43bec0f216020 100644 |
--- a/chrome/renderer/print_web_view_helper.cc |
+++ b/chrome/renderer/print_web_view_helper.cc |
@@ -71,6 +71,8 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint( |
print_layout_size.set_height(static_cast<int>( |
static_cast<double>(print_layout_size.height()) * 1.25)); |
+ if (WebFrame* web_frame = web_view_->mainFrame()) |
+ prev_scroll_offset_ = web_frame->scrollOffset(); |
prev_view_size_ = web_view->size(); |
web_view->resize(print_layout_size); |
@@ -86,6 +88,8 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint( |
PrepareFrameAndViewForPrint::~PrepareFrameAndViewForPrint() { |
frame_->printEnd(); |
web_view_->resize(prev_view_size_); |
+ if (WebFrame* web_frame = web_view_->mainFrame()) |
+ web_frame->setScrollOffset(prev_scroll_offset_); |
} |