[Android] Polish toolbar for first relaunch and a11y switcher
Chromium change: https://github.com/chromium/chromium/commit/1b9e3f25fadc72b743c4529e1870453f594b9d86 [TabletGTS] Fix polish toolbar for first relaunch and a11y switcher Fix polish toolbar for first relaunch and a11y switcher. -Pass both the fullscreen and non-fullscreen tab switcher toolbar stubs when the polished tablet GTS is enabled. -Choose which one to use based on our flag and if the a11y list switcher is enabled. (cherry picked from commit 50515c1) Bug: 1312980, 1317611
This commit is contained in:
committed by
Claudio DeSouza
parent
c664cb3b9e
commit
b6b99ccc10
@@ -147,7 +147,7 @@
|
||||
}
|
||||
|
||||
-keep class org.chromium.chrome.browser.toolbar.top.TabSwitcherModeTTCoordinator {
|
||||
*** mTabSwitcherModeToolbar;
|
||||
*** mActiveTabSwitcherToolbar;
|
||||
}
|
||||
|
||||
-keep class org.chromium.chrome.browser.toolbar.top.TabSwitcherModeTopToolbar {
|
||||
|
||||
+10
-10
@@ -11,17 +11,17 @@ import org.chromium.base.supplier.BooleanSupplier;
|
||||
import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator;
|
||||
|
||||
class BraveTabSwitcherModeTTCoordinator extends TabSwitcherModeTTCoordinator {
|
||||
private TabSwitcherModeTopToolbar mTabSwitcherModeToolbar;
|
||||
private TabSwitcherModeTopToolbar mActiveTabSwitcherToolbar;
|
||||
|
||||
private boolean mIsBottomToolbarVisible;
|
||||
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;
|
||||
@@ -31,8 +31,8 @@ class BraveTabSwitcherModeTTCoordinator extends TabSwitcherModeTTCoordinator {
|
||||
public void setTabSwitcherMode(boolean inTabSwitcherMode) {
|
||||
super.setTabSwitcherMode(inTabSwitcherMode);
|
||||
if (inTabSwitcherMode
|
||||
&& (mTabSwitcherModeToolbar instanceof BraveTabSwitcherModeTopToolbar)) {
|
||||
((BraveTabSwitcherModeTopToolbar) mTabSwitcherModeToolbar)
|
||||
&& (mActiveTabSwitcherToolbar instanceof BraveTabSwitcherModeTopToolbar)) {
|
||||
((BraveTabSwitcherModeTopToolbar) mActiveTabSwitcherToolbar)
|
||||
.onBottomToolbarVisibilityChanged(mIsBottomToolbarVisible);
|
||||
}
|
||||
if (mBraveMenuButtonCoordinator != null && mIsBottomToolbarVisible) {
|
||||
@@ -45,8 +45,8 @@ class BraveTabSwitcherModeTTCoordinator extends TabSwitcherModeTTCoordinator {
|
||||
return;
|
||||
}
|
||||
mIsBottomToolbarVisible = isVisible;
|
||||
if (mTabSwitcherModeToolbar instanceof BraveTabSwitcherModeTopToolbar) {
|
||||
((BraveTabSwitcherModeTopToolbar) mTabSwitcherModeToolbar)
|
||||
if (mActiveTabSwitcherToolbar instanceof BraveTabSwitcherModeTopToolbar) {
|
||||
((BraveTabSwitcherModeTopToolbar) mActiveTabSwitcherToolbar)
|
||||
.onBottomToolbarVisibilityChanged(isVisible);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user