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; ...@@ -20,7 +20,6 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods; import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl; 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.profiles.Profile;
import org.chromium.chrome.browser.signin.account_picker.AccountConsistencyPromoAction; import org.chromium.chrome.browser.signin.account_picker.AccountConsistencyPromoAction;
import org.chromium.chrome.browser.signin.account_picker.AccountPickerBottomSheetCoordinator; import org.chromium.chrome.browser.signin.account_picker.AccountPickerBottomSheetCoordinator;
...@@ -115,15 +114,11 @@ public class SigninUtils { ...@@ -115,15 +114,11 @@ public class SigninUtils {
// To create a new incognito tab after after the user clicks on "Continue" in the incognito // To create a new incognito tab after after the user clicks on "Continue" in the incognito
// interstitial. // interstitial.
TabCreator incognitoTabCreator = activity.getTabCreator(/*incognito=*/true); TabCreator incognitoTabCreator = activity.getTabCreator(/*incognito=*/true);
IncognitoInterstitialDelegate incognitoInterstitialDelegate = AccountPickerBottomSheetCoordinator coordinator = new AccountPickerBottomSheetCoordinator(
new IncognitoInterstitialDelegate(activity, regularTabModel, incognitoTabCreator, activity, bottomSheetController,
HelpAndFeedbackLauncherImpl.getInstance()); new AccountPickerDelegateImpl(windowAndroid, activity.getActivityTab(),
new WebSigninBridge.Factory(), continueUrl),
AccountPickerBottomSheetCoordinator coordinator = regularTabModel, incognitoTabCreator, HelpAndFeedbackLauncherImpl.getInstance());
new AccountPickerBottomSheetCoordinator(activity, bottomSheetController,
new AccountPickerDelegateImpl(windowAndroid, activity.getActivityTab(),
new WebSigninBridge.Factory(), continueUrl),
incognitoInterstitialDelegate);
} }
/** /**
......
...@@ -10,8 +10,11 @@ import android.view.View; ...@@ -10,8 +10,11 @@ import android.view.View;
import androidx.annotation.MainThread; import androidx.annotation.MainThread;
import androidx.annotation.VisibleForTesting; 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.IncognitoInterstitialCoordinator;
import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialDelegate; 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;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetObserver; import org.chromium.components.browser_ui.bottomsheet.BottomSheetObserver;
...@@ -56,6 +59,21 @@ public class AccountPickerBottomSheetCoordinator { ...@@ -56,6 +59,21 @@ public class AccountPickerBottomSheetCoordinator {
* bottom sheet on the screen. * bottom sheet on the screen.
*/ */
@MainThread @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, public AccountPickerBottomSheetCoordinator(Activity activity,
BottomSheetController bottomSheetController, BottomSheetController bottomSheetController,
AccountPickerDelegate accountPickerDelegate, 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