Commit cf65e7a9 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Commit Bot

[Autofill Assistant] Switch to Chrome BottomSheet.

Bug: 933070
Change-Id: Ib921de52cbff937e63c3de568e3d8c9fde7220fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552833
Commit-Queue: Jordan Demeulenaere <jdemeulenaere@chromium.org>
Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Reviewed-by: default avatarStephane Zermatten <szermatt@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649830}
parent 988d6c7c
...@@ -61,6 +61,7 @@ android_library("java") { ...@@ -61,6 +61,7 @@ android_library("java") {
"java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java", "java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/EditDistance.java", "java/src/org/chromium/chrome/browser/autofill_assistant/EditDistance.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/FeedbackContext.java", "java/src/org/chromium/chrome/browser/autofill_assistant/FeedbackContext.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/SizeListenableLinearLayout.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantCarouselCoordinator.java", "java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantCarouselCoordinator.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantCarouselModel.java", "java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantCarouselModel.java",
"java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantChip.java", "java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantChip.java",
......
...@@ -2,9 +2,19 @@ ...@@ -2,9 +2,19 @@
<!-- Copyright 2018 The Chromium Authors. All rights reserved. <!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<merge <org.chromium.chrome.browser.autofill_assistant.SizeListenableLinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" > android:id="@+id/autofill_assistant"
android:clickable="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingTop="12dp"
android:paddingBottom="@dimen/autofill_assistant_bottombar_vertical_spacing"
android:animateLayoutChanges="true"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -43,4 +53,4 @@ ...@@ -43,4 +53,4 @@
android:layout_marginEnd="@dimen/autofill_assistant_bottombar_horizontal_spacing" android:layout_marginEnd="@dimen/autofill_assistant_bottombar_horizontal_spacing"
app:colorBackground="@color/modern_grey_100" app:colorBackground="@color/modern_grey_100"
app:colorProgress="@color/modern_blue_600"/> app:colorProgress="@color/modern_blue_600"/>
</merge> </org.chromium.chrome.browser.autofill_assistant.SizeListenableLinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="20dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:orientation="horizontal"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/swipe_indicator"
android:layout_width="36dp"
android:layout_height="4dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/autofill_assistant_swipe_indicator"
tools:ignore="ContentDescription" />
</LinearLayout>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:orientation="vertical"> android:orientation="vertical">
<org.chromium.chrome.browser.widget.FadingEdgeScrollView <org.chromium.chrome.browser.widget.FadingEdgeScrollView
android:id="@+id/onboarding_scroll_view"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="match_parent"> android:layout_width="match_parent">
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/autofill_assistant"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<LinearLayout
android:id="@+id/autofill_assistant_bottombar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:clickable="true"
android:background="@drawable/autofill_assistant_bottombar_bg"
android:orientation="vertical"
app:behavior_peekHeight="34dp"
app:layout_behavior="@string/bottom_sheet_behavior">
<ImageView
android:id="@+id/swipe_indicator"
android:layout_width="36dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/autofill_assistant_swipe_indicator"
tools:ignore="ContentDescription" />
<include
layout="@layout/autofill_assistant_header"/>
<LinearLayout
android:id="@+id/autofill_assistant_bottombar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingBottom="@dimen/autofill_assistant_bottombar_vertical_spacing"
android:orientation="vertical"
android:gravity="center"
android:animateLayoutChanges="true" >
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</FrameLayout>
...@@ -4,18 +4,12 @@ ...@@ -4,18 +4,12 @@
package org.chromium.chrome.browser.autofill_assistant; package org.chromium.chrome.browser.autofill_assistant;
import android.view.View;
import android.view.ViewGroup;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.autofill_assistant.header.AssistantHeaderModel;
import org.chromium.chrome.browser.autofill_assistant.metrics.DropOutReason; import org.chromium.chrome.browser.autofill_assistant.metrics.DropOutReason;
import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayCoordinator; import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayCoordinator;
import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayModel;
import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayState;
import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.help.HelpAndFeedback;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController;
/** /**
* The main coordinator for the Autofill Assistant, responsible for instantiating all other * The main coordinator for the Autofill Assistant, responsible for instantiating all other
...@@ -37,60 +31,27 @@ class AssistantCoordinator { ...@@ -37,60 +31,27 @@ class AssistantCoordinator {
private final Delegate mDelegate; private final Delegate mDelegate;
private final AssistantModel mModel; private final AssistantModel mModel;
private final View mAssistantView;
private AssistantBottomBarCoordinator mBottomBarCoordinator; private AssistantBottomBarCoordinator mBottomBarCoordinator;
private final AssistantKeyboardCoordinator mKeyboardCoordinator; private final AssistantKeyboardCoordinator mKeyboardCoordinator;
private final AssistantOverlayCoordinator mOverlayCoordinator; private final AssistantOverlayCoordinator mOverlayCoordinator;
/** AssistantCoordinator(
* Returns {@code true} if an AA UI is active on the given activity. ChromeActivity activity, Delegate delegate, BottomSheetController controller) {
*
* <p>Used to avoid creating duplicate coordinators views.
*
* <p>TODO(crbug.com/806868): Refactor to have AssistantCoordinator owned by the activity, so
* it's easy to guarantee that there will be at most one per activity.
*/
static boolean isActive(ChromeActivity activity) {
View found = activity.findViewById(R.id.autofill_assistant);
return found != null && found.getParent() != null;
}
AssistantCoordinator(ChromeActivity activity, Delegate delegate) {
mActivity = activity; mActivity = activity;
mDelegate = delegate; mDelegate = delegate;
mModel = new AssistantModel(); mModel = new AssistantModel();
// Inflate autofill_assistant_sheet layout and add it to the main coordinator view.
ViewGroup coordinator = activity.findViewById(R.id.coordinator);
mAssistantView = activity.getLayoutInflater()
.inflate(R.layout.autofill_assistant_sheet, coordinator)
.findViewById(R.id.autofill_assistant);
// Instantiate child components. // Instantiate child components.
mBottomBarCoordinator = new AssistantBottomBarCoordinator(activity, mAssistantView, mModel); mBottomBarCoordinator = new AssistantBottomBarCoordinator(activity, mModel, controller);
mKeyboardCoordinator = new AssistantKeyboardCoordinator(activity); mKeyboardCoordinator = new AssistantKeyboardCoordinator(activity, mModel);
mOverlayCoordinator = new AssistantOverlayCoordinator(activity, mModel.getOverlayModel()); mOverlayCoordinator = new AssistantOverlayCoordinator(activity, mModel.getOverlayModel());
// Listen when we should (dis)allow the soft keyboard or swiping the bottom sheet.
mModel.addObserver((source, propertyKey) -> {
if (AssistantModel.ALLOW_SOFT_KEYBOARD == propertyKey) {
mKeyboardCoordinator.allowShowingSoftKeyboard(
mModel.get(AssistantModel.ALLOW_SOFT_KEYBOARD));
} else if (AssistantModel.ALLOW_SWIPING_SHEET == propertyKey) {
mBottomBarCoordinator.allowSwipingBottomSheet(
mModel.get(AssistantModel.ALLOW_SWIPING_SHEET));
} else if (AssistantModel.VISIBLE == propertyKey) {
setVisible(mModel.get(AssistantModel.VISIBLE));
}
});
mModel.setVisible(true); mModel.setVisible(true);
} }
/** Detaches and destroys the view. */ /** Detaches and destroys the view. */
public void destroy() { public void destroy() {
setVisible(false); mModel.setVisible(false);
detachAssistantView();
mOverlayCoordinator.destroy(); mOverlayCoordinator.destroy();
mBottomBarCoordinator.destroy(); mBottomBarCoordinator.destroy();
mBottomBarCoordinator = null; mBottomBarCoordinator = null;
...@@ -101,30 +62,13 @@ class AssistantCoordinator { ...@@ -101,30 +62,13 @@ class AssistantCoordinator {
* otherwise. * otherwise.
*/ */
public void showOnboarding(Runnable onAccept) { public void showOnboarding(Runnable onAccept) {
mModel.getHeaderModel().set(AssistantHeaderModel.FEEDBACK_VISIBLE, false); mBottomBarCoordinator.showOnboarding(accepted -> {
if (accepted) {
// Show overlay to prevent user from interacting with the page during onboarding. onAccept.run();
mModel.getOverlayModel().set(AssistantOverlayModel.STATE, AssistantOverlayState.FULL); } else {
mDelegate.stop(DropOutReason.DECLINED);
// Disable swiping for the onboarding because it interferes with letting the user scroll }
// the onboarding contents. });
mBottomBarCoordinator.allowSwipingBottomSheet(false);
AssistantOnboardingCoordinator.show(mActivity, mBottomBarCoordinator.getContainerView())
.then(accepted -> {
mBottomBarCoordinator.allowSwipingBottomSheet(true);
if (!accepted) {
mDelegate.stop(DropOutReason.DECLINED);
return;
}
mModel.getHeaderModel().set(AssistantHeaderModel.FEEDBACK_VISIBLE, true);
// Hide overlay.
mModel.getOverlayModel().set(
AssistantOverlayModel.STATE, AssistantOverlayState.HIDDEN);
onAccept.run();
});
} }
/** /**
...@@ -149,25 +93,4 @@ class AssistantCoordinator { ...@@ -149,25 +93,4 @@ class AssistantCoordinator {
mActivity.getActivityTab().getUrl(), FEEDBACK_CATEGORY_TAG, mActivity.getActivityTab().getUrl(), FEEDBACK_CATEGORY_TAG,
FeedbackContext.buildContextString(mActivity, debugContext, 4)); FeedbackContext.buildContextString(mActivity, debugContext, 4));
} }
// Private methods.
private void setVisible(boolean visible) {
if (visible) {
mAssistantView.setVisibility(View.VISIBLE);
mKeyboardCoordinator.enableListenForKeyboardVisibility(true);
mBottomBarCoordinator.expand();
mBottomBarCoordinator.getView().announceForAccessibility(
mActivity.getString(R.string.autofill_assistant_available_accessibility));
} else {
mAssistantView.setVisibility(View.GONE);
mKeyboardCoordinator.enableListenForKeyboardVisibility(false);
}
// TODO(crbug.com/806868): Control visibility of bottom bar and overlay separately.
}
private void detachAssistantView() {
mActivity.<ViewGroup>findViewById(R.id.coordinator).removeView(mAssistantView);
}
} }
...@@ -18,15 +18,27 @@ class AssistantKeyboardCoordinator { ...@@ -18,15 +18,27 @@ class AssistantKeyboardCoordinator {
this::onKeyboardVisibilityChanged; this::onKeyboardVisibilityChanged;
private boolean mAllowShowingSoftKeyboard = true; private boolean mAllowShowingSoftKeyboard = true;
AssistantKeyboardCoordinator(ChromeActivity activity) { AssistantKeyboardCoordinator(ChromeActivity activity, AssistantModel model) {
mActivity = activity; mActivity = activity;
mKeyboardDelegate = activity.getWindowAndroid().getKeyboardDelegate(); mKeyboardDelegate = activity.getWindowAndroid().getKeyboardDelegate();
model.addObserver((source, propertyKey) -> {
if (AssistantModel.VISIBLE == propertyKey) {
if (model.get(AssistantModel.VISIBLE)) {
enableListenForKeyboardVisibility(true);
} else {
enableListenForKeyboardVisibility(false);
}
} else if (AssistantModel.ALLOW_SOFT_KEYBOARD == propertyKey) {
allowShowingSoftKeyboard(model.get(AssistantModel.ALLOW_SOFT_KEYBOARD));
}
});
} }
/** /**
* Enable or disable the soft keyboard. * Enable or disable the soft keyboard.
*/ */
public void allowShowingSoftKeyboard(boolean allowed) { private void allowShowingSoftKeyboard(boolean allowed) {
mAllowShowingSoftKeyboard = allowed; mAllowShowingSoftKeyboard = allowed;
if (!allowed) { if (!allowed) {
mKeyboardDelegate.hideKeyboard(mActivity.getCompositorViewHolder()); mKeyboardDelegate.hideKeyboard(mActivity.getCompositorViewHolder());
...@@ -36,7 +48,7 @@ class AssistantKeyboardCoordinator { ...@@ -36,7 +48,7 @@ class AssistantKeyboardCoordinator {
/** /**
* Start or stop listening for keyboard visibility changes. * Start or stop listening for keyboard visibility changes.
*/ */
public void enableListenForKeyboardVisibility(boolean enabled) { private void enableListenForKeyboardVisibility(boolean enabled) {
if (enabled) { if (enabled) {
mKeyboardDelegate.addKeyboardVisibilityListener(mKeyboardVisibilityListener); mKeyboardDelegate.addKeyboardVisibilityListener(mKeyboardVisibilityListener);
} else { } else {
......
...@@ -20,7 +20,6 @@ import org.chromium.ui.modelutil.PropertyModel; ...@@ -20,7 +20,6 @@ import org.chromium.ui.modelutil.PropertyModel;
@JNINamespace("autofill_assistant") @JNINamespace("autofill_assistant")
class AssistantModel extends PropertyModel { class AssistantModel extends PropertyModel {
static final WritableBooleanPropertyKey ALLOW_SOFT_KEYBOARD = new WritableBooleanPropertyKey(); static final WritableBooleanPropertyKey ALLOW_SOFT_KEYBOARD = new WritableBooleanPropertyKey();
static final WritableBooleanPropertyKey ALLOW_SWIPING_SHEET = new WritableBooleanPropertyKey();
static final WritableBooleanPropertyKey VISIBLE = new WritableBooleanPropertyKey(); static final WritableBooleanPropertyKey VISIBLE = new WritableBooleanPropertyKey();
private final AssistantOverlayModel mOverlayModel = new AssistantOverlayModel(); private final AssistantOverlayModel mOverlayModel = new AssistantOverlayModel();
...@@ -33,7 +32,7 @@ class AssistantModel extends PropertyModel { ...@@ -33,7 +32,7 @@ class AssistantModel extends PropertyModel {
private final AssistantCarouselModel mActionsModel = new AssistantCarouselModel(); private final AssistantCarouselModel mActionsModel = new AssistantCarouselModel();
AssistantModel() { AssistantModel() {
super(ALLOW_SOFT_KEYBOARD, ALLOW_SWIPING_SHEET, VISIBLE); super(ALLOW_SOFT_KEYBOARD, VISIBLE);
} }
@CalledByNative @CalledByNative
...@@ -74,11 +73,6 @@ class AssistantModel extends PropertyModel { ...@@ -74,11 +73,6 @@ class AssistantModel extends PropertyModel {
set(ALLOW_SOFT_KEYBOARD, allowed); set(ALLOW_SOFT_KEYBOARD, allowed);
} }
@CalledByNative
private void setAllowSwipingSheet(boolean allowed) {
set(ALLOW_SWIPING_SHEET, allowed);
}
@CalledByNative @CalledByNative
void setVisible(boolean visible) { void setVisible(boolean visible) {
set(VISIBLE, visible); set(VISIBLE, visible);
......
...@@ -12,7 +12,7 @@ import android.view.View; ...@@ -12,7 +12,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import org.chromium.base.Promise; import org.chromium.base.Callback;
import org.chromium.chrome.autofill_assistant.R; import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.customtabs.CustomTabActivity; import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.NoUnderlineClickableSpan;
...@@ -26,8 +26,7 @@ class AssistantOnboardingCoordinator { ...@@ -26,8 +26,7 @@ class AssistantOnboardingCoordinator {
/** /**
* Shows the onboarding screen and returns whether we should proceed. * Shows the onboarding screen and returns whether we should proceed.
*/ */
static Promise<Boolean> show(Context context, ViewGroup root) { static View show(Context context, ViewGroup root, Callback<Boolean> callback) {
Promise<Boolean> promise = new Promise<>();
View initView = LayoutInflater.from(context) View initView = LayoutInflater.from(context)
.inflate(R.layout.autofill_assistant_onboarding, root) .inflate(R.layout.autofill_assistant_onboarding, root)
.findViewById(R.id.assistant_onboarding); .findViewById(R.id.assistant_onboarding);
...@@ -50,18 +49,19 @@ class AssistantOnboardingCoordinator { ...@@ -50,18 +49,19 @@ class AssistantOnboardingCoordinator {
initView.setFocusable(true); initView.setFocusable(true);
initView.findViewById(R.id.button_init_ok) initView.findViewById(R.id.button_init_ok)
.setOnClickListener(unusedView -> onClicked(true, root, initView, promise)); .setOnClickListener(unusedView -> onClicked(true, root, initView, callback));
initView.findViewById(R.id.button_init_not_ok) initView.findViewById(R.id.button_init_not_ok)
.setOnClickListener(unusedView -> onClicked(false, root, initView, promise)); .setOnClickListener(unusedView -> onClicked(false, root, initView, callback));
initView.announceForAccessibility( initView.announceForAccessibility(
context.getString(R.string.autofill_assistant_first_run_accessibility)); context.getString(R.string.autofill_assistant_first_run_accessibility));
return promise;
return initView;
} }
private static void onClicked( private static void onClicked(
boolean accept, ViewGroup root, View initView, Promise<Boolean> promise) { boolean accept, ViewGroup root, View initView, Callback<Boolean> callback) {
AutofillAssistantPreferencesUtil.setInitialPreferences(accept); AutofillAssistantPreferencesUtil.setInitialPreferences(accept);
root.removeView(initView); root.removeView(initView);
promise.fulfill(accept); callback.onResult(accept);
} }
} }
...@@ -21,11 +21,14 @@ import org.chromium.chrome.browser.autofill_assistant.metrics.DropOutReason; ...@@ -21,11 +21,14 @@ import org.chromium.chrome.browser.autofill_assistant.metrics.DropOutReason;
import org.chromium.chrome.browser.customtabs.CustomTabActivity; import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController;
import org.chromium.content_public.browser.UiThreadTaskTraits; import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContents;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* Bridge to native side autofill_assistant::UiControllerAndroid. It allows native side to control * Bridge to native side autofill_assistant::UiControllerAndroid. It allows native side to control
...@@ -37,6 +40,7 @@ import java.util.List; ...@@ -37,6 +40,7 @@ import java.util.List;
// TODO(crbug.com/806868): This class should be removed once all logic is in native side and the // TODO(crbug.com/806868): This class should be removed once all logic is in native side and the
// model is directly modified by the native AssistantMediator. // model is directly modified by the native AssistantMediator.
class AutofillAssistantUiController implements AssistantCoordinator.Delegate { class AutofillAssistantUiController implements AssistantCoordinator.Delegate {
private static Set<ChromeActivity> sActiveChromeActivities;
private long mNativeUiController; private long mNativeUiController;
private final ChromeActivity mActivity; private final ChromeActivity mActivity;
...@@ -54,25 +58,49 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate { ...@@ -54,25 +58,49 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate {
@Nullable @Nullable
private static ChromeActivity findAppropriateActivity(WebContents webContents) { private static ChromeActivity findAppropriateActivity(WebContents webContents) {
ChromeActivity activity = ChromeActivity.fromWebContents(webContents); ChromeActivity activity = ChromeActivity.fromWebContents(webContents);
if (activity != null && AssistantCoordinator.isActive(activity)) { if (activity != null && isActive(activity)) {
return null; return null;
} }
return activity; return activity;
} }
/**
* Returns {@code true} if an AA UI is active on the given activity.
*
* <p>Used to avoid creating duplicate coordinators views.
*
* <p>TODO(crbug.com/806868): Refactor to have AssistantCoordinator owned by the activity, so
* it's easy to guarantee that there will be at most one per activity.
*/
private static boolean isActive(ChromeActivity activity) {
if (sActiveChromeActivities == null) {
return false;
}
return sActiveChromeActivities.contains(activity);
}
@CalledByNative @CalledByNative
private static AutofillAssistantUiController create( private static AutofillAssistantUiController create(
ChromeActivity activity, boolean allowTabSwitching, long nativeUiController) { ChromeActivity activity, boolean allowTabSwitching, long nativeUiController) {
assert activity != null; assert activity != null;
return new AutofillAssistantUiController(activity, allowTabSwitching, nativeUiController); assert activity.getBottomSheetController() != null;
if (sActiveChromeActivities == null) {
sActiveChromeActivities = new HashSet<>();
}
sActiveChromeActivities.add(activity);
return new AutofillAssistantUiController(activity, activity.getBottomSheetController(),
allowTabSwitching, nativeUiController);
} }
private AutofillAssistantUiController( private AutofillAssistantUiController(ChromeActivity activity, BottomSheetController controller,
ChromeActivity activity, boolean allowTabSwitching, long nativeUiController) { boolean allowTabSwitching, long nativeUiController) {
mNativeUiController = nativeUiController; mNativeUiController = nativeUiController;
mActivity = activity; mActivity = activity;
mCoordinator = new AssistantCoordinator(activity, this); mCoordinator = new AssistantCoordinator(activity, this, controller);
mActivityTabObserver = mActivityTabObserver =
new ActivityTabProvider.ActivityTabTabObserver(activity.getActivityTabProvider()) { new ActivityTabProvider.ActivityTabTabObserver(activity.getActivityTabProvider()) {
@Override @Override
...@@ -154,6 +182,7 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate { ...@@ -154,6 +182,7 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate {
mNativeUiController = 0; mNativeUiController = 0;
mActivityTabObserver.destroy(); mActivityTabObserver.destroy();
mCoordinator.destroy(); mCoordinator.destroy();
sActiveChromeActivities.remove(mActivity);
} }
/** /**
...@@ -174,7 +203,7 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate { ...@@ -174,7 +203,7 @@ class AutofillAssistantUiController implements AssistantCoordinator.Delegate {
@CalledByNative @CalledByNative
private void expandBottomSheet() { private void expandBottomSheet() {
mCoordinator.getBottomBarCoordinator().expand(); mCoordinator.getBottomBarCoordinator().showAndExpand();
} }
@CalledByNative @CalledByNative
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.autofill_assistant;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
/** A LinearLayout that can notify when its size changes. */
public class SizeListenableLinearLayout extends LinearLayout {
@Nullable
private BottomSheet.ContentSizeListener mListener;
public SizeListenableLinearLayout(Context context) {
super(context);
}
public SizeListenableLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SizeListenableLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
if (mListener != null) {
mListener.onSizeChanged(w, h, oldw, oldh);
}
}
void setContentSizeListener(@Nullable BottomSheet.ContentSizeListener listener) {
mListener = listener;
}
}
...@@ -10,6 +10,7 @@ import android.support.annotation.Nullable; ...@@ -10,6 +10,7 @@ import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap; import android.support.v4.util.ArrayMap;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ScrollView;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback; import org.chromium.base.Callback;
...@@ -81,7 +82,7 @@ public class AssistantPaymentRequestCoordinator implements AssistantPaymentReque ...@@ -81,7 +82,7 @@ public class AssistantPaymentRequestCoordinator implements AssistantPaymentReque
model.get(AssistantPaymentRequestModel.DELEGATE))); model.get(AssistantPaymentRequestModel.DELEGATE)));
} }
public View getView() { public ScrollView getView() {
return mPaymentRequestUI.getView(); return mPaymentRequestUI.getView();
} }
......
...@@ -15,6 +15,7 @@ import android.view.View; ...@@ -15,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import org.chromium.chrome.autofill_assistant.R; import org.chromium.chrome.autofill_assistant.R;
...@@ -164,7 +165,7 @@ public class AssistantPaymentRequestUI ...@@ -164,7 +165,7 @@ public class AssistantPaymentRequestUI
/** /**
* Gets the root view of AssistantPaymentRequestUI. * Gets the root view of AssistantPaymentRequestUI.
*/ */
public View getView() { public ScrollView getView() {
return mRequestViewContainer; return mRequestViewContainer;
} }
......
...@@ -136,9 +136,6 @@ ...@@ -136,9 +136,6 @@
<message name="IDS_AUTOFILL_ASSISTANT_3RD_PARTY_PRIVACY_NOTICE" desc="Privacy notice telling users that autofill assistant will send personal data to a third party’s website."> <message name="IDS_AUTOFILL_ASSISTANT_3RD_PARTY_PRIVACY_NOTICE" desc="Privacy notice telling users that autofill assistant will send personal data to a third party’s website.">
Chrome will send personal data you selected to <ph name="BEGIN_BOLD">&lt;b&gt;</ph><ph name="DOMAIN">%1$s<ex>google.com</ex></ph><ph name="END_BOLD">&lt;/b&gt;</ph> Chrome will send personal data you selected to <ph name="BEGIN_BOLD">&lt;b&gt;</ph><ph name="DOMAIN">%1$s<ex>google.com</ex></ph><ph name="END_BOLD">&lt;/b&gt;</ph>
</message> </message>
<message name="IDS_AUTOFILL_ASSISTANT_AVAILABLE_ACCESSIBILITY" desc="Accessibility description of Autofill Assistant is available.">
Google Assistant in Chrome is available near bottom of the screen
</message>
<message name="IDS_AUTOFILL_ASSISTANT_FIRST_RUN_ACCESSIBILITY" desc="Accessibility description of Autofill Assistant first run screen is shown."> <message name="IDS_AUTOFILL_ASSISTANT_FIRST_RUN_ACCESSIBILITY" desc="Accessibility description of Autofill Assistant first run screen is shown.">
Google Assistant in Chrome first run screen is shown Google Assistant in Chrome first run screen is shown
</message> </message>
...@@ -156,6 +153,18 @@ ...@@ -156,6 +153,18 @@
<message name="IDS_AUTOFILL_ASSISTANT_VIEW_ORIGINAL_IMAGE_CANCEL" desc="Text on the button to dismiss view image dialog."> <message name="IDS_AUTOFILL_ASSISTANT_VIEW_ORIGINAL_IMAGE_CANCEL" desc="Text on the button to dismiss view image dialog.">
Cancel Cancel
</message> </message>
<message name="IDS_AUTOFILL_ASSISTANT_SHEET_CONTENT_DESCRIPTION" desc="Content description for the Autofill Assistant sheet.">
Google Assistant in Chrome.
</message>
<message name="IDS_AUTOFILL_ASSISTANT_SHEET_HALF_HEIGHT" desc="Text announced when the Autofill Assistant sheet is opened at half height.">
Google Assistant in Chrome opened at half height.
</message>
<message name="IDS_AUTOFILL_ASSISTANT_SHEET_FULL_HEIGHT" desc="Text announced when the Autofill Assistant sheet is opened at full height.">
Google Assistant in Chrome opened at full height.
</message>
<message name="IDS_AUTOFILL_ASSISTANT_SHEET_CLOSED" desc="Text announced when the Autofill Assistant sheet is closed.">
Google Assistant in Chrome closed.
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
...@@ -10,6 +10,7 @@ import android.content.Intent; ...@@ -10,6 +10,7 @@ import android.content.Intent;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
import android.support.test.filters.MediumTest; import android.support.test.filters.MediumTest;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
...@@ -45,6 +46,9 @@ import org.chromium.chrome.browser.customtabs.CustomTabActivity; ...@@ -45,6 +46,9 @@ import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule;
import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils; import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils;
import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.firstrun.FirstRunStatus;
import org.chromium.chrome.browser.snackbar.BottomContainer;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.net.test.EmbeddedTestServer; import org.chromium.net.test.EmbeddedTestServer;
...@@ -98,14 +102,28 @@ public class AutofillAssistantUiTest { ...@@ -98,14 +102,28 @@ public class AutofillAssistantUiTest {
InstrumentationRegistry.getTargetContext(), mTestPage); InstrumentationRegistry.getTargetContext(), mTestPage);
} }
private View findViewByIdInMainCoordinator(int id) {
return getActivity().findViewById(R.id.coordinator).findViewById(id);
}
private CustomTabActivity getActivity() { private CustomTabActivity getActivity() {
return mCustomTabActivityTestRule.getActivity(); return mCustomTabActivityTestRule.getActivity();
} }
// Copied from {@link ChromeActivity#initializeBottomSheet}.
protected BottomSheetController initializeBottomSheet() {
CustomTabActivity activity = getActivity();
ViewGroup coordinator = activity.findViewById(org.chromium.chrome.R.id.coordinator);
LayoutInflater.from(activity).inflate(
org.chromium.chrome.R.layout.bottom_sheet, coordinator);
BottomSheet bottomSheet = coordinator.findViewById(org.chromium.chrome.R.id.bottom_sheet);
bottomSheet.init(coordinator, activity);
((BottomContainer) activity.findViewById(org.chromium.chrome.R.id.bottom_container))
.setBottomSheet(bottomSheet);
return new BottomSheetController(activity, activity.getActivityTabProvider(),
activity.getScrim(), bottomSheet,
activity.getCompositorViewHolder().getLayoutManager().getOverlayPanelManager(),
/* suppressSheetForContextualSearch= */ false);
}
// TODO(crbug.com/806868): Add more UI details test and check, like payment request UI, // TODO(crbug.com/806868): Add more UI details test and check, like payment request UI,
// highlight chips and so on. // highlight chips and so on.
@Test @Test
...@@ -114,21 +132,24 @@ public class AutofillAssistantUiTest { ...@@ -114,21 +132,24 @@ public class AutofillAssistantUiTest {
InOrder inOrder = inOrder(mRunnableMock); InOrder inOrder = inOrder(mRunnableMock);
mCustomTabActivityTestRule.startCustomTabActivityWithIntent(createMinimalCustomTabIntent()); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
BottomSheetController bottomSheetController =
ThreadUtils.runOnUiThreadBlocking(this::initializeBottomSheet);
AssistantCoordinator assistantCoordinator = ThreadUtils.runOnUiThreadBlocking( AssistantCoordinator assistantCoordinator = ThreadUtils.runOnUiThreadBlocking(
() -> new AssistantCoordinator(getActivity(), mCoordinatorDelegateMock)); ()
-> new AssistantCoordinator(
getActivity(), mCoordinatorDelegateMock, bottomSheetController));
// Bottom sheet is shown when creating the AssistantCoordinator. // Bottom sheet is shown in the BottomSheet when creating the AssistantCoordinator.
View bottomSheet = findViewByIdInMainCoordinator(R.id.autofill_assistant); ViewGroup bottomSheetContent =
Assert.assertTrue(bottomSheet.isShown()); bottomSheetController.getBottomSheet().findViewById(R.id.autofill_assistant);
Assert.assertNotNull(bottomSheetContent);
// Disable bottom sheet container animations. This is a workaround for http://crbug/943483. // Disable bottom sheet content animations. This is a workaround for http://crbug/943483.
ViewGroup bottomSheetContainer = TestThreadUtils.runOnUiThreadBlocking(() -> bottomSheetContent.setLayoutTransition(null));
bottomSheet.findViewById(R.id.autofill_assistant_bottombar_container);
TestThreadUtils.runOnUiThreadBlocking(() -> bottomSheetContainer.setLayoutTransition(null));
// Show onboarding. // Show onboarding.
ThreadUtils.runOnUiThreadBlocking(() -> assistantCoordinator.showOnboarding(mRunnableMock)); ThreadUtils.runOnUiThreadBlocking(() -> assistantCoordinator.showOnboarding(mRunnableMock));
View onboardingView = bottomSheet.findViewById(R.id.assistant_onboarding); View onboardingView = bottomSheetContent.findViewById(R.id.assistant_onboarding);
Assert.assertNotNull(onboardingView); Assert.assertNotNull(onboardingView);
View initOkButton = onboardingView.findViewById(R.id.button_init_ok); View initOkButton = onboardingView.findViewById(R.id.button_init_ok);
Assert.assertNotNull(initOkButton); Assert.assertNotNull(initOkButton);
...@@ -141,7 +162,7 @@ public class AutofillAssistantUiTest { ...@@ -141,7 +162,7 @@ public class AutofillAssistantUiTest {
() ()
-> assistantCoordinator.getModel().getHeaderModel().set( -> assistantCoordinator.getModel().getHeaderModel().set(
AssistantHeaderModel.STATUS_MESSAGE, testStatusMessage)); AssistantHeaderModel.STATUS_MESSAGE, testStatusMessage));
TextView statusMessageView = bottomSheet.findViewById(R.id.status_message); TextView statusMessageView = bottomSheetContent.findViewById(R.id.status_message);
Assert.assertEquals(statusMessageView.getText(), testStatusMessage); Assert.assertEquals(statusMessageView.getText(), testStatusMessage);
// Show scrim. // Show scrim.
...@@ -179,24 +200,24 @@ public class AutofillAssistantUiTest { ...@@ -179,24 +200,24 @@ public class AutofillAssistantUiTest {
false, /* highlightLine2 = */ false, false, /* highlightLine2 = */ false,
/* highlightLine3 = */ false, /* highlightLine3 = */ false,
/* animatePlaceholders= */ false))); /* animatePlaceholders= */ false)));
TextView detailsTitle = bottomSheet.findViewById(R.id.details_title); TextView detailsTitle = bottomSheetContent.findViewById(R.id.details_title);
TextView detailsLine1 = bottomSheet.findViewById(R.id.details_line1); TextView detailsLine1 = bottomSheetContent.findViewById(R.id.details_line1);
TextView detailsLine2 = bottomSheet.findViewById(R.id.details_line2); TextView detailsLine2 = bottomSheetContent.findViewById(R.id.details_line2);
TextView detailsLine3 = bottomSheet.findViewById(R.id.details_line3); TextView detailsLine3 = bottomSheetContent.findViewById(R.id.details_line3);
Assert.assertEquals(detailsTitle.getText(), movieTitle); Assert.assertEquals(detailsTitle.getText(), movieTitle);
Assert.assertTrue(detailsLine1.getText().toString().contains(descriptionLine1)); Assert.assertTrue(detailsLine1.getText().toString().contains(descriptionLine1));
Assert.assertTrue(detailsLine2.getText().toString().contains(descriptionLine2)); Assert.assertTrue(detailsLine2.getText().toString().contains(descriptionLine2));
Assert.assertTrue(detailsLine3.getText().toString().contains(descriptionLine3)); Assert.assertTrue(detailsLine3.getText().toString().contains(descriptionLine3));
// Progress bar must be shown. // Progress bar must be shown.
Assert.assertTrue(bottomSheet.findViewById(R.id.progress_bar).isShown()); Assert.assertTrue(bottomSheetContent.findViewById(R.id.progress_bar).isShown());
// Disable progress bar. // Disable progress bar.
ThreadUtils.runOnUiThreadBlocking( ThreadUtils.runOnUiThreadBlocking(
() ()
-> assistantCoordinator.getModel().getHeaderModel().set( -> assistantCoordinator.getModel().getHeaderModel().set(
AssistantHeaderModel.PROGRESS_VISIBLE, false)); AssistantHeaderModel.PROGRESS_VISIBLE, false));
Assert.assertFalse(bottomSheet.findViewById(R.id.progress_bar).isShown()); Assert.assertFalse(bottomSheetContent.findViewById(R.id.progress_bar).isShown());
// Show info box content. // Show info box content.
String infoBoxExplanation = "InfoBox explanation."; String infoBoxExplanation = "InfoBox explanation.";
...@@ -206,7 +227,8 @@ public class AutofillAssistantUiTest { ...@@ -206,7 +227,8 @@ public class AutofillAssistantUiTest {
AssistantInfoBoxModel.INFO_BOX, AssistantInfoBoxModel.INFO_BOX,
new AssistantInfoBox( new AssistantInfoBox(
/* imagePath = */ "", infoBoxExplanation))); /* imagePath = */ "", infoBoxExplanation)));
TextView infoBoxExplanationView = bottomSheet.findViewById(R.id.info_box_explanation); TextView infoBoxExplanationView =
bottomSheetContent.findViewById(R.id.info_box_explanation);
Assert.assertEquals(infoBoxExplanationView.getText(), infoBoxExplanation); Assert.assertEquals(infoBoxExplanationView.getText(), infoBoxExplanation);
} }
......
...@@ -417,17 +417,19 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent ...@@ -417,17 +417,19 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
mConnection.showSignInToastIfNecessary(mSession, getIntent()); mConnection.showSignInToastIfNecessary(mSession, getIntent());
if (ChromeFeatureList.isEnabled(ChromeFeatureList.AUTOFILL_ASSISTANT)
&& AutofillAssistantFacade.isConfigured(getInitialIntent().getExtras())) {
AutofillAssistantFacade.start(this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && useSeparateTask()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && useSeparateTask()) {
mTaskDescriptionHelper = new ActivityTabTaskDescriptionHelper(this, mTaskDescriptionHelper = new ActivityTabTaskDescriptionHelper(this,
ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color)); ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color));
} }
super.finishNativeInitialization(); super.finishNativeInitialization();
// We start the Autofill Assistant after the call to super.finishNativeInitialization() as
// this will initialize the BottomSheet that is used to embed the Autofill Assistant bottom
// bar.
if (isAutofillAssistantEnabled()) {
AutofillAssistantFacade.start(this);
}
} }
@Override @Override
...@@ -920,4 +922,14 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent ...@@ -920,4 +922,14 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
return component; return component;
} }
@Override
protected boolean shouldInitializeBottomSheet() {
return isAutofillAssistantEnabled();
}
private boolean isAutofillAssistantEnabled() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.AUTOFILL_ASSISTANT)
&& AutofillAssistantFacade.isConfigured(getInitialIntent().getExtras());
}
} }
...@@ -173,14 +173,12 @@ void UiControllerAndroid::SetupForState() { ...@@ -173,14 +173,12 @@ void UiControllerAndroid::SetupForState() {
SetOverlayState(OverlayState::FULL); SetOverlayState(OverlayState::FULL);
AllowShowingSoftKeyboard(false); AllowShowingSoftKeyboard(false);
SetSpinPoodle(true); SetSpinPoodle(true);
SetAllowSwipingSheet(true);
return; return;
case AutofillAssistantState::RUNNING: case AutofillAssistantState::RUNNING:
SetOverlayState(OverlayState::FULL); SetOverlayState(OverlayState::FULL);
AllowShowingSoftKeyboard(false); AllowShowingSoftKeyboard(false);
SetSpinPoodle(true); SetSpinPoodle(true);
SetAllowSwipingSheet(true);
return; return;
case AutofillAssistantState::AUTOSTART_FALLBACK_PROMPT: case AutofillAssistantState::AUTOSTART_FALLBACK_PROMPT:
...@@ -197,7 +195,6 @@ void UiControllerAndroid::SetupForState() { ...@@ -197,7 +195,6 @@ void UiControllerAndroid::SetupForState() {
AllowShowingSoftKeyboard(true); AllowShowingSoftKeyboard(true);
SetSpinPoodle(false); SetSpinPoodle(false);
SetAllowSwipingSheet(ui_delegate_->GetPaymentRequestOptions() == nullptr);
// user interaction is needed. // user interaction is needed.
ExpandBottomSheet(); ExpandBottomSheet();
return; return;
...@@ -206,14 +203,12 @@ void UiControllerAndroid::SetupForState() { ...@@ -206,14 +203,12 @@ void UiControllerAndroid::SetupForState() {
SetOverlayState(OverlayState::FULL); SetOverlayState(OverlayState::FULL);
AllowShowingSoftKeyboard(true); AllowShowingSoftKeyboard(true);
SetSpinPoodle(true); SetSpinPoodle(true);
SetAllowSwipingSheet(true);
return; return;
case AutofillAssistantState::STOPPED: case AutofillAssistantState::STOPPED:
SetOverlayState(OverlayState::HIDDEN); SetOverlayState(OverlayState::HIDDEN);
AllowShowingSoftKeyboard(true); AllowShowingSoftKeyboard(true);
SetSpinPoodle(false); SetSpinPoodle(false);
SetAllowSwipingSheet(true);
// make sure user sees the error message. // make sure user sees the error message.
ExpandBottomSheet(); ExpandBottomSheet();
...@@ -261,11 +256,6 @@ void UiControllerAndroid::SetSpinPoodle(bool enabled) { ...@@ -261,11 +256,6 @@ void UiControllerAndroid::SetSpinPoodle(bool enabled) {
GetHeaderModel(), enabled); GetHeaderModel(), enabled);
} }
void UiControllerAndroid::SetAllowSwipingSheet(bool allow) {
Java_AssistantModel_setAllowSwipingSheet(AttachCurrentThread(), GetModel(),
allow);
}
void UiControllerAndroid::OnFeedbackButtonClicked() { void UiControllerAndroid::OnFeedbackButtonClicked() {
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
Java_AutofillAssistantUiController_showFeedback( Java_AutofillAssistantUiController_showFeedback(
......
...@@ -143,7 +143,6 @@ class UiControllerAndroid : public UiController { ...@@ -143,7 +143,6 @@ class UiControllerAndroid : public UiController {
void AllowShowingSoftKeyboard(bool enabled); void AllowShowingSoftKeyboard(bool enabled);
void ExpandBottomSheet(); void ExpandBottomSheet();
void SetSpinPoodle(bool enabled); void SetSpinPoodle(bool enabled);
void SetAllowSwipingSheet(bool allow);
std::string GetDebugContext(); std::string GetDebugContext();
void DestroySelf(); void DestroySelf();
void Shutdown(Metrics::DropOutReason reason); void Shutdown(Metrics::DropOutReason reason);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment