Commit 2fc7bab9 authored by fsamuel's avatar fsamuel Committed by Commit bot

Implement RenderWidgetHostViewAndroid::GetLastScrollOffset

Apparently this code was being hit on Android. This CL implements the scroll
offset the same way it's implemented on other platforms.

BUG=409792
NOTRY=true
TBR=aelias@chromium.org

Review URL: https://codereview.chromium.org/533483004

Cr-Commit-Position: refs/heads/master@{#292956}
parent 92ec868f
...@@ -427,8 +427,7 @@ bool RenderWidgetHostViewAndroid::HasValidFrame() const { ...@@ -427,8 +427,7 @@ bool RenderWidgetHostViewAndroid::HasValidFrame() const {
} }
gfx::Vector2dF RenderWidgetHostViewAndroid::GetLastScrollOffset() const { gfx::Vector2dF RenderWidgetHostViewAndroid::GetLastScrollOffset() const {
NOTREACHED(); return last_scroll_offset_;
return gfx::Vector2dF();
} }
gfx::NativeView RenderWidgetHostViewAndroid::GetNativeView() const { gfx::NativeView RenderWidgetHostViewAndroid::GetNativeView() const {
...@@ -1034,6 +1033,7 @@ void RenderWidgetHostViewAndroid::ComputeContentsSize( ...@@ -1034,6 +1033,7 @@ void RenderWidgetHostViewAndroid::ComputeContentsSize(
void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame( void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame(
uint32 output_surface_id, uint32 output_surface_id,
scoped_ptr<cc::CompositorFrame> frame) { scoped_ptr<cc::CompositorFrame> frame) {
last_scroll_offset_ = frame->metadata.root_scroll_offset;
if (!frame->delegated_frame_data) { if (!frame->delegated_frame_data) {
LOG(ERROR) << "Non-delegated renderer path no longer supported"; LOG(ERROR) << "Non-delegated renderer path no longer supported";
return; return;
......
...@@ -429,6 +429,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid ...@@ -429,6 +429,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
// List of readbackrequests waiting for arrival of a valid frame. // List of readbackrequests waiting for arrival of a valid frame.
std::queue<ReadbackRequest> readbacks_waiting_for_frame_; std::queue<ReadbackRequest> readbacks_waiting_for_frame_;
// The last scroll offset of the view.
gfx::Vector2dF last_scroll_offset_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment