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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

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: address review comments Created 4 years, 10 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/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index e6eb23a536823ecf8c691e22078af60c14dc27e6..a9b7546693616cd251694264d7ce5d180d06e1a6 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -464,6 +464,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
private int mPhysicalBackingHeightPix;
private int mTopControlsHeightPix;
private boolean mTopControlsShrinkBlinkSize;
+ private Rect mWindowInsets;
aelias_OOO_until_Jul13 2016/02/24 02:43:59 As I mentioned in #31, I'd like this to be stored
ymalik 2016/03/03 02:10:18 Done.
// Cached copy of all positions and scales as reported by the renderer.
private final RenderCoordinates mRenderCoordinates;
@@ -601,6 +602,8 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
mGestureStateListenersIterator = mGestureStateListeners.rewindableIterator();
mContainerViewObservers = new ObserverList<ContainerViewObserver>();
+
+ mWindowInsets = new Rect();
}
/**
@@ -619,6 +622,25 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
}
/**
+ * @return The system window insets (from OSK, status bar, etc).
+ */
+ private Rect getWindowInsets() {
+ return mWindowInsets != null ? mWindowInsets : new Rect();
+ }
+
+ /**
+ * Set the window insets Rect to the specified values.
+ *
+ * @param left The left window inset
+ * @param top The top window inset.
+ * @param right The right window inset.
+ * @param bottom The bottom window inset.
+ */
+ public void setWindowInsets(int left, int top, int right, int bottom) {
+ mWindowInsets.set(left, top, right, bottom);
+ }
+
+ /**
* @return The WebContents currently being rendered.
*/
public WebContents getWebContents() {
@@ -1017,6 +1039,14 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
}
/**
+ * @return Viewport height when the OSK is hidden in physical pixels as set from onSizeChanged.
+ */
+ @CalledByNative
+ public int getViewportHeightWithOSKHiddenPix() {
+ return mViewportHeightPix + getWindowInsets().bottom;
+ }
+
+ /**
* @return Width of underlying physical surface.
*/
@CalledByNative
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698