[Android] New c-tor signatures for top toolbar classes

Chromium change:
https://github.com/chromium/chromium/commit/c93a4543bd360aa2ca31f2bccee6bd1381427eb8

AboutThisSite: Launch ephemeral tabs from PageInfo
Pass EphemeralTabCoordinator to PageInfo in order to open source info
and the "more about this page" link on top of the current tab instead
of in a new tab.
Add EphemeralTabCoordinatorSupplier to RootUiCoordinator to make it
available to all the places that create PageInfo.

Screen recording: https://crbug.com/1318000#c5

Bug: 1318000
This commit is contained in:
samartnik
2022-06-10 05:58:23 -04:00
committed by Emerick Rogul
parent fc5a5180d0
commit 85df82caff
3 changed files with 15 additions and 13 deletions
@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
import org.chromium.chrome.browser.browser_controls.BrowserControlsSizer;
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
import org.chromium.chrome.browser.compositor.Invalidator;
import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator;
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerImpl;
import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
import org.chromium.chrome.browser.findinpage.FindToolbarManager;
@@ -158,6 +159,7 @@ public class BraveToolbarManager extends ToolbarManager {
merchantTrustSignalsCoordinatorSupplier,
OneshotSupplier<TabReparentingController> tabReparentingControllerSupplier,
@NonNull OmniboxPedalDelegate omniboxPedalDelegate,
Supplier<EphemeralTabCoordinator> ephemeralTabCoordinatorSupplier,
boolean initializeWithIncognitoColors) {
super(activity, controlsSizer, fullscreenManager, controlContainer, compositorViewHolder,
urlFocusChangedCallback, topUiThemeColorProvider, tabObscuringHandler,
@@ -172,7 +174,7 @@ public class BraveToolbarManager extends ToolbarManager {
bottomSheetController, isWarmOnResumeSupplier, tabContentManager, tabCreatorManager,
snackbarManager, jankTracker, merchantTrustSignalsCoordinatorSupplier,
tabReparentingControllerSupplier, omniboxPedalDelegate,
initializeWithIncognitoColors);
ephemeralTabCoordinatorSupplier, initializeWithIncognitoColors);
mOmniboxFocusStateSupplier = omniboxFocusStateSupplier;
mLayoutStateProviderSupplier = layoutStateProviderSupplier;
@@ -17,11 +17,11 @@ class BraveTabSwitcherModeTTCoordinator extends TabSwitcherModeTTCoordinator {
private MenuButtonCoordinator mBraveMenuButtonCoordinator;
BraveTabSwitcherModeTTCoordinator(ViewStub tabSwitcherToolbarStub,
MenuButtonCoordinator menuButtonCoordinator, boolean isGridTabSwitcherEnabled,
boolean isTabletGtsPolishEnabled, boolean isTabToGtsAnimationEnabled,
BooleanSupplier isIncognitoModeEnabledSupplier) {
super(tabSwitcherToolbarStub, menuButtonCoordinator, isGridTabSwitcherEnabled,
isTabletGtsPolishEnabled, isTabToGtsAnimationEnabled,
ViewStub tabSwitcherFullscreenToolbarStub, MenuButtonCoordinator menuButtonCoordinator,
boolean isGridTabSwitcherEnabled, boolean isTabletGtsPolishEnabled,
boolean isTabToGtsAnimationEnabled, BooleanSupplier isIncognitoModeEnabledSupplier) {
super(tabSwitcherToolbarStub, tabSwitcherFullscreenToolbarStub, menuButtonCoordinator,
isGridTabSwitcherEnabled, isTabletGtsPolishEnabled, isTabToGtsAnimationEnabled,
isIncognitoModeEnabledSupplier);
mBraveMenuButtonCoordinator = menuButtonCoordinator;
@@ -44,7 +44,7 @@ public class BraveTopToolbarCoordinator extends TopToolbarCoordinator {
private boolean mIsBottomToolbarVisible;
public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer,
ViewStub toolbarStub, ToolbarLayout toolbarLayout,
ViewStub toolbarStub, ViewStub fullscreenToolbarStub, ToolbarLayout toolbarLayout,
ToolbarDataProvider toolbarDataProvider, ToolbarTabController tabController,
UserEducationHelper userEducationHelper, List<ButtonDataProvider> buttonDataProviders,
OneshotSupplier<LayoutStateProvider> layoutStateProviderSupplier,
@@ -68,9 +68,9 @@ public class BraveTopToolbarCoordinator extends TopToolbarCoordinator {
OfflineDownloader offlineDownloader, boolean initializeWithIncognitoColors,
ObservableSupplier<Profile> profileSupplier,
Callback<LoadUrlParams> startSurfaceLogoClickedCallback) {
super(controlContainer, toolbarStub, toolbarLayout, toolbarDataProvider, tabController,
userEducationHelper, buttonDataProviders, layoutStateProviderSupplier,
normalThemeColorProvider, overviewThemeColorProvider,
super(controlContainer, toolbarStub, fullscreenToolbarStub, toolbarLayout,
toolbarDataProvider, tabController, userEducationHelper, buttonDataProviders,
layoutStateProviderSupplier, normalThemeColorProvider, overviewThemeColorProvider,
browsingModeMenuButtonCoordinator, overviewModeMenuButtonCoordinator,
appMenuButtonHelperSupplier, tabModelSelectorSupplier, homepageEnabledSupplier,
startSurfaceAsHomepageSupplier, homepageManagedByPolicySupplier,
@@ -89,9 +89,9 @@ public class BraveTopToolbarCoordinator extends TopToolbarCoordinator {
if (!isStartSurfaceEnabled) {
mTabSwitcherModeCoordinator = new BraveTabSwitcherModeTTCoordinator(
controlContainer.getRootView().findViewById(R.id.tab_switcher_toolbar_stub),
overviewModeMenuButtonCoordinator, isGridTabSwitcherEnabled,
isTabletGtsPolishEnabled, isTabToGtsAnimationEnabled,
isIncognitoModeEnabledSupplier);
fullscreenToolbarStub, overviewModeMenuButtonCoordinator,
isGridTabSwitcherEnabled, isTabletGtsPolishEnabled,
isTabToGtsAnimationEnabled, isIncognitoModeEnabledSupplier);
}
}
}