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 cd11919c08046bdcd954a25d846a028fa2a2f4d2..68c209a7687284ec7c7886f22c4819f048ec4db0 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -717,7 +717,8 @@ ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const { |
| gfx::Size ContentViewCoreImpl::GetViewSize() const { |
| gfx::Size size = GetViewportSizeDip(); |
| - size.Enlarge(0, -GetTopControlsLayoutHeightDip()); |
| + if (GetTopControlsShrinkBlinkSize()) |
| + size.Enlarge(0, -GetTopControlsHeightDip()); |
| return size; |
| } |
| @@ -741,12 +742,12 @@ gfx::Size ContentViewCoreImpl::GetViewportSizePix() const { |
| Java_ContentViewCore_getViewportHeightPix(env, j_obj.obj())); |
| } |
| -int ContentViewCoreImpl::GetTopControlsLayoutHeightPix() const { |
| +int ContentViewCoreImpl::GetTopControlsHeightPix() const { |
| JNIEnv* env = AttachCurrentThread(); |
| ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| if (j_obj.is_null()) |
| return 0; |
| - return Java_ContentViewCore_getTopControlsLayoutHeightPix(env, j_obj.obj()); |
| + return Java_ContentViewCore_getTopControlsHeightPix(env, j_obj.obj()); |
| } |
| gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { |
| @@ -754,8 +755,16 @@ gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { |
| gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale())); |
| } |
| -float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const { |
| - return GetTopControlsLayoutHeightPix() / dpi_scale(); |
| +bool ContentViewCoreImpl::GetTopControlsShrinkBlinkSize() const { |
| + JNIEnv* env = AttachCurrentThread(); |
| + ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| + if (j_obj.is_null()) |
| + return 0; |
|
Ted C
2014/11/26 00:38:25
return false
|
| + return Java_ContentViewCore_getTopControlsShrinkBlinkSize(env, j_obj.obj()); |
| +} |
| + |
| +float ContentViewCoreImpl::GetTopControlsHeightDip() const { |
| + return GetTopControlsHeightPix() / dpi_scale(); |
| } |
| void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |