Commit b5b635b8 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Signin] Break dependency link between signin and incognito packages

This CL breaks the dependency link between the signin package and
incognito_interstitial package so that signin package will only depend
on account_picker package and account_picker handles everything with
incognito_interstitial for the web sign-in flow.

Bug: 1149852
Change-Id: Ia4633989d9f66f35770249ddc96bd22183043f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544886Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829215}
parent 377f8147
......@@ -20,7 +20,6 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialDelegate;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.account_picker.AccountConsistencyPromoAction;
import org.chromium.chrome.browser.signin.account_picker.AccountPickerBottomSheetCoordinator;
......@@ -115,15 +114,11 @@ public class SigninUtils {
// To create a new incognito tab after after the user clicks on "Continue" in the incognito
// interstitial.
TabCreator incognitoTabCreator = activity.getTabCreator(/*incognito=*/true);
IncognitoInterstitialDelegate incognitoInterstitialDelegate =
new IncognitoInterstitialDelegate(activity, regularTabModel, incognitoTabCreator,
HelpAndFeedbackLauncherImpl.getInstance());
AccountPickerBottomSheetCoordinator coordinator =
new AccountPickerBottomSheetCoordinator(activity, bottomSheetController,
new AccountPickerDelegateImpl(windowAndroid, activity.getActivityTab(),
new WebSigninBridge.Factory(), continueUrl),
incognitoInterstitialDelegate);
AccountPickerBottomSheetCoordinator coordinator = new AccountPickerBottomSheetCoordinator(
activity, bottomSheetController,
new AccountPickerDelegateImpl(windowAndroid, activity.getActivityTab(),
new WebSigninBridge.Factory(), continueUrl),
regularTabModel, incognitoTabCreator, HelpAndFeedbackLauncherImpl.getInstance());
}
/**
......
......@@ -10,8 +10,11 @@ import android.view.View;
import androidx.annotation.MainThread;
import androidx.annotation.VisibleForTesting;
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher;
import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialCoordinator;
import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialDelegate;
import org.chromium.chrome.browser.tabmodel.TabCreator;
import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetObserver;
......@@ -56,6 +59,21 @@ public class AccountPickerBottomSheetCoordinator {
* bottom sheet on the screen.
*/
@MainThread
public AccountPickerBottomSheetCoordinator(Activity activity,
BottomSheetController bottomSheetController,
AccountPickerDelegate accountPickerDelegate, TabModel regularTabModel,
TabCreator incognitoTabCreator, HelpAndFeedbackLauncher helpAndFeedbackLauncher) {
this(activity, bottomSheetController, accountPickerDelegate,
new IncognitoInterstitialDelegate(
activity, regularTabModel, incognitoTabCreator, helpAndFeedbackLauncher));
}
/**
* Constructs the AccountPickerBottomSheetCoordinator and shows the
* bottom sheet on the screen.
*/
@VisibleForTesting
@MainThread
public AccountPickerBottomSheetCoordinator(Activity activity,
BottomSheetController bottomSheetController,
AccountPickerDelegate accountPickerDelegate,
......
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