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

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

Issue 1386403003: Resize only the virtual viewport when the OSK triggers a resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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 273d73e6af543418acd858a2dde8f1b36bc62fcf..bce87a2fe3bcfb5cff0ce8cdf39df9d8cd692da8 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -709,6 +709,22 @@ ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const {
return Java_ContentViewCore_getContext(env, obj.obj());
}
+gfx::Size ContentViewCoreImpl::GetViewSizeWithoutOSK() const {
+ gfx::Size size_pix;
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
+ if (j_obj.is_null())
bokan 2015/10/08 22:38:21 I think you should skip the bits below if this is
ymalik 2015/10/09 01:05:25 Absolutely.
+ size_pix = gfx::Size();
+ size_pix = gfx::Size(
+ Java_ContentViewCore_getViewportWidthPix(env, j_obj.obj()),
+ Java_ContentViewCore_getViewportHeightWithoutOSKPix(env, j_obj.obj()));
+
+ gfx::Size size_dip = gfx::ScaleToCeiledSize(size_pix, 1.0f / dpi_scale());
bokan 2015/10/08 22:38:21 Why not just make ContentViewCore.getViewportHeigh
ymalik 2015/10/09 01:05:25 It seems to be the case that ContentViewCore.getVi
+ if (DoTopControlsShrinkBlinkSize())
+ size_dip.Enlarge(0, -GetTopControlsHeightDip());
+ return size_dip;
+}
+
gfx::Size ContentViewCoreImpl::GetViewSize() const {
gfx::Size size = GetViewportSizeDip();
if (DoTopControlsShrinkBlinkSize())

Powered by Google App Engine
This is Rietveld 408576698