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

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

Issue 14139013: Hide location bar on Javascript-initiated scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge ShowTopControls into UpdateTopControlsState, use new TopControlsState enum in plumbing, gener… Created 7 years, 8 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 df730b8941fbd5b720f0f4db092a456044eb184a..5a8bb10b3899520464b7cad55bb7272afe0dcd8a 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
@@ -2612,7 +2612,26 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
*/
public void updateTopControlsState(boolean enableHiding, boolean enableShowing,
boolean animate) {
- nativeUpdateTopControlsState(mNativeContentViewCore, enableHiding, enableShowing, animate);
+ // TODO(mvanouwerkerk): Stop calling this method from Chrome on Android, then delete it.
+ int constraints = TopControlsState.BOTH;
+ if (!enableShowing) {
+ constraints = TopControlsState.HIDDEN;
+ }
+ if (!enableHiding) {
+ constraints = TopControlsState.SHOWN;
+ }
+ updateTopControlsState(constraints, TopControlsState.BOTH, animate);
+ }
+
+ /**
+ * Changes whether hiding the top controls is enabled.
+ *
+ * @param constraints The visibility states that are allowed for the top controls.
+ * @param current The visibility state of the top controls that should be current.
+ * @param animate Whether a state transition should be animated or not.
+ */
+ public void updateTopControlsState(int constraints, int current, boolean animate) {
+ nativeUpdateTopControlsState(mNativeContentViewCore, constraints, current, animate);
}
/**
@@ -2891,7 +2910,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
private native void nativeExitFullscreen(int nativeContentViewCoreImpl);
private native void nativeUpdateTopControlsState(int nativeContentViewCoreImpl,
- boolean enableHiding, boolean enableShowing, boolean animate);
+ int constraints, int current, boolean animate);
private native void nativeShowImeIfNeeded(int nativeContentViewCoreImpl);

Powered by Google App Engine
This is Rietveld 408576698