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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java

Issue 2874933008: Adds animation as feature variation to keyboard accessory. (Closed)
Patch Set: Switch to base/metrics/field_trial_params.h API from variations:: Created 3 years, 7 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: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java
index b339c1a1388c9a46d0106ef60d662e9c8e74c328..0fbb0d7aaff5fb6f35f8fb0c99ce5c886830bb2c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java
@@ -71,9 +71,15 @@ public class AutofillKeyboardAccessoryBridge
* This function should be called at most one time.
* @param nativeAutofillKeyboardAccessory Handle to the native counterpart.
* @param windowAndroid The window on which to show the suggestions.
+ * @param animationDurationMillis If 0, do not animate. Otherwise, animation duration in each
+ * direction. We reverse animation to scroll the first suggestion
+ * (which is a hint to call attention to the accessory) out of
+ * the viewport at the end of the reversed animation.
+ * @param shouldLimitLabelWidth If true, limit suggestion label width to 1/2 device's width.
*/
@CalledByNative
- private void init(long nativeAutofillKeyboardAccessory, WindowAndroid windowAndroid) {
+ private void init(long nativeAutofillKeyboardAccessory, WindowAndroid windowAndroid,
+ int animationDurationMillis, boolean shouldLimitLabelWidth) {
if (windowAndroid == null || windowAndroid.getActivity().get() == null) {
nativeViewDismissed(nativeAutofillKeyboardAccessory);
dismissed();
@@ -81,7 +87,8 @@ public class AutofillKeyboardAccessoryBridge
}
mNativeAutofillKeyboardAccessory = nativeAutofillKeyboardAccessory;
- mAccessoryView = new AutofillKeyboardAccessory(windowAndroid, this);
+ mAccessoryView = new AutofillKeyboardAccessory(
+ windowAndroid, this, animationDurationMillis, shouldLimitLabelWidth);
mContext = windowAndroid.getActivity().get();
}

Powered by Google App Engine
This is Rietveld 408576698