| Index: content/browser/android/content_view_core_impl.cc
|
| diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
|
| index 561c2fb041108fd4081f836525303c6e9c18be86..052828c85b78c1b8bb4cebe3245d0832a4da4402 100644
|
| --- a/content/browser/android/content_view_core_impl.cc
|
| +++ b/content/browser/android/content_view_core_impl.cc
|
| @@ -423,8 +423,10 @@ void ContentViewCoreImpl::UpdateFrameInfo(
|
| const gfx::Vector2dF& page_scale_factor_limits,
|
| const gfx::SizeF& content_size,
|
| const gfx::SizeF& viewport_size,
|
| - const gfx::Vector2dF& controls_offset,
|
| - const gfx::Vector2dF& content_offset,
|
| + const gfx::Vector2dF& top_controls_height,
|
| + const float top_controls_shown_ratio,
|
| + const gfx::Vector2dF& bottom_controls_height,
|
| + const float bottom_controls_shown_ratio,
|
| bool is_mobile_optimized_hint,
|
| const gfx::SelectionBound& selection_start) {
|
| JNIEnv* env = AttachCurrentThread();
|
| @@ -432,8 +434,9 @@ void ContentViewCoreImpl::UpdateFrameInfo(
|
| if (obj.is_null() || !window_android_)
|
| return;
|
|
|
| - window_android_->set_content_offset(
|
| - gfx::ScaleVector2d(content_offset, dpi_scale_));
|
| + window_android_->set_content_offset(gfx::ScaleVector2d(
|
| + gfx::Vector2dF(0.0f, top_controls_height.y() * top_controls_shown_ratio),
|
| + dpi_scale_));
|
|
|
| page_scale_ = page_scale_factor;
|
|
|
| @@ -460,8 +463,10 @@ void ContentViewCoreImpl::UpdateFrameInfo(
|
| content_size.height(),
|
| viewport_size.width(),
|
| viewport_size.height(),
|
| - controls_offset.y(),
|
| - content_offset.y(),
|
| + top_controls_height.y(),
|
| + top_controls_shown_ratio,
|
| + bottom_controls_height.y(),
|
| + bottom_controls_shown_ratio,
|
| is_mobile_optimized_hint,
|
| has_insertion_marker,
|
| is_insertion_marker_visible,
|
| @@ -782,7 +787,7 @@ gfx::Size ContentViewCoreImpl::GetViewSizeWithOSKHidden() const {
|
| gfx::Size ContentViewCoreImpl::GetViewSize() const {
|
| gfx::Size size = GetViewportSizeDip();
|
| if (DoTopControlsShrinkBlinkSize())
|
| - size.Enlarge(0, -GetTopControlsHeightDip());
|
| + size.Enlarge(0, -GetTopControlsHeightDip() - GetBottomControlsHeightDip());
|
| return size;
|
| }
|
|
|
| @@ -814,6 +819,14 @@ int ContentViewCoreImpl::GetTopControlsHeightPix() const {
|
| return Java_ContentViewCore_getTopControlsHeightPix(env, j_obj.obj());
|
| }
|
|
|
| +int ContentViewCoreImpl::GetBottomControlsHeightPix() const {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
|
| + if (j_obj.is_null())
|
| + return 0;
|
| + return Java_ContentViewCore_getBottomControlsHeightPix(env, j_obj.obj());
|
| +}
|
| +
|
| gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const {
|
| return gfx::ScaleToCeiledSize(GetViewportSizePix(), 1.0f / dpi_scale());
|
| }
|
| @@ -830,6 +843,10 @@ float ContentViewCoreImpl::GetTopControlsHeightDip() const {
|
| return GetTopControlsHeightPix() / dpi_scale();
|
| }
|
|
|
| +float ContentViewCoreImpl::GetBottomControlsHeightDip() const {
|
| + return GetBottomControlsHeightPix() / dpi_scale();
|
| +}
|
| +
|
| void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) {
|
| root_layer_->InsertChild(layer, 0);
|
| root_layer_->SetIsDrawable(false);
|
|
|