Chromium Code Reviews| 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 7854c3e44ecb2dd4432142a395239ddef0b483d0..fe0af7a6a09b3a584e93a25f8bb83f0530c3efe2 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -803,6 +803,15 @@ float ContentViewCoreImpl::GetBottomControlsHeightDip() const { |
| return GetBottomControlsHeightPix() / dpi_scale(); |
| } |
| +void ContentViewCoreImpl::ForceLayout() { |
|
boliu
2016/10/19 04:19:18
naming is hard, but definitely avoid overloading t
Tima Vaisburd
2016/10/19 20:25:11
The modestly looking |view->WasResized();| eventua
|
| + RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| + if (view) { |
| + // |SendScreenRects()| indirectly calls GetViewSize() that asks Java layer. |
| + web_contents_->SendScreenRects(); |
| + view->WasResized(); |
| + } |
| +} |
| + |
| void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) { |
| if (!web_contents_) |
| return; |
| @@ -868,6 +877,15 @@ void ContentViewCoreImpl::SetFocus(JNIEnv* env, |
| SetFocusInternal(focused); |
| } |
| +void ContentViewCoreImpl::SetDIPScale(JNIEnv* env, |
| + const JavaParamRef<jobject>& obj, |
| + jfloat dipScale, |
| + jboolean forceLayout) { |
| + dpi_scale_ = dipScale; |
| + if (forceLayout) |
| + ForceLayout(); |
|
boliu
2016/10/19 04:19:18
only if changed?
Tima Vaisburd
2016/10/19 20:25:11
Yes, I added that.
Now I realized that during repa
|
| +} |
| + |
| void ContentViewCoreImpl::SetFocusInternal(bool focused) { |
| if (!GetRenderWidgetHostViewAndroid()) |
| return; |
| @@ -1236,16 +1254,12 @@ void ContentViewCoreImpl::RemoveJavascriptInterface( |
| void ContentViewCoreImpl::WasResized(JNIEnv* env, |
| const JavaParamRef<jobject>& obj) { |
| - RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| gfx::Size physical_size( |
| Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), |
| Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); |
| view_.GetLayer()->SetBounds(physical_size); |
| - if (view) { |
| - web_contents_->SendScreenRects(); |
| - view->WasResized(); |
| - } |
| + ForceLayout(); |
| } |
| long ContentViewCoreImpl::GetNativeImeAdapter( |