Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 714003002: Allow changing top controls height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6c0fca0b55ad128fd39671c023086c843f3ea09c..69654ea294ee9d949181590a2a85c94db05c397c 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -716,7 +716,8 @@ ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const {
gfx::Size ContentViewCoreImpl::GetViewSize() const {
gfx::Size size = GetViewportSizeDip();
- size.Enlarge(0, -GetTopControlsLayoutHeightDip());
+ if (DoTopControlsShrinkBlinkSize())
+ size.Enlarge(0, -GetTopControlsHeightDip());
return size;
}
@@ -740,12 +741,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 {
@@ -753,8 +754,16 @@ gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const {
gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale()));
}
-float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const {
- return GetTopControlsLayoutHeightPix() / dpi_scale();
+bool ContentViewCoreImpl::DoTopControlsShrinkBlinkSize() const {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
+ if (j_obj.is_null())
+ return false;
+ return Java_ContentViewCore_doTopControlsShrinkBlinkSize(env, j_obj.obj());
+}
+
+float ContentViewCoreImpl::GetTopControlsHeightDip() const {
+ return GetTopControlsHeightPix() / dpi_scale();
}
void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) {
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698