showStartSurfaceSupplier) {
OnClickListener wrappedNewTabClickHandler =
v -> {
@@ -252,6 +256,7 @@ public void initializeWithNative(LayoutManagerImpl layoutManager,
};
super.initializeWithNative(
layoutManager,
+ stripLayoutHelperManager,
tabSwitcherClickHandler,
wrappedNewTabClickHandler,
bookmarkClickHandler,
@@ -260,12 +265,14 @@ public void initializeWithNative(LayoutManagerImpl layoutManager,
if (isToolbarPhone() && BottomToolbarConfiguration.isBottomToolbarEnabled()) {
enableBottomControls();
- Runnable closeAllTabsAction = () -> {
- mTabModelSelector.getModel(mIncognitoStateProvider.isIncognitoSelected())
- .closeAllTabs();
- };
+ Runnable closeAllTabsAction =
+ () -> {
+ mTabModelSelector
+ .getModel(mIncognitoStateProvider.isIncognitoSelected())
+ .closeAllTabs();
+ };
assert (mBottomControlsCoordinatorSupplier.get()
- instanceof BraveBottomControlsCoordinator);
+ instanceof BraveBottomControlsCoordinator);
((BraveBottomControlsCoordinator) mBottomControlsCoordinatorSupplier.get())
.initializeWithNative(
mActivity,
@@ -274,7 +281,7 @@ public void initializeWithNative(LayoutManagerImpl layoutManager,
tabSwitcherClickHandler,
wrappedNewTabClickHandler,
mWindowAndroid,
- mTabCountProvider,
+ mTabModelSelector,
mIncognitoStateProvider,
mActivity.findViewById(R.id.control_container),
closeAllTabsAction);
diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java
index f9aaaca8edc9..367570d3f7ca 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java
@@ -35,10 +35,10 @@
import org.chromium.chrome.browser.layouts.LayoutType;
import org.chromium.chrome.browser.omnibox.OmniboxFocusReason;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
+import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tasks.ReturnToChromeUtil;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.toolbar.LocationBarModel;
-import org.chromium.chrome.browser.toolbar.TabCountProvider;
import org.chromium.chrome.browser.toolbar.home_button.HomeButton;
import org.chromium.chrome.browser.ui.appmenu.AppMenuButtonHelper;
import org.chromium.chrome.browser.util.TabUtils;
@@ -131,39 +131,54 @@ class BottomToolbarCoordinator implements View.OnLongClickListener {
/**
* Initialize the bottom toolbar with the components that had native initialization
* dependencies.
- *
- * Calling this must occur after the native library have completely loaded.
- * @param tabSwitcherListener An {@link OnClickListener} that is triggered when the
- * tab switcher button is clicked.
- * @param newTabClickListener An {@link OnClickListener} that is triggered when the
- * new tab button is clicked.
- * @param tabCountProvider Updates the tab count number in the tab switcher button and in the
- * incognito toggle tab layout.
+ *
+ *
Calling this must occur after the native library have completely loaded.
+ *
+ * @param tabSwitcherListener An {@link OnClickListener} that is triggered when the tab switcher
+ * button is clicked.
+ * @param newTabClickListener An {@link OnClickListener} that is triggered when the new tab
+ * button is clicked.
+ * @param tabModelSelector Updates the tab count number in the tab switcher button and in the
+ * incognito toggle tab layout.
* @param incognitoStateProvider Notifies components when incognito mode is entered or exited.
* @param topToolbarRoot The root {@link ViewGroup} of the top toolbar.
* @param closeAllTabsAction The runnable that closes all tabs in the current tab model.
*/
- void initializeWithNative(OnClickListener tabSwitcherListener,
- OnClickListener newTabClickListener, TabCountProvider tabCountProvider,
- IncognitoStateProvider incognitoStateProvider, ViewGroup topToolbarRoot,
+ void initializeWithNative(
+ OnClickListener tabSwitcherListener,
+ OnClickListener newTabClickListener,
+ TabModelSelector tabModelSelector,
+ IncognitoStateProvider incognitoStateProvider,
+ ViewGroup topToolbarRoot,
Runnable closeAllTabsAction) {
- final OnClickListener closeTabsClickListener = v -> {
- final boolean isIncognito = incognitoStateProvider.isIncognitoSelected();
- if (isIncognito) {
- RecordUserAction.record("MobileToolbarCloseAllIncognitoTabsButtonTap");
- } else {
- RecordUserAction.record("MobileToolbarCloseAllRegularTabsButtonTap");
- }
+ final OnClickListener closeTabsClickListener =
+ v -> {
+ final boolean isIncognito = incognitoStateProvider.isIncognitoSelected();
+ if (isIncognito) {
+ RecordUserAction.record("MobileToolbarCloseAllIncognitoTabsButtonTap");
+ } else {
+ RecordUserAction.record("MobileToolbarCloseAllRegularTabsButtonTap");
+ }
- closeAllTabsAction.run();
- };
+ closeAllTabsAction.run();
+ };
- mBrowsingModeCoordinator.initializeWithNative(newTabClickListener, tabSwitcherListener,
- mMenuButtonHelperSupplier, tabCountProvider, mThemeColorProvider,
+ mBrowsingModeCoordinator.initializeWithNative(
+ newTabClickListener,
+ tabSwitcherListener,
+ mMenuButtonHelperSupplier,
+ tabModelSelector,
+ mThemeColorProvider,
incognitoStateProvider);
- mTabSwitcherModeCoordinator = new TabSwitcherBottomToolbarCoordinator(mTabSwitcherModeStub,
- topToolbarRoot, incognitoStateProvider, mThemeColorProvider, newTabClickListener,
- closeTabsClickListener, mMenuButtonHelperSupplier, tabCountProvider);
+ mTabSwitcherModeCoordinator =
+ new TabSwitcherBottomToolbarCoordinator(
+ mTabSwitcherModeStub,
+ topToolbarRoot,
+ incognitoStateProvider,
+ mThemeColorProvider,
+ newTabClickListener,
+ closeTabsClickListener,
+ mMenuButtonHelperSupplier);
ChromeActivity activity = null;
try {
@@ -174,57 +189,72 @@ void initializeWithNative(OnClickListener tabSwitcherListener,
// Do not change bottom bar if StartSurface Single Pane is enabled and HomePage is not
// customized.
if (!ReturnToChromeUtil.shouldShowStartSurfaceAsTheHomePage(
- activity != null ? activity : mContext)
+ activity != null ? activity : mContext)
&& BottomToolbarVariationManager.shouldBottomToolbarBeVisibleInOverviewMode()) {
- mLayoutStateObserver = new LayoutStateProvider.LayoutStateObserver() {
- @Override
- public void onStartedShowing(@LayoutType int layoutType) {
- if (layoutType != LayoutType.TAB_SWITCHER) return;
-
- BrowsingModeBottomToolbarCoordinator browsingModeCoordinator =
- (BrowsingModeBottomToolbarCoordinator) mBrowsingModeCoordinator;
- browsingModeCoordinator.getSearchAccelerator().setVisibility(View.GONE);
- if (BottomToolbarVariationManager.isHomeButtonOnBottom()) {
- browsingModeCoordinator.getHomeButton().setVisibility(View.INVISIBLE);
- }
- if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) {
- browsingModeCoordinator.getBookmarkButton().setVisibility(View.INVISIBLE);
- }
- if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) {
- browsingModeCoordinator.getTabSwitcherButtonView().setVisibility(
- View.INVISIBLE);
- }
- if (BottomToolbarVariationManager.isNewTabButtonOnBottom()) {
- browsingModeCoordinator.getNewTabButtonParent().setVisibility(View.VISIBLE);
- }
-
- mBottomContainerTopShadow.setVisibility(View.GONE);
- }
-
- @Override
- public void onStartedHiding(@LayoutType int layoutType) {
- if (layoutType != LayoutType.TAB_SWITCHER) return;
-
- BrowsingModeBottomToolbarCoordinator browsingModeCoordinator =
- (BrowsingModeBottomToolbarCoordinator) mBrowsingModeCoordinator;
- browsingModeCoordinator.getSearchAccelerator().setVisibility(View.VISIBLE);
- if (BottomToolbarVariationManager.isHomeButtonOnBottom()) {
- browsingModeCoordinator.getHomeButton().setVisibility(View.VISIBLE);
- }
- if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) {
- browsingModeCoordinator.getBookmarkButton().setVisibility(View.VISIBLE);
- }
- if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) {
- browsingModeCoordinator.getTabSwitcherButtonView().setVisibility(
- View.VISIBLE);
- }
- if (BottomToolbarVariationManager.isNewTabButtonOnBottom()) {
- browsingModeCoordinator.getNewTabButtonParent().setVisibility(View.GONE);
- }
-
- mBottomContainerTopShadow.setVisibility(View.VISIBLE);
- }
- };
+ mLayoutStateObserver =
+ new LayoutStateProvider.LayoutStateObserver() {
+ @Override
+ public void onStartedShowing(@LayoutType int layoutType) {
+ if (layoutType != LayoutType.TAB_SWITCHER) return;
+
+ BrowsingModeBottomToolbarCoordinator browsingModeCoordinator =
+ (BrowsingModeBottomToolbarCoordinator) mBrowsingModeCoordinator;
+ browsingModeCoordinator.getSearchAccelerator().setVisibility(View.GONE);
+ if (BottomToolbarVariationManager.isHomeButtonOnBottom()) {
+ browsingModeCoordinator
+ .getHomeButton()
+ .setVisibility(View.INVISIBLE);
+ }
+ if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) {
+ browsingModeCoordinator
+ .getBookmarkButton()
+ .setVisibility(View.INVISIBLE);
+ }
+ if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) {
+ browsingModeCoordinator
+ .getTabSwitcherButtonView()
+ .setVisibility(View.INVISIBLE);
+ }
+ if (BottomToolbarVariationManager.isNewTabButtonOnBottom()) {
+ browsingModeCoordinator
+ .getNewTabButtonParent()
+ .setVisibility(View.VISIBLE);
+ }
+
+ mBottomContainerTopShadow.setVisibility(View.GONE);
+ }
+
+ @Override
+ public void onStartedHiding(@LayoutType int layoutType) {
+ if (layoutType != LayoutType.TAB_SWITCHER) return;
+
+ BrowsingModeBottomToolbarCoordinator browsingModeCoordinator =
+ (BrowsingModeBottomToolbarCoordinator) mBrowsingModeCoordinator;
+ browsingModeCoordinator
+ .getSearchAccelerator()
+ .setVisibility(View.VISIBLE);
+ if (BottomToolbarVariationManager.isHomeButtonOnBottom()) {
+ browsingModeCoordinator.getHomeButton().setVisibility(View.VISIBLE);
+ }
+ if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) {
+ browsingModeCoordinator
+ .getBookmarkButton()
+ .setVisibility(View.VISIBLE);
+ }
+ if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) {
+ browsingModeCoordinator
+ .getTabSwitcherButtonView()
+ .setVisibility(View.VISIBLE);
+ }
+ if (BottomToolbarVariationManager.isNewTabButtonOnBottom()) {
+ browsingModeCoordinator
+ .getNewTabButtonParent()
+ .setVisibility(View.GONE);
+ }
+
+ mBottomContainerTopShadow.setVisibility(View.VISIBLE);
+ }
+ };
}
View root = (View) topToolbarRoot.getParent();
@@ -236,18 +266,19 @@ public void onStartedHiding(@LayoutType int layoutType) {
updateHomeButtonState();
mHomeButton.setOnLongClickListener(this);
- final OnClickListener homeButtonListener = v -> {
- if (HomepageManager.isHomepageEnabled()) {
- try {
- BraveActivity.getBraveActivity().setComesFromNewTab(true);
- } catch (BraveActivity.BraveActivityNotFoundException e) {
- Log.e(TAG, "HomeButton click " + e);
- }
- mOriginalHomeButtonRunnable.run();
- } else {
- newTabClickListener.onClick(v);
- }
- };
+ final OnClickListener homeButtonListener =
+ v -> {
+ if (HomepageManager.isHomepageEnabled()) {
+ try {
+ BraveActivity.getBraveActivity().setComesFromNewTab(true);
+ } catch (BraveActivity.BraveActivityNotFoundException e) {
+ Log.e(TAG, "HomeButton click " + e);
+ }
+ mOriginalHomeButtonRunnable.run();
+ } else {
+ newTabClickListener.onClick(v);
+ }
+ };
mHomeButton.setOnClickListener(homeButtonListener);
}
diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java
index e294ce8a4efb..eea2235c4323 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java
@@ -26,9 +26,9 @@
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
import org.chromium.chrome.browser.tab.TabObscuringHandler;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
+import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.toolbar.LocationBarModel;
-import org.chromium.chrome.browser.toolbar.TabCountProvider;
import org.chromium.chrome.browser.ui.appmenu.AppMenuButtonHelper;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.resources.ResourceManager;
@@ -81,20 +81,40 @@ public BraveBottomControlsCoordinator(
mLocationBarModel = locationBarModel;
}
- public void initializeWithNative(Activity activity, ResourceManager resourceManager,
- LayoutManagerImpl layoutManager, OnClickListener tabSwitcherListener,
- OnClickListener newTabClickListener, WindowAndroid windowAndroid,
- TabCountProvider tabCountProvider, IncognitoStateProvider incognitoStateProvider,
- ViewGroup topToolbarRoot, Runnable closeAllTabsAction) {
+ public void initializeWithNative(
+ Activity activity,
+ ResourceManager resourceManager,
+ LayoutManagerImpl layoutManager,
+ OnClickListener tabSwitcherListener,
+ OnClickListener newTabClickListener,
+ WindowAndroid windowAndroid,
+ TabModelSelector tabModelSelector,
+ IncognitoStateProvider incognitoStateProvider,
+ ViewGroup topToolbarRoot,
+ Runnable closeAllTabsAction) {
if (BottomToolbarConfiguration.isBottomToolbarEnabled()) {
- mBottomToolbarCoordinator = new BottomToolbarCoordinator(mRoot,
- mRoot.findViewById(R.id.bottom_toolbar), mTabProvider,
- mTabSwitcherLongclickListener, mThemeColorProvider, mOpenHomepageAction,
- mSetUrlBarFocusAction, mLayoutStateProviderSupplier, mMenuButtonHelperSupplier,
- mMediator, mBookmarkModelSupplier, mLocationBarModel);
-
- mBottomToolbarCoordinator.initializeWithNative(tabSwitcherListener, newTabClickListener,
- tabCountProvider, incognitoStateProvider, topToolbarRoot, closeAllTabsAction);
+ mBottomToolbarCoordinator =
+ new BottomToolbarCoordinator(
+ mRoot,
+ mRoot.findViewById(R.id.bottom_toolbar),
+ mTabProvider,
+ mTabSwitcherLongclickListener,
+ mThemeColorProvider,
+ mOpenHomepageAction,
+ mSetUrlBarFocusAction,
+ mLayoutStateProviderSupplier,
+ mMenuButtonHelperSupplier,
+ mMediator,
+ mBookmarkModelSupplier,
+ mLocationBarModel);
+
+ mBottomToolbarCoordinator.initializeWithNative(
+ tabSwitcherListener,
+ newTabClickListener,
+ tabModelSelector,
+ incognitoStateProvider,
+ topToolbarRoot,
+ closeAllTabsAction);
}
}
diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java
index 8e0d6d98efdb..ba24d293ee06 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java
@@ -19,11 +19,11 @@
import org.chromium.chrome.browser.ActivityTabProvider;
import org.chromium.chrome.browser.app.BraveActivity;
import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
-import org.chromium.chrome.browser.tab.TabImpl;
+import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
+import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.toolbar.BraveHomeButton;
-import org.chromium.chrome.browser.toolbar.TabCountProvider;
import org.chromium.chrome.browser.toolbar.TabSwitcherButtonCoordinator;
import org.chromium.chrome.browser.toolbar.TabSwitcherButtonView;
import org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator;
@@ -79,8 +79,11 @@ public class BrowsingModeBottomToolbarCoordinator {
private final MenuButton mMenuButton;
private ThemeColorProvider mThemeColorProvider;
- BrowsingModeBottomToolbarCoordinator(View root, ActivityTabProvider tabProvider,
- OnClickListener homeButtonListener, OnClickListener searchAcceleratorListener,
+ BrowsingModeBottomToolbarCoordinator(
+ View root,
+ ActivityTabProvider tabProvider,
+ OnClickListener homeButtonListener,
+ OnClickListener searchAcceleratorListener,
ObservableSupplier shareButtonListenerSupplier,
OnLongClickListener tabSwitcherLongClickListener) {
mModel = new BrowsingModeBottomToolbarModel();
@@ -121,19 +124,20 @@ public class BrowsingModeBottomToolbarCoordinator {
if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) {
mBookmarkButton.setVisibility(View.VISIBLE);
getNewTabButtonParent().setVisibility(View.GONE);
- OnClickListener bookmarkClickHandler = v -> {
- TabImpl tab = (TabImpl) mTabProvider.get();
- try {
- BraveActivity activity = BraveActivity.getBraveActivity();
- if (tab == null || activity == null) {
- assert false;
- return;
- }
- activity.addOrEditBookmark(tab);
- } catch (BraveActivity.BraveActivityNotFoundException e) {
- Log.e(TAG, "BookmarkButton click " + e);
- }
- };
+ OnClickListener bookmarkClickHandler =
+ v -> {
+ Tab tab = mTabProvider.get();
+ try {
+ BraveActivity activity = BraveActivity.getBraveActivity();
+ if (tab == null || activity == null) {
+ assert false;
+ return;
+ }
+ activity.addOrEditBookmark(tab);
+ } catch (BraveActivity.BraveActivityNotFoundException e) {
+ Log.e(TAG, "BookmarkButton click " + e);
+ }
+ };
mBookmarkButton.setOnClickListener(bookmarkClickHandler);
}
@@ -156,19 +160,23 @@ void onVisibilityChanged(boolean isVisible) {}
/**
* Initialize the bottom toolbar with the components that had native initialization
* dependencies.
- *
- * Calling this must occur after the native library have completely loaded.
- * @param tabSwitcherListener An {@link OnClickListener} that is triggered when the
- * tab switcher button is clicked.
- * @param menuButtonHelper An {@link AppMenuButtonHelper} that is triggered when the
- * menu button is clicked.
- * @param tabCountProvider Updates the tab count number in the tab switcher button.
+ *
+ *
Calling this must occur after the native library have completely loaded.
+ *
+ * @param tabSwitcherListener An {@link OnClickListener} that is triggered when the tab switcher
+ * button is clicked.
+ * @param menuButtonHelper An {@link AppMenuButtonHelper} that is triggered when the menu button
+ * is clicked.
+ * @param tabModelSelector Updates the tab count number in the tab switcher button.
* @param themeColorProvider Notifies components when theme color changes.
* @param incognitoStateProvider Notifies components when incognito state changes.
*/
- void initializeWithNative(OnClickListener newTabListener, OnClickListener tabSwitcherListener,
+ void initializeWithNative(
+ OnClickListener newTabListener,
+ OnClickListener tabSwitcherListener,
ObservableSupplier menuButtonHelperSupplier,
- TabCountProvider tabCountProvider, ThemeColorProvider themeColorProvider,
+ TabModelSelector tabModelSelector,
+ ThemeColorProvider themeColorProvider,
IncognitoStateProvider incognitoStateProvider) {
mThemeColorProvider = themeColorProvider;
mMediator.setThemeColorProvider(themeColorProvider);
@@ -190,7 +198,8 @@ void initializeWithNative(OnClickListener newTabListener, OnClickListener tabSwi
if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) {
mTabSwitcherButtonCoordinator.setTabSwitcherListener(tabSwitcherListener);
mTabSwitcherButtonCoordinator.setThemeColorProvider(themeColorProvider);
- mTabSwitcherButtonCoordinator.setTabCountProvider(tabCountProvider);
+ mTabSwitcherButtonCoordinator.setTabCountSupplier(
+ tabModelSelector.getCurrentModelTabCountSupplier());
}
mBookmarkButton.setThemeColorProvider(themeColorProvider);
@@ -199,10 +208,12 @@ void initializeWithNative(OnClickListener newTabListener, OnClickListener tabSwi
mThemeColorProvider.addTintObserver(mMenuButton);
- new OneShotCallback<>(menuButtonHelperSupplier, (menuButtonHelper) -> {
- assert menuButtonHelper != null;
- mMenuButton.setAppMenuButtonHelper(menuButtonHelper);
- });
+ new OneShotCallback<>(
+ menuButtonHelperSupplier,
+ (menuButtonHelper) -> {
+ assert menuButtonHelper != null;
+ mMenuButton.setAppMenuButtonHelper(menuButtonHelper);
+ });
}
/**
diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java
index 96cec4ed845a..85764d7a79a6 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java
@@ -19,7 +19,6 @@
import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
-import org.chromium.chrome.browser.toolbar.TabCountProvider;
import org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator;
import org.chromium.chrome.browser.toolbar.menu_button.MenuButton;
import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonState;
@@ -47,24 +46,26 @@ public class TabSwitcherBottomToolbarCoordinator {
/**
* Build the coordinator that manages the tab switcher bottom toolbar.
+ *
* @param stub The tab switcher bottom toolbar {@link ViewStub} to inflate.
* @param topToolbarRoot The root {@link ViewGroup} of the top toolbar.
* @param incognitoStateProvider Notifies components when incognito mode is entered or exited.
* @param themeColorProvider Notifies components when the theme color changes.
- * @param newTabClickListener An {@link OnClickListener} that is triggered when the
- * new tab button is clicked.
- * @param closeTabsClickListener An {@link OnClickListener} that is triggered when the
- * close all tabs button is clicked.
- * @param menuButtonHelper An {@link AppMenuButtonHelper} that is triggered when the
- * menu button is clicked.
- * @param tabCountProvider Updates the tab count number in the tab switcher button and in the
- * incognito toggle tab layout.
+ * @param newTabClickListener An {@link OnClickListener} that is triggered when the new tab
+ * button is clicked.
+ * @param closeTabsClickListener An {@link OnClickListener} that is triggered when the close all
+ * tabs button is clicked.
+ * @param menuButtonHelper An {@link AppMenuButtonHelper} that is triggered when the menu button
+ * is clicked.
*/
- TabSwitcherBottomToolbarCoordinator(ViewStub stub, ViewGroup topToolbarRoot,
- IncognitoStateProvider incognitoStateProvider, ThemeColorProvider themeColorProvider,
- OnClickListener newTabClickListener, OnClickListener closeTabsClickListener,
- ObservableSupplier menuButtonHelperSupplier,
- TabCountProvider tabCountProvider) {
+ TabSwitcherBottomToolbarCoordinator(
+ ViewStub stub,
+ ViewGroup topToolbarRoot,
+ IncognitoStateProvider incognitoStateProvider,
+ ThemeColorProvider themeColorProvider,
+ OnClickListener newTabClickListener,
+ OnClickListener closeTabsClickListener,
+ ObservableSupplier menuButtonHelperSupplier) {
final ViewGroup root = (ViewGroup) stub.inflate();
View toolbar = root.findViewById(R.id.bottom_toolbar_buttons);
@@ -73,7 +74,9 @@ public class TabSwitcherBottomToolbarCoordinator {
mModel = new TabSwitcherBottomToolbarModel();
- PropertyModelChangeProcessor.create(mModel, root,
+ PropertyModelChangeProcessor.create(
+ mModel,
+ root,
new TabSwitcherBottomToolbarViewBinder(
topToolbarRoot, (ViewGroup) root.getParent()));
@@ -95,10 +98,12 @@ public class TabSwitcherBottomToolbarCoordinator {
BraveMenuButtonCoordinator.setupPropertyModel(mMenuButton, menuButtonStateSupplier);
}
- new OneShotCallback<>(menuButtonHelperSupplier, (menuButtonHelper) -> {
- assert menuButtonHelper != null;
- mMenuButton.setAppMenuButtonHelper(menuButtonHelper);
- });
+ new OneShotCallback<>(
+ menuButtonHelperSupplier,
+ (menuButtonHelper) -> {
+ assert menuButtonHelper != null;
+ mMenuButton.setAppMenuButtonHelper(menuButtonHelper);
+ });
}
/**
diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
index ac6fba404526..f69a7bf097e4 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
@@ -105,7 +105,6 @@
import org.chromium.chrome.browser.shields.BraveShieldsUtils;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabHidingType;
-import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.chrome.browser.tab.TabSelectionType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver;
@@ -416,7 +415,6 @@ protected void onNativeLibraryReady() {
}
}
- @Override
public void setTabModelSelector(TabModelSelector selector) {
// We might miss events before calling setTabModelSelector, so we need
// to proactively update the shields button state here, otherwise shields
@@ -1253,9 +1251,10 @@ public void onUrlFocusChange(boolean hasFocus) {
Context context = getContext();
String countryCode = Locale.getDefault().getCountry();
try {
- if (hasFocus && PackageUtils.isFirstInstall(context)
+ if (hasFocus
+ && PackageUtils.isFirstInstall(context)
&& BraveActivity.getBraveActivity().getActivityTab() != null
- && UrlUtilities.isNTPUrl(
+ && UrlUtilities.isNtpUrl(
BraveActivity.getBraveActivity().getActivityTab().getUrl().getSpec())
&& !OnboardingPrefManager.getInstance().hasSearchEngineOnboardingShown()
&& OnboardingPrefManager.getInstance().getUrlFocusCount() == 1
@@ -1372,13 +1371,15 @@ private void updateBraveShieldsButtonState(Tab tab) {
}
private boolean isShieldsOnForTab(Tab tab) {
- if (!isNativeLibraryReady() || tab == null
- || Profile.fromWebContents(((TabImpl) tab).getWebContents()) == null) {
+ if (!isNativeLibraryReady()
+ || tab == null
+ || Profile.fromWebContents(tab.getWebContents()) == null) {
return false;
}
return BraveShieldsContentSettings.getShields(
- Profile.fromWebContents(((TabImpl) tab).getWebContents()), tab.getUrl().getSpec(),
+ Profile.fromWebContents(tab.getWebContents()),
+ tab.getUrl().getSpec(),
BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS);
}
@@ -1626,7 +1627,7 @@ protected void onDraw(Canvas canvas) {
|| BraveReflectionUtil.EqualTypes(this.getClass(), ToolbarPhone.class)) {
updateMenuButtonState();
Tab tab = getToolbarDataProvider() != null ? getToolbarDataProvider().getTab() : null;
- if (tab != null && ((TabImpl) tab).getWebContents() != null) {
+ if (tab != null && tab.getWebContents() != null) {
updateBraveShieldsButtonState(tab);
}
}
diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
index 02c77bf94793..09c2f0df1251 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
@@ -6,6 +6,7 @@
package org.chromium.chrome.browser.toolbar.top;
import android.view.View;
+import android.view.View.OnClickListener;
import android.view.ViewStub;
import org.chromium.base.Callback;
@@ -13,11 +14,15 @@
import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.browser_controls.BrowserControlsVisibilityManager;
import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate;
import org.chromium.chrome.browser.fullscreen.FullscreenManager;
+import org.chromium.chrome.browser.layouts.LayoutManager;
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
+import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
+import org.chromium.chrome.browser.theme.TopUiThemeColorProvider;
import org.chromium.chrome.browser.toolbar.ButtonData;
import org.chromium.chrome.browser.toolbar.ButtonDataProvider;
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
@@ -27,6 +32,7 @@
import org.chromium.chrome.browser.toolbar.top.NavigationPopup.HistoryDelegate;
import org.chromium.chrome.browser.toolbar.top.ToolbarTablet.OfflineDownloader;
import org.chromium.chrome.browser.ui.appmenu.AppMenuButtonHelper;
+import org.chromium.chrome.browser.ui.appmenu.AppMenuDelegate;
import org.chromium.chrome.browser.user_education.UserEducationHelper;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.resources.ResourceManager;
@@ -45,6 +51,7 @@ public class BraveTopToolbarCoordinator extends TopToolbarCoordinator {
private MenuButtonCoordinator mBraveMenuButtonCoordinator;
private boolean mIsBottomToolbarVisible;
private ObservableSupplier mConstraintsProxy;
+ private ObservableSupplier mTabModelSelectorSupplier;
public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer,
ViewStub toolbarStub, ToolbarLayout toolbarLayout,
@@ -87,6 +94,7 @@ public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer,
mBraveToolbarLayout = toolbarLayout;
mBraveMenuButtonCoordinator = browsingModeMenuButtonCoordinator;
mConstraintsProxy = constraintsSupplier;
+ mTabModelSelectorSupplier = tabModelSelectorSupplier;
if (isToolbarPhone()) {
if (!isStartSurfaceEnabled) {
@@ -135,4 +143,36 @@ public void setTabSwitcherMode(boolean inTabSwitcherMode) {
: View.VISIBLE);
}
}
+
+ @Override
+ public void initializeWithNative(
+ Runnable layoutUpdater,
+ OnClickListener tabSwitcherClickHandler,
+ OnClickListener newTabClickHandler,
+ OnClickListener bookmarkClickHandler,
+ OnClickListener customTabsBackClickHandler,
+ AppMenuDelegate appMenuDelegate,
+ LayoutManager layoutManager,
+ ObservableSupplier tabSupplier,
+ BrowserControlsVisibilityManager browserControlsVisibilityManager,
+ TopUiThemeColorProvider topUiThemeColorProvider) {
+ super.initializeWithNative(
+ layoutUpdater,
+ tabSwitcherClickHandler,
+ newTabClickHandler,
+ bookmarkClickHandler,
+ customTabsBackClickHandler,
+ appMenuDelegate,
+ layoutManager,
+ tabSupplier,
+ browserControlsVisibilityManager,
+ topUiThemeColorProvider);
+
+ assert mBraveToolbarLayout instanceof BraveToolbarLayoutImpl
+ : "Something has changed in the upstream!";
+ if (mBraveToolbarLayout instanceof BraveToolbarLayoutImpl) {
+ ((BraveToolbarLayoutImpl) mBraveToolbarLayout)
+ .setTabModelSelector(mTabModelSelectorSupplier.get());
+ }
+ }
}
diff --git a/android/java/org/chromium/chrome/browser/util/TabUtils.java b/android/java/org/chromium/chrome/browser/util/TabUtils.java
index 409dc2cdd62a..23698fdef9e8 100644
--- a/android/java/org/chromium/chrome/browser/util/TabUtils.java
+++ b/android/java/org/chromium/chrome/browser/util/TabUtils.java
@@ -195,7 +195,7 @@ public static void openNewTab() {
private static void openNewTab(BraveActivity braveActivity, boolean isIncognito) {
if (braveActivity == null) return;
braveActivity.getTabModelSelector().getModel(isIncognito).commitAllTabClosures();
- braveActivity.getTabCreator(isIncognito).launchNTP();
+ braveActivity.getTabCreator(isIncognito).launchNtp();
}
public static void openUrlInNewTab(boolean isIncognito, String url) {
diff --git a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnPlansActivity.java b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnPlansActivity.java
index 08be94b68450..af8d22ec61b8 100644
--- a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnPlansActivity.java
+++ b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnPlansActivity.java
@@ -19,7 +19,10 @@
import com.google.android.material.tabs.TabLayout;
+import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.init.ActivityProfileProvider;
+import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.util.LiveDataUtil;
import org.chromium.chrome.browser.vpn.BraveVpnNativeWorker;
import org.chromium.chrome.browser.vpn.adapters.BraveVpnPlanPagerAdapter;
@@ -207,4 +210,9 @@ public void showRestoreMenu(boolean shouldShowRestore) {
@Override
public void updateProfileView() {}
+
+ @Override
+ protected OneshotSupplier createProfileProvider() {
+ return new ActivityProfileProvider(getLifecycleDispatcher());
+ }
}
diff --git a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnProfileActivity.java b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnProfileActivity.java
index ac2e5f09f485..25093fd880e0 100644
--- a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnProfileActivity.java
+++ b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnProfileActivity.java
@@ -17,7 +17,10 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
+import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.init.ActivityProfileProvider;
+import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.vpn.BraveVpnNativeWorker;
import org.chromium.chrome.browser.vpn.models.BraveVpnPrefModel;
import org.chromium.chrome.browser.vpn.utils.BraveVpnUtils;
@@ -121,4 +124,9 @@ public void updateProfileView() {
mInstallVpnButton.setText(getResources().getString(R.string.accept_connection_request));
mContactSupportButton.setVisibility(View.GONE);
}
+
+ @Override
+ protected OneshotSupplier createProfileProvider() {
+ return new ActivityProfileProvider(getLifecycleDispatcher());
+ }
}
diff --git a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnSupportActivity.java b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnSupportActivity.java
index 2481a4cbb7f0..bc6424db3d7b 100644
--- a/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnSupportActivity.java
+++ b/android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnSupportActivity.java
@@ -25,23 +25,24 @@
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
-import org.chromium.base.supplier.OneshotSupplierImpl;
+import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.about_settings.AboutChromeSettings;
import org.chromium.chrome.browser.about_settings.AboutSettingsBridge;
import org.chromium.chrome.browser.firstrun.BraveFirstRunFlowSequencer;
+import org.chromium.chrome.browser.init.ActivityProfileProvider;
import org.chromium.chrome.browser.init.AsyncInitializationActivity;
-import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.vpn.utils.BraveVpnPrefUtils;
import java.util.TimeZone;
public class BraveVpnSupportActivity extends AsyncInitializationActivity {
private BraveFirstRunFlowSequencer mFirstRunFlowSequencer;
- private final OneshotSupplierImpl mProfileSupplier;
+ private final OneshotSupplier mProfileSupplier;
public BraveVpnSupportActivity() {
- mProfileSupplier = new OneshotSupplierImpl<>();
+ mProfileSupplier = createProfileProvider();
}
private void initializeViews() {
@@ -144,13 +145,13 @@ public void onClick(View v) {
@Override
protected void triggerLayoutInflation() {
- mProfileSupplier.set(Profile.getLastUsedRegularProfile());
- mFirstRunFlowSequencer = new BraveFirstRunFlowSequencer(this, mProfileSupplier) {
- @Override
- public void onFlowIsKnown(Bundle freProperties) {
- initializeViews();
- }
- };
+ mFirstRunFlowSequencer =
+ new BraveFirstRunFlowSequencer(this, mProfileSupplier) {
+ @Override
+ public void onFlowIsKnown(Bundle freProperties) {
+ initializeViews();
+ }
+ };
mFirstRunFlowSequencer.start();
onInitialLayoutInflationComplete();
}
@@ -200,4 +201,9 @@ private String getCellularCarrier() {
((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE));
return telephonyManager.getNetworkOperatorName();
}
+
+ @Override
+ protected OneshotSupplier createProfileProvider() {
+ return new ActivityProfileProvider(getLifecycleDispatcher());
+ }
}
diff --git a/android/java/org/chromium/chrome/browser/vpn/split_tunnel/SplitTunnelActivity.java b/android/java/org/chromium/chrome/browser/vpn/split_tunnel/SplitTunnelActivity.java
index 0fc6d03f0730..fb81e7046bf2 100644
--- a/android/java/org/chromium/chrome/browser/vpn/split_tunnel/SplitTunnelActivity.java
+++ b/android/java/org/chromium/chrome/browser/vpn/split_tunnel/SplitTunnelActivity.java
@@ -22,8 +22,11 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.init.ActivityProfileProvider;
import org.chromium.chrome.browser.init.AsyncInitializationActivity;
+import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.vpn.utils.BraveVpnPrefUtils;
import org.chromium.chrome.browser.vpn.utils.BraveVpnUtils;
@@ -157,4 +160,9 @@ public void onApplicationCLick(
public boolean shouldStartGpuProcess() {
return true;
}
+
+ @Override
+ protected OneshotSupplier createProfileProvider() {
+ return new ActivityProfileProvider(getLifecycleDispatcher());
+ }
}
diff --git a/android/java/res/layout/brave_wallet_network_item.xml b/android/java/res/layout/brave_wallet_network_item.xml
index 523db3374e0b..b7a1e54fb75f 100644
--- a/android/java/res/layout/brave_wallet_network_item.xml
+++ b/android/java/res/layout/brave_wallet_network_item.xml
@@ -35,7 +35,7 @@
style="@style/PreferenceSummary" />
-
+ #F0F2FF
+ #FA7250
#5B2A23
- #F35333
@color/default_text_color_on_accent1_light
@color/default_bg_color_baseline
+ @color/baseline_primary_30
@color/baseline_primary_80
@@ -22,7 +24,7 @@
#1E2029
#478AFF
- #FA7250
+ @color/baseline_primary_80
#FF1893
#A78AFF
diff --git a/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java b/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java
index 67372c67f104..72479eccf9ff 100644
--- a/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java
+++ b/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java
@@ -98,7 +98,7 @@ private boolean loadUrlAttemptRefresh(String url, int transition) throws Excepti
() -> {
try {
Tab tab =
- new TabBuilder()
+ new TabBuilder(sActivityTestRule.getProfile(false))
.setWindow(
sActivityTestRule
.getActivity()
diff --git a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
index 2dc2d780a437..32918be0604f 100644
--- a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
+++ b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
@@ -30,6 +30,7 @@
import org.chromium.base.Callback;
import org.chromium.base.jank_tracker.JankTracker;
import org.chromium.base.shared_preferences.PreferenceKeyRegistry;
+import org.chromium.base.shared_preferences.SharedPreferencesManager;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.ObservableSupplierImpl;
import org.chromium.base.supplier.OneshotSupplier;
@@ -60,6 +61,7 @@
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.logo.CachedTintedBitmap;
import org.chromium.chrome.browser.logo.LogoCoordinator;
+import org.chromium.chrome.browser.multiwindow.MultiInstanceManager;
import org.chromium.chrome.browser.multiwindow.MultiWindowModeStateDispatcher;
import org.chromium.chrome.browser.new_tab_url.DseNewTabUrlManager;
import org.chromium.chrome.browser.ntp.NewTabPageUma;
@@ -68,7 +70,6 @@
import org.chromium.chrome.browser.omnibox.LocationBarDataProvider;
import org.chromium.chrome.browser.omnibox.LocationBarLayout;
import org.chromium.chrome.browser.omnibox.OverrideUrlLoadingDelegate;
-import org.chromium.chrome.browser.omnibox.SearchEngineLogoUtils;
import org.chromium.chrome.browser.omnibox.UrlBarEditingTextStateProvider;
import org.chromium.chrome.browser.omnibox.status.PageInfoIPHController;
import org.chromium.chrome.browser.omnibox.status.StatusCoordinator.PageInfoAction;
@@ -83,7 +84,7 @@
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObscuringHandler;
import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager;
-import org.chromium.chrome.browser.tabmodel.ChromeTabCreator.OverviewNTPCreator;
+import org.chromium.chrome.browser.tabmodel.ChromeTabCreator.OverviewNtpCreator;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
@@ -109,7 +110,6 @@
import org.chromium.chrome.browser.user_education.UserEducationHelper;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
-import org.chromium.components.browser_ui.settings.SettingsLauncher;
import org.chromium.components.browser_ui.site_settings.ContentSettingException;
import org.chromium.components.browser_ui.site_settings.PermissionInfo;
import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
@@ -374,6 +374,9 @@ public void testClassesExist() throws Exception {
Assert.assertTrue(
classExists(
"org/chromium/chrome/browser/identity_disc/BraveIdentityDiscController"));
+ Assert.assertTrue(classExists("org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs"));
+ Assert.assertTrue(
+ classExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs"));
}
@Test
@@ -434,14 +437,36 @@ public void testMethodsExist() throws Exception {
Assert.assertTrue(
methodExists("org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTopToolbar",
"shouldShowIncognitoToggle", false, null));
- Assert.assertTrue(methodExists("org/chromium/chrome/browser/download/MimeUtils",
- "canAutoOpenMimeType", false, null));
- Assert.assertTrue(methodExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils",
- "addOrEditBookmark", false, null));
- Assert.assertTrue(methodExists("org/chromium/chrome/browser/bookmarks/BookmarkUtils",
- "addOrEditBookmark", false, null));
- Assert.assertTrue(methodExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils",
- "showBookmarkManagerOnPhone", false, null));
+ Assert.assertTrue(
+ methodExists(
+ "org/chromium/chrome/browser/download/MimeUtils",
+ "canAutoOpenMimeType",
+ false,
+ null));
+ Assert.assertTrue(
+ methodExists(
+ "org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils",
+ "addOrEditBookmark",
+ false,
+ null));
+ Assert.assertTrue(
+ methodExists(
+ "org/chromium/chrome/browser/bookmarks/BookmarkUtils",
+ "addOrEditBookmark",
+ false,
+ null));
+ Assert.assertTrue(
+ methodExists(
+ "org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils",
+ "showBookmarkManagerOnPhone",
+ false,
+ null));
+ Assert.assertTrue(
+ methodExists(
+ "org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils",
+ "isSpecialFolder",
+ false,
+ null));
Assert.assertTrue(
methodExists(
"org/chromium/chrome/browser/bookmarks/BookmarkUtils",
@@ -676,14 +701,25 @@ public void testMethodsForInvocationExist() throws Exception {
@Test
@SmallTest
public void testConstructorsExistAndMatch() throws Exception {
- Assert.assertTrue(constructorsMatch(
- "org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate",
- "org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate",
- Context.class, ActivityTabProvider.class, MultiWindowModeStateDispatcher.class,
- TabModelSelector.class, ToolbarManager.class, View.class, AppMenuDelegate.class,
- OneshotSupplier.class, OneshotSupplier.class, ObservableSupplier.class,
- WebFeedSnackbarController.FeedLauncher.class, ModalDialogManager.class,
- SnackbarManager.class, OneshotSupplier.class, Supplier.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate",
+ "org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate",
+ Context.class,
+ ActivityTabProvider.class,
+ MultiWindowModeStateDispatcher.class,
+ TabModelSelector.class,
+ ToolbarManager.class,
+ View.class,
+ AppMenuDelegate.class,
+ OneshotSupplier.class,
+ OneshotSupplier.class,
+ ObservableSupplier.class,
+ WebFeedSnackbarController.FeedLauncher.class,
+ ModalDialogManager.class,
+ SnackbarManager.class,
+ OneshotSupplier.class,
+ Supplier.class));
Assert.assertTrue(
constructorsMatch(
"org/chromium/chrome/browser/tabmodel/ChromeTabCreator",
@@ -691,8 +727,9 @@ public void testConstructorsExistAndMatch() throws Exception {
Activity.class,
WindowAndroid.class,
Supplier.class,
+ OneshotSupplier.class,
boolean.class,
- OverviewNTPCreator.class,
+ OverviewNtpCreator.class,
AsyncTabParamsManager.class,
Supplier.class,
Supplier.class,
@@ -741,18 +778,27 @@ public void testConstructorsExistAndMatch() throws Exception {
"org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate",
"org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate",
Context.class, Profile.class));
- Assert.assertTrue(constructorsMatch(
- "org/chromium/components/browser_ui/notifications/NotificationManagerProxyImpl",
- "org/chromium/chrome/browser/notifications/BraveNotificationManagerProxyImpl",
- Context.class));
Assert.assertTrue(
- constructorsMatch("org/chromium/chrome/browser/omnibox/status/StatusMediator",
+ constructorsMatch(
+ "org/chromium/components/browser_ui/notifications/NotificationManagerProxyImpl",
+ "org/chromium/chrome/browser/notifications/BraveNotificationManagerProxyImpl",
+ Context.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/omnibox/status/StatusMediator",
"org/chromium/chrome/browser/omnibox/status/BraveStatusMediator",
- PropertyModel.class, Resources.class, Context.class,
- UrlBarEditingTextStateProvider.class, boolean.class,
- LocationBarDataProvider.class, PermissionDialogController.class,
- SearchEngineLogoUtils.class, OneshotSupplier.class, Supplier.class,
- PageInfoIPHController.class, WindowAndroid.class, Supplier.class));
+ PropertyModel.class,
+ Resources.class,
+ Context.class,
+ UrlBarEditingTextStateProvider.class,
+ boolean.class,
+ LocationBarDataProvider.class,
+ PermissionDialogController.class,
+ OneshotSupplier.class,
+ Supplier.class,
+ PageInfoIPHController.class,
+ WindowAndroid.class,
+ Supplier.class));
Assert.assertTrue(
constructorsMatch(
"org/chromium/chrome/browser/ntp/NewTabPage",
@@ -774,7 +820,6 @@ public void testConstructorsExistAndMatch() throws Exception {
WindowAndroid.class,
JankTracker.class,
Supplier.class,
- SettingsLauncher.class,
HomeSurfaceTracker.class,
ObservableSupplier.class));
Assert.assertTrue(constructorsMatch(
@@ -833,7 +878,8 @@ public void testConstructorsExistAndMatch() throws Exception {
int.class,
FeedActionDelegate.class,
FeedOptionsCoordinator.class,
- UiConfig.class));
+ UiConfig.class,
+ Profile.class));
Assert.assertTrue(
constructorsMatch(
"org/chromium/chrome/browser/partnercustomizations/CustomizationProviderDelegateImpl",
@@ -870,42 +916,72 @@ public void testConstructorsExistAndMatch() throws Exception {
"org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListManager",
ModelList.class,
Context.class));
- Assert.assertTrue(constructorsMatch(
- "org/chromium/chrome/browser/omnibox/LocationBarCoordinator",
- "org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator", View.class,
- View.class, ObservableSupplier.class,
- BraveLocationBarMediator.getPrivacyPreferencesManagerClass(),
- LocationBarDataProvider.class, ActionMode.Callback.class, WindowDelegate.class,
- WindowAndroid.class, Supplier.class, Supplier.class, Supplier.class,
- IncognitoStateProvider.class, ActivityLifecycleDispatcher.class,
- OverrideUrlLoadingDelegate.class, BackKeyBehaviorDelegate.class,
- SearchEngineLogoUtils.class, PageInfoAction.class, Callback.class,
- BraveLocationBarMediator.getSaveOfflineButtonStateClass(),
- BraveLocationBarMediator.getOmniboxUmaClass(), Supplier.class, BookmarkState.class,
- BooleanSupplier.class, Supplier.class, OmniboxActionDelegate.class,
- BrowserStateBrowserControlsVisibilityDelegate.class, Callback.class,
- BackPressManager.class, OmniboxSuggestionsDropdownScrollListener.class,
- OpenHistoryClustersDelegate.class, ObservableSupplier.class));
- Assert.assertTrue(constructorsMatch(
- "org/chromium/chrome/browser/omnibox/LocationBarMediator",
- "org/chromium/chrome/browser/omnibox/BraveLocationBarMediator", Context.class,
- LocationBarLayout.class, LocationBarDataProvider.class, ObservableSupplier.class,
- BraveLocationBarMediator.getPrivacyPreferencesManagerClass(),
- OverrideUrlLoadingDelegate.class, BraveLocationBarMediator.getLocaleManagerClass(),
- OneshotSupplier.class, BackKeyBehaviorDelegate.class, WindowAndroid.class,
- boolean.class, SearchEngineLogoUtils.class,
- BraveLocationBarMediator.getLensControllerClass(),
- BraveLocationBarMediator.getSaveOfflineButtonStateClass(),
- BraveLocationBarMediator.getOmniboxUmaClass(), BooleanSupplier.class,
- BraveLocationBarMediator.getOmniboxSuggestionsDropdownEmbedderImplClass(),
- ObservableSupplier.class));
- Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/AppHooksImpl",
- "org/chromium/chrome/browser/BraveAppHooks"));
- Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/flags/CachedFlag",
- "org/chromium/chrome/browser/flags/BraveCachedFlag", String.class, boolean.class));
- Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/flags/CachedFlag",
- "org/chromium/chrome/browser/flags/BraveCachedFlag", String.class, String.class,
- boolean.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/omnibox/LocationBarCoordinator",
+ "org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator",
+ View.class,
+ View.class,
+ ObservableSupplier.class,
+ BraveLocationBarMediator.getPrivacyPreferencesManagerClass(),
+ LocationBarDataProvider.class,
+ ActionMode.Callback.class,
+ WindowDelegate.class,
+ WindowAndroid.class,
+ Supplier.class,
+ Supplier.class,
+ Supplier.class,
+ IncognitoStateProvider.class,
+ ActivityLifecycleDispatcher.class,
+ OverrideUrlLoadingDelegate.class,
+ BackKeyBehaviorDelegate.class,
+ PageInfoAction.class,
+ Callback.class,
+ BraveLocationBarMediator.getSaveOfflineButtonStateClass(),
+ BraveLocationBarMediator.getOmniboxUmaClass(),
+ Supplier.class,
+ BookmarkState.class,
+ BooleanSupplier.class,
+ Supplier.class,
+ OmniboxActionDelegate.class,
+ BrowserStateBrowserControlsVisibilityDelegate.class,
+ Callback.class,
+ BackPressManager.class,
+ OmniboxSuggestionsDropdownScrollListener.class,
+ OpenHistoryClustersDelegate.class,
+ ObservableSupplier.class,
+ boolean.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/omnibox/LocationBarMediator",
+ "org/chromium/chrome/browser/omnibox/BraveLocationBarMediator",
+ Context.class,
+ LocationBarLayout.class,
+ LocationBarDataProvider.class,
+ ObservableSupplier.class,
+ BraveLocationBarMediator.getPrivacyPreferencesManagerClass(),
+ OverrideUrlLoadingDelegate.class,
+ BraveLocationBarMediator.getLocaleManagerClass(),
+ OneshotSupplier.class,
+ BackKeyBehaviorDelegate.class,
+ WindowAndroid.class,
+ boolean.class,
+ BraveLocationBarMediator.getLensControllerClass(),
+ BraveLocationBarMediator.getSaveOfflineButtonStateClass(),
+ BraveLocationBarMediator.getOmniboxUmaClass(),
+ BooleanSupplier.class,
+ BraveLocationBarMediator.getOmniboxSuggestionsDropdownEmbedderImplClass(),
+ ObservableSupplier.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/AppHooksImpl",
+ "org/chromium/chrome/browser/BraveAppHooks"));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/flags/CachedFlag",
+ "org/chromium/chrome/browser/flags/BraveCachedFlag",
+ String.class,
+ boolean.class));
Assert.assertTrue(
constructorsMatch(
@@ -974,7 +1050,8 @@ public void testConstructorsExistAndMatch() throws Exception {
OneshotSupplier.class,
boolean.class,
BackPressManager.class,
- Bundle.class));
+ Bundle.class,
+ MultiInstanceManager.class));
Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/bookmarks/BookmarkToolbar",
"org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbar", Context.class,
AttributeSet.class));
@@ -1034,6 +1111,11 @@ public void testConstructorsExistAndMatch() throws Exception {
Context.class,
ActivityLifecycleDispatcher.class,
ObservableSupplier.class));
+ Assert.assertTrue(
+ constructorsMatch(
+ "org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs",
+ "org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs",
+ SharedPreferencesManager.class));
}
@Test
@@ -1120,8 +1202,6 @@ public void testFieldsExist() throws Exception {
"org/chromium/chrome/browser/toolbar/ToolbarManager", "mTabModelSelector"));
Assert.assertTrue(fieldExists(
"org/chromium/chrome/browser/toolbar/ToolbarManager", "mIncognitoStateProvider"));
- Assert.assertTrue(fieldExists(
- "org/chromium/chrome/browser/toolbar/ToolbarManager", "mTabCountProvider"));
Assert.assertTrue(
fieldExists("org/chromium/chrome/browser/toolbar/ToolbarManager", "mTabGroupUi"));
Assert.assertTrue(fieldExists(
@@ -1320,10 +1400,6 @@ public void testSuperNames() throws Exception {
"org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings"));
Assert.assertTrue(checkSuperName("org/chromium/components/browser_ui/site_settings/Website",
"org/chromium/components/browser_ui/site_settings/BraveWebsite"));
- Assert.assertTrue(
- checkSuperName(
- "org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference",
- "org/chromium/components/browser_ui/site_settings/BraveFourStateCookieSettingsPreferenceBase"));
Assert.assertTrue(
checkSuperName(
"org/chromium/components/browser_ui/site_settings/SiteSettings",
diff --git a/app/BUILD.gn b/app/BUILD.gn
index 647ef6fd80e1..a33a7ffe643f 100644
--- a/app/BUILD.gn
+++ b/app/BUILD.gn
@@ -103,7 +103,7 @@ source_set("browser_tests") {
"//chrome/browser/ui",
"//chrome/common:chrome_features",
"//chrome/common:non_code_constants",
- "//chrome/common/companion/visual_search:flags",
+ "//chrome/common/companion/visual_query:flags",
"//chrome/test",
"//chrome/test:test_support",
"//chrome/test:test_support_ui",
@@ -117,6 +117,7 @@ source_set("browser_tests") {
"//components/history_clusters/core",
"//components/language/core/common",
"//components/lens",
+ "//components/metrics/structured:structured_metrics_features",
"//components/network_time",
"//components/omnibox/browser",
"//components/optimization_guide/core",
@@ -136,6 +137,7 @@ source_set("browser_tests") {
"//extensions/common",
"//services/device/public/cpp:device_features",
"//testing/gtest",
+ "//ui/accessibility:ax_base",
]
if (is_linux || is_win || is_mac) {
diff --git a/app/DEPS b/app/DEPS
index 59cadf9818bb..63f23c5e09e9 100644
--- a/app/DEPS
+++ b/app/DEPS
@@ -37,5 +37,6 @@ include_rules = [
"+third_party/blink/public/common",
"+third_party/blink/public/mojom",
"+third_party/blink/public/public_buildflags.h",
+ "+ui/accessibility/accessibility_features.h",
"+ui/base",
]
diff --git a/app/app_management_strings.grdp b/app/app_management_strings.grdp
index db33d8cafb20..ff510e3b47ec 100644
--- a/app/app_management_strings.grdp
+++ b/app/app_management_strings.grdp
@@ -154,6 +154,9 @@
Data stored in app: $1100 MB
+
+ App language
+
Manage permissions
diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc
index f1dde63deb5a..7717ac48c967 100644
--- a/app/brave_main_delegate_browsertest.cc
+++ b/app/brave_main_delegate_browsertest.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/signin/signin_features.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/companion/visual_search/features.h"
+#include "chrome/common/companion/visual_query/features.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "components/aggregation_service/features.h"
#include "components/attribution_reporting/features.h"
@@ -30,6 +30,7 @@
#include "components/history_clusters/core/on_device_clustering_features.h"
#include "components/language/core/common/language_experiments.h"
#include "components/lens/lens_features.h"
+#include "components/metrics/structured/structured_metrics_features.h"
#include "components/network_time/network_time_tracker.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
@@ -69,6 +70,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "components/translate/core/common/translate_util.h"
#include "extensions/common/extension_features.h"
+#include "ui/accessibility/accessibility_features.h"
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
@@ -109,210 +111,209 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, OriginTrialsTest) {
IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
// Please, keep alphabetized
const base::Feature* disabled_features[] = {
- &aggregation_service::kAggregationServiceMultipleCloudProviders,
+ &aggregation_service::kAggregationServiceMultipleCloudProviders,
#if BUILDFLAG(IS_ANDROID)
- &android_webview::features::kWebViewAppsPackageNamesServerSideAllowlist,
- &android_webview::features::kWebViewEnumerateDevicesCache,
- &android_webview::features::kWebViewServerSideSampling,
- &android_webview::features::kWebViewMeasureScreenCoverage,
+ &android_webview::features::kWebViewAppsPackageNamesServerSideAllowlist,
+ &android_webview::features::kWebViewEnumerateDevicesCache,
+ &android_webview::features::kWebViewServerSideSampling,
+ &android_webview::features::kWebViewMeasureScreenCoverage,
#endif
-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
- &apps::features::kDesktopPWAsLinkCapturing,
-#endif
- &attribution_reporting::features::kAttributionReportingTriggerConfig,
- &attribution_reporting::features::kConversionMeasurement,
- &autofill::features::kAutofillEnableRemadeDownstreamMetrics,
- &autofill::features::test::kAutofillServerCommunication,
- &autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains,
+ &attribution_reporting::features::kAttributionReportingTriggerConfig,
+ &attribution_reporting::features::kAttributionReportingTriggerContextId,
+ &attribution_reporting::features::kConversionMeasurement,
+ &autofill::features::kAutofillEnableRemadeDownstreamMetrics,
+ &autofill::features::test::kAutofillServerCommunication,
#if BUILDFLAG(IS_ANDROID)
- &base::features::kCollectAndroidFrameTimelineMetrics,
+ &base::features::kCollectAndroidFrameTimelineMetrics,
#endif
- &blink::features::kAdAuctionReportingWithMacroApi,
- &blink::features::kAdInterestGroupAPI,
- &blink::features::kAllowURNsInIframes,
- &blink::features::kAttributionReportingInBrowserMigration,
- &blink::features::kBackgroundResourceFetch,
- &blink::features::kBiddingAndScoringDebugReportingAPI,
- &blink::features::kBrowsingTopics,
- &blink::features::kBrowsingTopicsXHR,
- &blink::features::kClientHintsFormFactor,
- &blink::features::kClientHintsMetaEquivDelegateCH,
- &blink::features::kComputePressure,
- &blink::features::kCssSelectorFragmentAnchor,
- &blink::features::kEventTimingReportAllEarlyEntriesOnPaintedPresentation,
- &blink::features::kFencedFrames,
- &blink::features::kFledge,
- &blink::features::kFledgeBiddingAndAuctionServer,
- &blink::features::kFledgeConsiderKAnonymity,
- &blink::features::kFledgeEnforceKAnonymity,
- &blink::features::kInterestGroupStorage,
- &blink::features::kParakeet,
- &blink::features::kPrerender2,
- &blink::features::kPrivacySandboxAdsAPIs,
- &blink::features::kPrivateAggregationApi,
- &blink::features::kPrivateAggregationApiMultipleCloudProviders,
- &blink::features::kSharedStorageAPI,
- &blink::features::kSharedStorageAPIM118,
- &blink::features::kSharedStorageSelectURLLimit,
- &blink::features::kSpeculationRulesHeaderEnableThirdPartyOriginTrial,
- &blink::features::kSpeculationRulesPrefetchFuture,
- &blink::features::kSpeculationRulesPrefetchProxy,
- &blink::features::kTextFragmentAnchor,
- &blink::features::kWebEnvironmentIntegrity,
- &commerce::kCommerceAllowOnDemandBookmarkUpdates,
- &commerce::kCommerceDeveloper,
- &commerce::kCommerceMerchantViewer,
- &commerce::kCommercePriceTracking,
- &commerce::kShoppingList,
- &commerce::kShoppingPDPMetrics,
- &commerce::kRetailCoupons,
- &companion::features::internal::kCompanionEnabledByObservingExpsNavigations,
- &companion::features::internal::kSidePanelCompanion,
- &companion::features::internal::kSidePanelCompanion2,
- &companion::visual_search::features::kVisualSearchSuggestions,
- &content_settings::features::kTrackingProtection3pcd,
- &content_settings::features::kUserBypassUI,
- &enterprise_connectors::kLocalContentAnalysisEnabled,
+ &blink::features::kAdAuctionReportingWithMacroApi,
+ &blink::features::kAdInterestGroupAPI,
+ &blink::features::kAllowURNsInIframes,
+ &blink::features::kAttributionReportingInBrowserMigration,
+ &blink::features::kBackgroundResourceFetch,
+ &blink::features::kBiddingAndScoringDebugReportingAPI,
+ &blink::features::kBrowsingTopics,
+ &blink::features::kClientHintsFormFactor,
+ &blink::features::kClientHintsMetaEquivDelegateCH,
+ &blink::features::kComputePressure,
+ &blink::features::kCssSelectorFragmentAnchor,
+ &blink::features::kEventTimingReportAllEarlyEntriesOnPaintedPresentation,
+ &blink::features::kFencedFrames,
+ &blink::features::kFledge,
+ &blink::features::kFledgeBiddingAndAuctionServer,
+ &blink::features::kFledgeConsiderKAnonymity,
+ &blink::features::kFledgeEnforceKAnonymity,
+ &blink::features::kInterestGroupStorage,
+ &blink::features::kParakeet,
+ &blink::features::kPrerender2,
+ &blink::features::kPrivacySandboxAdsAPIs,
+ &blink::features::kPrivateAggregationApi,
+ &blink::features::kPrivateAggregationApiMultipleCloudProviders,
+ &blink::features::kSharedStorageAPI,
+ &blink::features::kSharedStorageAPIM118,
+ &blink::features::kSharedStorageSelectURLLimit,
+ &blink::features::kSpeculationRulesHeaderEnableThirdPartyOriginTrial,
+ &blink::features::kSpeculationRulesPrefetchFuture,
+ &blink::features::kTextFragmentAnchor,
+ &commerce::kCommerceAllowOnDemandBookmarkUpdates,
+ &commerce::kCommerceDeveloper,
+ &commerce::kCommerceMerchantViewer,
+ &commerce::kCommercePriceTracking,
+ &commerce::kShoppingList,
+ &commerce::kShoppingPDPMetrics,
+ &commerce::kRetailCoupons,
+ &companion::features::internal::
+ kCompanionEnabledByObservingExpsNavigations,
+ &companion::features::internal::kSidePanelCompanion,
+ &companion::features::internal::kSidePanelCompanion2,
+ &companion::visual_query::features::kVisualQuerySuggestions,
+ &content_settings::features::kTrackingProtection3pcd,
+ &content_settings::features::kUserBypassUI,
+ &enterprise_connectors::kLocalContentAnalysisEnabled,
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
- &enterprise_signals::features::kDeviceSignalsConsentDialog,
+ &enterprise_signals::features::kDeviceSignalsConsentDialog,
#endif
#if !BUILDFLAG(IS_ANDROID)
- &extensions_features::kExtensionsManifestV3Only,
+ &extensions_features::kExtensionsManifestV3Only,
#endif
#if BUILDFLAG(IS_WIN)
- &features::kAppBoundEncryptionMetrics,
+ &features::kAppBoundEncryptionMetrics,
#endif
- &features::kAttributionFencedFrameReportingBeacon,
- &features::kBookmarkTriggerForPrerender2,
- &features::kChromeLabs,
- &features::kChromeRefresh2023,
- &features::kCookieDeprecationFacilitatedTesting,
-#if !BUILDFLAG(IS_ANDROID)
- &features::kCopyLinkToText,
+ &features::kAttributionFencedFrameReportingBeacon,
+ &features::kBookmarkTriggerForPrerender2,
+ &features::kChromeLabs,
+ &features::kChromeRefresh2023,
+ &features::kCookieDeprecationFacilitatedTesting,
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+ &features::kDesktopPWAsLinkCapturing,
#endif
- &features::kDigitalGoodsApi,
- &features::kDIPS,
- &features::kFedCm,
- &features::kFedCmWithoutThirdPartyCookies,
- &features::kFirstPartySets,
+ &features::kDigitalGoodsApi,
+ &features::kDIPS,
+ &features::kFedCm,
+ &features::kFedCmWithoutThirdPartyCookies,
+ &features::kFirstPartySets,
#if !BUILDFLAG(IS_ANDROID)
- &features::kHaTSWebUI,
+ &features::kHaTSWebUI,
#endif
- &features::kIdleDetection,
- &features::kKAnonymityService,
- &features::kKAnonymityServiceOHTTPRequests,
- &features::kLegacyTechReportEnableCookieIssueReports,
- &features::kLegacyTechReportTopLevelUrl,
- &features::kNotificationTriggers,
- &features::kOmniboxTriggerForNoStatePrefetch,
- &features::kOmniboxTriggerForPrerender2,
- &features::kPerformanceSettingsPreloadingSubpage,
- &features::kPrivacyGuide3,
+ &features::kIdleDetection,
+ &features::kKAnonymityService,
+ &features::kKAnonymityServiceOHTTPRequests,
+ &features::kLegacyTechReportEnableCookieIssueReports,
+ &features::kLegacyTechReportTopLevelUrl,
+ &features::kNotificationTriggers,
+ &features::kOmniboxTriggerForNoStatePrefetch,
+ &features::kOmniboxTriggerForPrerender2,
+ &features::kPerformanceSettingsPreloadingSubpage,
+ &features::kPrivacyGuide3,
#if BUILDFLAG(IS_ANDROID)
- &features::kPrivacyGuideAndroidPostMVP,
+ &features::kPrivacyGuideAndroidPostMVP,
#endif
- &features::kPrivacyGuidePreload,
+ &features::kPrivacyGuidePreload,
#if BUILDFLAG(IS_ANDROID)
- &features::kPrivacyGuidePreloadAndroid,
+ &features::kPrivacyGuidePreloadAndroid,
+#endif
+ &features::kPrivacySandboxAdsAPIsOverride,
+#if !BUILDFLAG(IS_ANDROID)
+ &features::kReadAnything,
#endif
- &features::kPrivacySandboxAdsAPIsOverride,
- &features::kResourceTimingForCancelledNavigationInFrame,
- &features::kSCTAuditing,
- &features::kServiceWorkerAutoPreload,
- &features::kSignedExchangeReportingForDistributors,
- &features::kSignedHTTPExchange,
- &features::kSupportSearchSuggestionForPrerender2,
- &features::kTabHoverCardImages,
+ &features::kResourceTimingForCancelledNavigationInFrame,
+ &features::kSCTAuditing,
+ &features::kServiceWorkerAutoPreload,
+ &features::kSignedExchangeReportingForDistributors,
+ &features::kSignedHTTPExchange,
+ &features::kSupportSearchSuggestionForPrerender2,
+ &features::kTabHoverCardImages,
#if !BUILDFLAG(IS_ANDROID)
- &features::kTrustSafetySentimentSurvey,
- &features::kTrustSafetySentimentSurveyV2,
+ &features::kTrustSafetySentimentSurvey,
+ &features::kTrustSafetySentimentSurveyV2,
#endif
#if BUILDFLAG(IS_MAC)
- &features::kUseChromiumUpdater,
+ &features::kUseChromiumUpdater,
#endif
- &features::kWebOTP,
- &history::kOrganicRepeatableQueries,
- &history::kSyncSegmentsData,
- &history_clusters::kRenameJourneys,
- &history_clusters::kSidePanelJourneys,
- &history_clusters::features::kOnDeviceClustering,
- &history_clusters::features::kOnDeviceClusteringKeywordFiltering,
- &history_clusters::internal::kHistoryClustersInternalsPage,
- &history_clusters::internal::kHistoryClustersNavigationContextClustering,
- &history_clusters::internal::kJourneys,
- &history_clusters::internal::kJourneysImages,
- &history_clusters::internal::kJourneysNamedNewTabGroups,
- &history_clusters::internal::kJourneysPersistCachesToPrefs,
- &history_clusters::internal::kJourneysZeroStateFiltering,
- &history_clusters::internal::kOmniboxAction,
- &history_clusters::internal::kOmniboxHistoryClusterProvider,
- &history_clusters::internal::kPersistedClusters,
- &history_clusters::internal::kPersistContextAnnotationsInHistoryDb,
+ &features::kWebOTP,
+ &history::kOrganicRepeatableQueries,
+ &history::kSyncSegmentsData,
+ &history_clusters::kRenameJourneys,
+ &history_clusters::kSidePanelJourneys,
+ &history_clusters::features::kOnDeviceClustering,
+ &history_clusters::features::kOnDeviceClusteringKeywordFiltering,
+ &history_clusters::internal::kHistoryClustersInternalsPage,
+ &history_clusters::internal::kHistoryClustersNavigationContextClustering,
+ &history_clusters::internal::kJourneys,
+ &history_clusters::internal::kJourneysImages,
+ &history_clusters::internal::kJourneysNamedNewTabGroups,
+ &history_clusters::internal::kJourneysPersistCachesToPrefs,
+ &history_clusters::internal::kJourneysZeroStateFiltering,
+ &history_clusters::internal::kOmniboxAction,
+ &history_clusters::internal::kOmniboxHistoryClusterProvider,
+ &history_clusters::internal::kPersistedClusters,
+ &history_clusters::internal::kPersistContextAnnotationsInHistoryDb,
#if !BUILDFLAG(IS_ANDROID)
- &kForYouFre,
+ &kForYouFre,
#endif
#if BUILDFLAG(ENABLE_MIRROR)
- &kVerifyRequestInitiatorForMirrorHeaders,
+ &kVerifyRequestInitiatorForMirrorHeaders,
#endif
- &lens::features::kEnableLensPing,
- &lens::features::kLensStandalone,
- &media::kLiveCaption,
- &net::features::kEnableWebTransportDraft07,
- &net::features::kPartitionedCookies,
- &net::features::kThirdPartyPartitionedStorageAllowedByDefault,
- &net::features::kThirdPartyStoragePartitioning,
- &net::features::kTpcdMetadataGrants,
- &net::features::kWaitForFirstPartySetsInit,
- &network::features::kFledgePst,
- &network::features::kPrivateStateTokens,
- &network_time::kNetworkTimeServiceQuerying,
- &ntp_features::kCustomizeChromeSidePanelExtensionsCard,
- &ntp_features::kCustomizeChromeWallpaperSearch,
- &ntp_features::kNtpAlphaBackgroundCollections,
- &ntp_features::kNtpBackgroundImageErrorDetection,
- &ntp_features::kNtpChromeCartModule,
- &ntp_features::kNtpHistoryClustersModule,
- &ntp_features::kNtpHistoryClustersModuleDiscounts,
- &ntp_features::kNtpHistoryClustersModuleLoad,
- &omnibox::kDocumentProviderNoSetting,
- &omnibox::kDocumentProviderNoSyncRequirement,
- &omnibox::kExpandedStateHeight,
- &omnibox::kExpandedStateShape,
- &omnibox::kOmniboxSteadyStateHeight,
- &omnibox::kRichAutocompletion,
- &optimization_guide::features::kOptimizationGuideFetchingForSRP,
- &optimization_guide::features::kOptimizationHints,
- &optimization_guide::features::kRemoteOptimizationGuideFetching,
- &optimization_guide::features::
- kRemoteOptimizationGuideFetchingAnonymousDataConsent,
- &optimization_guide::features::kTextEmbeddingPageContentAnnotations,
- &page_image_service::kImageService,
- &page_image_service::kImageServiceSuggestPoweredImages,
+ &lens::features::kEnableLensPing,
+ &lens::features::kLensStandalone,
+ &media::kLiveCaption,
+ &metrics::structured::kEnabledStructuredMetricsService,
+ &metrics::structured::kNearbyShareMetrics,
+ &metrics::structured::kPhoneHubStructuredMetrics,
+ &net::features::kEnableWebTransportDraft07,
+ &net::features::kPartitionedCookies,
+ &net::features::kThirdPartyPartitionedStorageAllowedByDefault,
+ &net::features::kThirdPartyStoragePartitioning,
+ &net::features::kTpcdMetadataGrants,
+ &net::features::kWaitForFirstPartySetsInit,
+ &network::features::kFledgePst,
+ &network::features::kPrivateStateTokens,
+ &network_time::kNetworkTimeServiceQuerying,
+ &ntp_features::kCustomizeChromeSidePanelExtensionsCard,
+ &ntp_features::kCustomizeChromeWallpaperSearch,
+ &ntp_features::kNtpAlphaBackgroundCollections,
+ &ntp_features::kNtpBackgroundImageErrorDetection,
+ &ntp_features::kNtpChromeCartModule,
+ &ntp_features::kNtpHistoryClustersModule,
+ &ntp_features::kNtpHistoryClustersModuleDiscounts,
+ &ntp_features::kNtpHistoryClustersModuleLoad,
+ &omnibox::kDocumentProviderNoSetting,
+ &omnibox::kDocumentProviderNoSyncRequirement,
+ &omnibox::kExpandedStateHeight,
+ &omnibox::kExpandedStateShape,
+ &omnibox::kOmniboxSteadyStateHeight,
+ &omnibox::kRichAutocompletion,
+ &optimization_guide::features::kOptimizationGuideFetchingForSRP,
+ &optimization_guide::features::kOptimizationHints,
+ &optimization_guide::features::kRemoteOptimizationGuideFetching,
+ &optimization_guide::features::
+ kRemoteOptimizationGuideFetchingAnonymousDataConsent,
+ &optimization_guide::features::kTextEmbeddingPageContentAnnotations,
+ &page_image_service::kImageService,
+ &page_image_service::kImageServiceSuggestPoweredImages,
#if !BUILDFLAG(IS_ANDROID)
- &permissions::features::kPermissionsPromptSurvey,
- &permissions::features::kRecordPermissionExpirationTimestamps,
+ &permissions::features::kPermissionsPromptSurvey,
#endif
- &permissions::features::kPermissionOnDeviceNotificationPredictions,
- &permissions::features::kPermissionStorageAccessAPI,
- &permissions::features::kShowRelatedWebsiteSetsPermissionGrants,
- &privacy_sandbox::kEnforcePrivacySandboxAttestations,
- &privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting,
- &privacy_sandbox::kPrivacySandboxFirstPartySetsUI,
- &privacy_sandbox::kPrivacySandboxProactiveTopicsBlocking,
- &privacy_sandbox::kPrivacySandboxSettings3,
- &privacy_sandbox::kPrivacySandboxSettings4,
- &promos_features::kIOSPromoPasswordBubble,
- &safe_browsing::kExtensionTelemetryDisableOffstoreExtensions,
- &safe_browsing::kExtensionTelemetryTabsApiSignal,
- &segmentation_platform::features::kSegmentationPlatformCollectTabRankData,
- &segmentation_platform::features::kSegmentationPlatformDeviceTier,
- &segmentation_platform::features::kSegmentationPlatformFeature,
- &segmentation_platform::features::kSegmentationPlatformTimeDelaySampling,
- &shared_highlighting::kIOSSharedHighlightingV2,
- &shared_highlighting::kSharedHighlightingManager,
- &subresource_filter::kAdTagging,
+ &permissions::features::kPermissionOnDeviceNotificationPredictions,
+ &permissions::features::kPermissionStorageAccessAPI,
+ &permissions::features::kShowRelatedWebsiteSetsPermissionGrants,
+ &privacy_sandbox::kEnforcePrivacySandboxAttestations,
+ &privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting,
+ &privacy_sandbox::kPrivacySandboxFirstPartySetsUI,
+ &privacy_sandbox::kPrivacySandboxProactiveTopicsBlocking,
+ &privacy_sandbox::kPrivacySandboxSettings4,
+ &promos_features::kIOSPromoPasswordBubble,
+ &safe_browsing::kExtensionTelemetryDisableOffstoreExtensions,
+ &safe_browsing::kExtensionTelemetryTabsApiSignal,
+ &segmentation_platform::features::kSegmentationPlatformCollectTabRankData,
+ &segmentation_platform::features::kSegmentationPlatformDeviceTier,
+ &segmentation_platform::features::kSegmentationPlatformFeature,
+ &segmentation_platform::features::kSegmentationPlatformTimeDelaySampling,
+ &shared_highlighting::kIOSSharedHighlightingV2,
+ &shared_highlighting::kSharedHighlightingManager,
+ &subresource_filter::kAdTagging,
#if !BUILDFLAG(IS_ANDROID)
- &translate::kTFLiteLanguageDetectionEnabled,
+ &translate::kTFLiteLanguageDetectionEnabled,
#endif
};
@@ -332,8 +333,6 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, EnabledFeatures) {
&features::kWinrtGeolocationImplementation,
#endif
#if !BUILDFLAG(IS_ANDROID)
- &safe_browsing::kDownloadBubble,
- &safe_browsing::kDownloadBubbleV2,
&sharing_hub::kDesktopScreenshots,
#endif
&media::kEnableTabMuting,
diff --git a/app/brave_strings.grd b/app/brave_strings.grd
index 2f3fc81af82e..2a7d5c5c4a42 100644
--- a/app/brave_strings.grd
+++ b/app/brave_strings.grd
@@ -350,9 +350,18 @@ If you update this file, be sure also to update google_chrome_strings.grd. -->