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

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, 1 month 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 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) {
« 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