networkInfos) {
if (networkInfos == null) return Collections.emptyList();
return networkInfos.stream()
diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java
index b0feb255cb9b..9bf69f0d149a 100644
--- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java
+++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java
@@ -72,6 +72,7 @@ public enum TokenType {
*
* See `refreshVisibleTokenInfo` in components/brave_wallet_ui/common/async/lib.ts.
*/
+ @SuppressWarnings("NoStreams")
private static BlockchainToken[] filterTokens(
NetworkInfo selectedNetwork,
BlockchainToken[] tokens,
diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java
index f2ea9a5bbbae..076a72b18cc0 100644
--- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java
+++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java
@@ -80,7 +80,7 @@
import org.chromium.chrome.browser.profiles.ProfileManager;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.util.TabUtils;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import org.chromium.ui.widget.Toast;
import java.io.InputStream;
@@ -1052,6 +1052,7 @@ public static AccountInfo findAccount(AccountInfo[] accounts, AccountId accountI
return null;
}
+ @SuppressWarnings("NoStreams")
public static List filterAccountsByCoin(
AccountInfo[] accounts, @CoinType.EnumType int coinType) {
return Arrays.stream(accounts)
@@ -1146,9 +1147,8 @@ public static SpannableString createSpanForSurroundedPhrase(
SpannableString spannable = new SpannableString(AndroidUtils.formatHTML(htmlString));
URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class);
for (URLSpan urlSpan : spans) {
- NoUnderlineClickableSpan linkSpan =
- new NoUnderlineClickableSpan(
- context, R.color.brave_link, onClickListener::onClick);
+ ChromeClickableSpan linkSpan =
+ new ChromeClickableSpan(context, R.color.brave_link, onClickListener::onClick);
int spanStart = spannable.getSpanStart(urlSpan);
int spanEnd = spannable.getSpanEnd(urlSpan);
spannable.setSpan(linkSpan, spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java
index 941ff619abcc..d051ba158a55 100644
--- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java
+++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java
@@ -55,6 +55,7 @@ public static String timeDeltaToDateString(TimeDelta timeDelta) {
return dateFormat.format(new Date(timeDelta.microseconds / 1000));
}
+ @SuppressWarnings("NoStreams")
public static String generateUniqueAccountName(
@CoinType.EnumType int coinType, AccountInfo[] accountInfos) {
Context context = ContextUtils.getApplicationContext();
diff --git a/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java b/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java
index f9de969b59ef..c1732629608c 100644
--- a/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java
+++ b/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java
@@ -8,7 +8,6 @@
import android.content.Context;
import android.graphics.RectF;
-import android.os.Build;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
@@ -59,26 +58,8 @@ public static int tooltipGravityToArrowDirection(int tooltipGravity) {
}
}
- private static ViewGroup.MarginLayoutParams getOrCreateMarginLayoutParams(View view) {
- ViewGroup.LayoutParams lp = view.getLayoutParams();
- if (lp != null) {
- if (lp instanceof ViewGroup.MarginLayoutParams) {
- return (ViewGroup.MarginLayoutParams) lp;
- } else {
- return new ViewGroup.MarginLayoutParams(lp);
- }
- } else {
- return new ViewGroup.MarginLayoutParams(view.getWidth(), view.getHeight());
- }
- }
-
public static int getColor(Context context, @ColorRes int colorRes) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- return context.getColor(colorRes);
- } else {
- // noinspection deprecation
- return context.getColor(colorRes);
- }
+ return context.getColor(colorRes);
}
public static ViewGroup findFrameLayout(View anchorView) {
diff --git a/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java b/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java
index 1c9e4fd1620f..3d05cd1f2130 100644
--- a/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java
+++ b/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java
@@ -7,6 +7,8 @@
import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.browser.profiles.ProfileProvider;
+import org.chromium.chrome.browser.signin.AppRestrictionSupplier;
+import org.chromium.chrome.browser.signin.ChildAccountStatusSupplier;
import org.chromium.components.signin.AccountManagerFacadeProvider;
public abstract class BraveFirstRunFlowSequencer extends FirstRunFlowSequencer {
@@ -15,7 +17,7 @@ public BraveFirstRunFlowSequencer(OneshotSupplier profileSuppli
profileSupplier,
new ChildAccountStatusSupplier(
AccountManagerFacadeProvider.getInstance(),
- FirstRunAppRestrictionInfo.takeMaybeInitialized()));
+ AppRestrictionSupplier.takeMaybeInitialized()));
}
@Override
diff --git a/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java b/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java
index 19473b491ed2..2adc1877cf33 100644
--- a/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java
+++ b/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java
@@ -238,10 +238,6 @@ private void onClickViews() {
}
}
- private boolean shouldForceDefaultBrowserPrompt() {
- return !isDefaultBrowser();
- }
-
private void setDefaultBrowserAndProceedToNextStep() {
BraveSetDefaultBrowserUtils.setDefaultBrowser(this);
if (!BraveSetDefaultBrowserUtils.supportsDefaultRoleManager()) {
@@ -288,7 +284,7 @@ private void nextOnboardingStep() {
FirstRunUtils.setEulaAccepted();
finish();
- sendFirstRunCompletePendingIntent();
+ sendFirstRunCompleteIntent();
}
}
diff --git a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java
index 07dbf8181f7b..6b0817ed41bf 100644
--- a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java
+++ b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java
@@ -255,32 +255,6 @@ public long insertStats(BraveStatsTable braveStat) {
// return -1;
}
- private boolean isAdsTrackerAlreadyAdded(BraveStatsTable braveStat) {
- String sql =
- "SELECT * FROM "
- + BraveStatsTable.TABLE_NAME
- + " WHERE "
- + BraveStatsTable.COLUMN_STAT_SITE
- + " = '"
- + braveStat.getStatSite()
- + "'"
- + " AND "
- + BraveStatsTable.COLUMN_URL
- + " = '"
- + braveStat.getUrl()
- + "'";
-
- Log.e("NTP", sql);
-
- SQLiteDatabase db = this.getReadableDatabase();
- Cursor cursor = db.rawQuery(sql, null);
-
- int count = cursor.getCount();
- cursor.close();
-
- return count > 0;
- }
-
@SuppressLint("Range")
public List getAllStats() {
List braveStats = new ArrayList<>();
diff --git a/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java b/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java
index 3de09bd891b2..bcd23e3c2cd0 100644
--- a/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java
+++ b/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java
@@ -58,8 +58,7 @@ BRAVE_ONBOARDING_NOTIFICATION_TAG, getNotificationUrl(),
public static void showOnboardingNotification() {
Context context = ContextUtils.getApplicationContext();
if (context == null) return;
- NotificationManagerProxyImpl notificationManager =
- new NotificationManagerProxyImpl(context);
+ NotificationManagerProxyImpl notificationManager = new NotificationManagerProxyImpl();
NotificationBuilderBase notificationBuilder =
new BraveNotificationBuilder(context)
@@ -129,10 +128,9 @@ private static String getNotificationUrl() {
}
}
- public static void cancelOnboardingNotification(Context context) {
- NotificationManagerProxyImpl notificationManager =
- new NotificationManagerProxyImpl(context);
+ public static void cancelOnboardingNotification() {
+ NotificationManagerProxyImpl notificationManager = new NotificationManagerProxyImpl();
notificationManager.cancel(
- BRAVE_ONBOARDING_NOTIFICATION_TAG, BRAVE_ONBOARDING_NOTIFICATION_ID);
+ BRAVE_ONBOARDING_NOTIFICATION_TAG, BRAVE_ONBOARDING_NOTIFICATION_ID);
}
}
diff --git a/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java b/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java
index e23628f9018b..308f01d8f85f 100644
--- a/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java
+++ b/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java
@@ -24,10 +24,4 @@ public BraveNotificationPermissionRationaleDialogController(
/** This is empty override method, to block default android 13 chromium dialog */
@Override
public void showRationaleUi(Callback rationaleCallback) {}
-
- @SuppressWarnings("UnusedVariable")
- private Callback wrapDialogDismissalCallback(Callback rationaleCallback) {
- assert false : "wrapDialogDismissalCallback should be redirected to parent in bytecode!";
- return null;
- }
}
diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java
index 80dc8feb20c3..feb346a336a6 100644
--- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java
+++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java
@@ -37,7 +37,6 @@
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
import org.chromium.components.search_engines.TemplateUrlService;
import org.chromium.ui.base.WindowAndroid;
-import org.chromium.ui.modaldialog.ModalDialogManager;
public class BraveNewTabPage extends NewTabPage {
private JankTracker mJankTracker;
@@ -57,7 +56,6 @@ public BraveNewTabPage(
Activity activity,
BrowserControlsStateProvider browserControlsStateProvider,
Supplier activityTabProvider,
- ModalDialogManager modalDialogManager,
SnackbarManager snackbarManager,
ActivityLifecycleDispatcher lifecycleDispatcher,
TabModelSelector tabModelSelector,
@@ -81,7 +79,6 @@ public BraveNewTabPage(
activity,
browserControlsStateProvider,
activityTabProvider,
- modalDialogManager,
snackbarManager,
lifecycleDispatcher,
tabModelSelector,
diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
index c791ae2fab70..3f7775fa5955 100644
--- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
+++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
@@ -1485,22 +1485,6 @@ private void initBraveNewsController() {
}
}
- private int getMaxRowsForMostVisitedTiles() {
- try {
- if (!ProfileManager.isInitialized()
- || !UserPrefs.get(BraveActivity.getBraveActivity().getCurrentProfile())
- .getBoolean(BravePref.NEW_TAB_PAGE_SHOW_BACKGROUND_IMAGE)) {
- return 2;
- } else {
- return 1;
- }
- } catch (BraveActivity.BraveActivityNotFoundException e) {
- Log.e(TAG, "getMaxRowsForMostVisitedTiles ", e);
- }
-
- return 2;
- }
-
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mIsTablet) {
diff --git a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java
index cc88b8c6c4d5..257a0d91e5a8 100644
--- a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java
+++ b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java
@@ -11,20 +11,13 @@
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
-import android.text.SpannableString;
-import android.text.Spanned;
-import android.text.style.ForegroundColorSpan;
import android.view.View;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
-import org.chromium.chrome.R;
-import org.chromium.chrome.browser.BraveRewardsHelper;
-import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge;
import org.chromium.chrome.browser.ntp_background_images.model.BackgroundImage;
import org.chromium.chrome.browser.ntp_background_images.model.NTPImage;
-import org.chromium.chrome.browser.ntp_background_images.model.SponsoredTab;
import org.chromium.chrome.browser.ntp_background_images.model.Wallpaper;
import org.chromium.chrome.browser.preferences.BravePref;
import org.chromium.chrome.browser.profiles.Profile;
@@ -47,61 +40,6 @@ public class NTPImageUtil {
public static HashMap> imageCache =
new HashMap>();
- // This function is not used, but removing it completely causes errors for unused resources:
- // The resource R.string.earn_tokens_for_viewing appears to be unused [UnusedResources]
- // The resource R.string.you_are_earning_tokens appears to be unused [UnusedResources]
- // This is related to rewards, so I keep it till review
- @SuppressWarnings("UnusedVariable")
- private static SpannableString getBannerText(
- ChromeActivity chromeActivity,
- int ntpType,
- View bannerLayout,
- SponsoredTab sponsoredTab,
- NewTabPageListener newTabPageListener) {
- String bannerText = "";
- if (ntpType == SponsoredImageUtil.BR_ON_ADS_ON) {
- bannerText =
- String.format(
- chromeActivity
- .getResources()
- .getString(R.string.you_are_earning_tokens),
- chromeActivity.getResources().getString(R.string.learn_more));
- } else if (ntpType == SponsoredImageUtil.BR_ON_ADS_OFF) {
- bannerText =
- String.format(
- chromeActivity
- .getResources()
- .getString(R.string.earn_tokens_for_viewing),
- chromeActivity.getResources().getString(R.string.learn_more));
- }
- int learnMoreIndex =
- bannerText.indexOf(chromeActivity.getResources().getString(R.string.learn_more));
- Spanned learnMoreSpanned = BraveRewardsHelper.spannedFromHtmlString(bannerText);
- SpannableString learnMoreTextSS = new SpannableString(learnMoreSpanned.toString());
-
- ForegroundColorSpan brOffForegroundSpan =
- new ForegroundColorSpan(chromeActivity.getColor(R.color.brave_theme_color));
- // setSpan gives us IndexOutOfBoundsException in case of end or start are > length and in
- // some other cases.
- int length = learnMoreTextSS.length();
- int endIndex = learnMoreIndex
- + chromeActivity.getResources().getString(R.string.learn_more).length();
- if (endIndex < learnMoreIndex || learnMoreIndex >= length || endIndex >= length
- || learnMoreIndex < 0 || endIndex < 0) {
- return learnMoreTextSS;
- }
- try {
- learnMoreTextSS.setSpan(brOffForegroundSpan, learnMoreIndex, endIndex,
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- } catch (IndexOutOfBoundsException e) {
- Log.e(TAG,
- "getBannerText: learnMoreIndex == " + learnMoreIndex
- + ", endIndex == " + endIndex + ". Error: " + e.getMessage());
- }
-
- return learnMoreTextSS;
- }
-
public static Bitmap getWallpaperBitmap(NTPImage ntpImage, int layoutWidth, int layoutHeight) {
Context mContext = ContextUtils.getApplicationContext();
diff --git a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java
index ab6073b5f469..8fa656d28a0d 100644
--- a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java
@@ -16,6 +16,7 @@
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.browser.back_press.BackPressManager;
+import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.merchant_viewer.MerchantTrustSignalsCoordinator;
@@ -89,7 +90,9 @@ public BraveLocationBarCoordinator(
LocationBarEmbedderUiOverrides uiOverrides,
@Nullable View baseChromeLayout,
Supplier bottomWindowPaddingSupplier,
- @Nullable OnLongClickListener onLongClickListener) {
+ @Nullable OnLongClickListener onLongClickListener,
+ @Nullable BrowserControlsStateProvider browserControlsStateProvider,
+ boolean isToolbarPositionCustomizationEnabled) {
super(
locationBarLayout,
autocompleteAnchorView,
@@ -122,7 +125,9 @@ public BraveLocationBarCoordinator(
() ->
bottomWindowPaddingSupplier.get()
+ (isBottomToolbarVisible() ? locationBarLayout.getHeight() : 0),
- onLongClickListener);
+ onLongClickListener,
+ browserControlsStateProvider,
+ isToolbarPositionCustomizationEnabled);
if (mUrlBar != null) {
((UrlBar) mUrlBar).setSelectAllOnFocus(true);
diff --git a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarMediator.java b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarMediator.java
index 2d9149456e4b..891cb51fef03 100644
--- a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarMediator.java
+++ b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarMediator.java
@@ -17,6 +17,7 @@
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.OneshotSupplier;
+import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.lens.LensController;
import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.profiles.Profile;
@@ -57,7 +58,8 @@ public BraveLocationBarMediator(
@NonNull OmniboxUma omniboxUma,
@NonNull BooleanSupplier isToolbarMicEnabledSupplier,
@NonNull OmniboxSuggestionsDropdownEmbedderImpl dropdownEmbedder,
- @Nullable ObservableSupplier tabModelSelectorSupplier) {
+ @Nullable ObservableSupplier tabModelSelectorSupplier,
+ @Nullable BrowserControlsStateProvider browserControlsStateProvider) {
super(
context,
locationBarLayout,
@@ -75,7 +77,8 @@ public BraveLocationBarMediator(
omniboxUma,
isToolbarMicEnabledSupplier,
dropdownEmbedder,
- tabModelSelectorSupplier);
+ tabModelSelectorSupplier,
+ browserControlsStateProvider);
}
public static Class getOmniboxUmaClass() {
diff --git a/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java b/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java
index 0ff6c591e34a..5c7692ee577d 100644
--- a/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java
+++ b/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java
@@ -432,29 +432,6 @@ private void openPlaylistInTab(boolean isIncognito, String url) {
TabUtils.openUrlInNewTab(isIncognito, url);
}
- private void updatePlaylistItem(String playlistId, PlaylistItem playlistItem) {
- if (mPlaylistViewModel == null) {
- return;
- }
- PlaylistItemModel playlistItemModel =
- new PlaylistItemModel(
- playlistItem.id,
- playlistId,
- playlistItem.name,
- playlistItem.pageSource.url,
- playlistItem.mediaPath.url,
- playlistItem.hlsMediaPath.url,
- playlistItem.mediaSource.url,
- playlistItem.thumbnailPath.url,
- playlistItem.author,
- playlistItem.duration,
- playlistItem.lastPlayedPosition,
- (long) playlistItem.mediaFileBytes,
- playlistItem.cached,
- false);
- mPlaylistViewModel.updatePlaylistItem(playlistItemModel);
- }
-
private void deleteHLSContent(String playlistItemId) {
PostTask.postTask(
TaskTraits.BEST_EFFORT_MAY_BLOCK,
diff --git a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java
index 7355c1581ec2..594c98a28646 100644
--- a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java
+++ b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java
@@ -21,6 +21,7 @@
import org.chromium.chrome.R;
import org.chromium.chrome.browser.BraveConfig;
import org.chromium.chrome.browser.BraveLocalState;
+import org.chromium.chrome.browser.browsing_data.BraveClearBrowsingDataFragment;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.metrics.ChangeMetricsReportingStateCalledFrom;
import org.chromium.chrome.browser.metrics.UmaSessionStats;
@@ -45,7 +46,7 @@
import org.chromium.gms.ChromiumPlayServicesAvailability;
import org.chromium.mojo.bindings.ConnectionErrorHandler;
import org.chromium.mojo.system.MojoException;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import org.chromium.ui.text.SpanApplier;
import org.chromium.webcompat_reporter.mojom.WebcompatReporterHandler;
@@ -64,6 +65,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link";
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
+ private static final String PREF_HTTPS_FIRST_MODE_LEGACY = "https_first_mode_legacy";
private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
private static final String PREF_PHONE_AS_A_SECURITY_KEY = "phone_as_a_security_key";
@@ -73,6 +75,8 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
private static final String PREF_THIRD_PARTY_COOKIES = "third_party_cookies";
private static final String PREF_SECURITY_SECTION = "security_section";
private static final String PREF_PRIVACY_GUIDE = "privacy_guide";
+ private static final String PREF_JAVASCRIPT_OPTIMIZER = "javascript_optimizer";
+ private static final String PREF_PASSWORD_LEAK_DETECTION = "password_leak_detection";
// brave Prefs
private static final String PREF_BRAVE_SHIELDS_GLOBALS_SECTION =
@@ -125,6 +129,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
PREF_DE_AMP,
PREF_DEBOUNCE,
PREF_HTTPS_UPGRADE,
+ PREF_HTTPS_FIRST_MODE_LEGACY,
PREF_HTTPS_FIRST_MODE,
PREF_BLOCK_SCRIPTS,
PREF_BLOCK_CROSS_SITE_COOKIES,
@@ -154,6 +159,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
PREF_SNS,
PREF_REQUEST_OTR,
PREF_SECURE_DNS,
+ PREF_JAVASCRIPT_OPTIMIZER,
PREF_BLOCK_COOKIE_CONSENT_NOTICES,
PREF_BLOCK_SWITCH_TO_APP_NOTICES,
PREF_DO_NOT_TRACK,
@@ -178,7 +184,8 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
private TextMessagePreference mBlockCrosssiteCookiesLearnMore;
private ChromeSwitchPreference mDeAmpPref;
private ChromeSwitchPreference mDebouncePref;
- private ChromeSwitchPreference mHttpsFirstModePref;
+ private ChromeSwitchPreference mHttpsFirstModePrefLegacy;
+ private Preference mHttpsFirstModePref;
private BraveDialogPreference mHttpsUpgradePref;
private BraveDialogPreference mFingerprintingProtectionPref;
private ChromeSwitchPreference mFingerprintingProtection2Pref;
@@ -262,14 +269,20 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
removePreferenceIfPresent(PREF_DEBOUNCE);
}
- mHttpsFirstModePref = (ChromeSwitchPreference) findPreference(PREF_HTTPS_FIRST_MODE);
+ boolean httpsByDefaultIsEnabled =
+ ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT);
+ if (!ChromeFeatureList.isEnabled(ChromeFeatureList.HTTPS_FIRST_BALANCED_MODE)) {
+ mHttpsFirstModePrefLegacy =
+ (ChromeSwitchPreference) findPreference(PREF_HTTPS_FIRST_MODE_LEGACY);
+ mHttpsFirstModePrefLegacy.setVisible(!httpsByDefaultIsEnabled);
+ } else {
+ mHttpsFirstModePref = (Preference) findPreference(PREF_HTTPS_FIRST_MODE);
+ mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled);
+ }
mHttpsUpgradePref = (BraveDialogPreference) findPreference(PREF_HTTPS_UPGRADE);
mHttpsUpgradePref.setOnPreferenceChangeListener(this);
- boolean httpsByDefaultIsEnabled =
- ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT);
- mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled);
mHttpsUpgradePref.setVisible(httpsByDefaultIsEnabled);
mCanMakePayment = (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
@@ -308,7 +321,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
new SpanApplier.SpanInfo(
"",
"",
- new NoUnderlineClickableSpan(
+ new ChromeClickableSpan(
requireContext(),
R.color.brave_link,
result -> {
@@ -413,6 +426,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
removePreferenceIfPresent(PREF_THIRD_PARTY_COOKIES);
removePreferenceIfPresent(PREF_SECURITY_SECTION);
removePreferenceIfPresent(PREF_PRIVACY_GUIDE);
+ removePreferenceIfPresent(PREF_PASSWORD_LEAK_DETECTION);
if (!ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_ANDROID_SAFE_BROWSING)) {
removePreferenceIfPresent(PREF_SAFE_BROWSING);
@@ -641,6 +655,13 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
return true;
}
+ private void updateClearBrowsingFragment() {
+ Preference clearBrowsingData = findPreference(PREF_CLEAR_BROWSING_DATA);
+ if (clearBrowsingData != null) {
+ clearBrowsingData.setFragment(BraveClearBrowsingDataFragment.class.getCanonicalName());
+ }
+ }
+
private void updateBravePreferences() {
for (int i = 0; i < NEW_PRIVACY_PREFERENCE_ORDER.length; i++) {
if (findPreference(NEW_PRIVACY_PREFERENCE_ORDER[i]) != null) {
@@ -649,6 +670,8 @@ private void updateBravePreferences() {
}
removePreferenceIfPresent(PREF_SYNC_AND_SERVICES_LINK);
+ updateClearBrowsingFragment();
+
SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
String blockAdTrackersPref = BraveShieldsContentSettings.getTrackersPref();
@@ -661,10 +684,14 @@ private void updateBravePreferences() {
// HTTPS only mode
boolean httpsByDefaultIsEnabled =
ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT);
- mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled);
- mHttpsFirstModePref.setChecked(
- UserPrefs.get(ProfileManager.getLastUsedRegularProfile())
- .getBoolean(Pref.HTTPS_ONLY_MODE_ENABLED));
+ if (!ChromeFeatureList.isEnabled(ChromeFeatureList.HTTPS_FIRST_BALANCED_MODE)) {
+ mHttpsFirstModePrefLegacy.setVisible(!httpsByDefaultIsEnabled);
+ mHttpsFirstModePrefLegacy.setChecked(
+ UserPrefs.get(ProfileManager.getLastUsedRegularProfile())
+ .getBoolean(Pref.HTTPS_ONLY_MODE_ENABLED));
+ } else {
+ mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled);
+ }
if (blockAdTrackersPref.equals(BraveShieldsContentSettings.BLOCK_RESOURCE)) {
mAdsTrakersBlockPref.setCheckedIndex(0);
diff --git a/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java b/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java
index f4374efffb31..75a6cc3a9e66 100644
--- a/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java
+++ b/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java
@@ -16,7 +16,6 @@
package org.chromium.chrome.browser.qrreader;
import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.ImageFormat;
import android.graphics.SurfaceTexture;
@@ -31,6 +30,7 @@
import android.view.WindowManager;
import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
import androidx.annotation.RequiresPermission;
import androidx.annotation.StringDef;
@@ -632,9 +632,10 @@ public void cancelAutoFocus() {
* Sets camera auto-focus move callback.
*
* @param cb the callback to run
- * @return {@code true} if the operation is supported (i.e. from Jelly Bean), {@code false} otherwise
+ * @return {@code true} if the operation is supported (i.e. from Jelly Bean), {@code false}
+ * otherwise
*/
- @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ @RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
public boolean setAutoFocusMoveCallback(@Nullable AutoFocusMoveCallback cb) {
synchronized (mCameraLock) {
if (mCamera != null) {
@@ -702,7 +703,7 @@ public void onAutoFocus(boolean success, Camera camera) {
}
/** Wraps the camera1 auto focus move callback so that the deprecated API isn't exposed. */
- @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ @RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
private static class CameraAutoFocusMoveCallback implements Camera.AutoFocusMoveCallback {
private AutoFocusMoveCallback mDelegate;
diff --git a/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java b/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java
index 62f8a0ce9354..e45cb7e73d2b 100644
--- a/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java
+++ b/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java
@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.rewards;
-import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -33,7 +32,6 @@
import androidx.appcompat.widget.AppCompatImageView;
import androidx.cardview.widget.CardView;
-import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.viewpager.widget.ViewPager;
@@ -43,7 +41,6 @@
import org.json.JSONException;
import org.chromium.base.BraveReflectionUtil;
-import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.SysUtils;
@@ -79,11 +76,10 @@
import org.chromium.chrome.browser.util.TabUtils;
import org.chromium.components.user_prefs.UserPrefs;
import org.chromium.ui.base.DeviceFormFactor;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import org.chromium.ui.text.SpanApplier;
import org.chromium.ui.text.SpanApplier.SpanInfo;
-import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
@@ -188,9 +184,7 @@ public enum NotificationClickAction {
private View mNotificationPermissionLayout;
private boolean mNotificationShown;
- private View mRewardsResponseModal;
private View mConnectAccountModal;
- private View mRewardsVbatExpireNoticeModal;
private View mRewardsTosModal;
private View mRewardsWalletBalance;
@@ -296,7 +290,6 @@ private void setUpViews() {
mPopupView.findViewById(R.id.brave_rewards_panel_notification_layout_id);
mNotificationPermissionLayout =
mPopupView.findViewById(R.id.brave_rewards_notification_permission_id);
- mRewardsResponseModal = mPopupView.findViewById(R.id.rewards_response_modal_id);
mConnectAccountModal = mPopupView.findViewById(R.id.connect_account_layout_id);
mBraveRewardsUnverifiedView =
mPopupView.findViewById(R.id.brave_rewards_panel_unverified_layout_id);
@@ -307,9 +300,6 @@ private void setUpViews() {
mPopupView.findViewById(R.id.brave_rewards_panel_payout_layout_id);
mRewardsTipLayout = mPopupView.findViewById(R.id.brave_rewards_panel_tip_layout_id);
- mRewardsVbatExpireNoticeModal =
- mPopupView.findViewById(R.id.brave_rewards_vbat_expire_notice_modal_id);
-
mRewardsTosModal = mPopupView.findViewById(R.id.rewards_tos_layout_id);
mRewardsWalletBalance = mPopupView.findViewById(R.id.wallet_balance_layout);
@@ -827,32 +817,6 @@ public void onGetCurrentBalanceReport(double[] report) {
}
}
- private void requestNotificationPermission() {
- if (BravePermissionUtils.isBraveAdsNotificationPermissionBlocked(mAnchorView.getContext())
- || mActivity.shouldShowRequestPermissionRationale(
- Manifest.permission.POST_NOTIFICATIONS)
- || (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU
- || !BuildInfo.targetsAtLeastT())) {
- // other than android 13 redirect to
- // setting page and for android 13 Last time don't allow selected in permission
- // dialog, then enable through setting, this done through this dialog
- showNotificationWarningDialog();
- } else {
- // 1st time request permission
- ActivityCompat.requestPermissions(
- mActivity, new String[] {Manifest.permission.POST_NOTIFICATIONS}, 1);
- }
- }
-
- private void showNotificationWarningDialog() {
- BraveNotificationWarningDialog notificationWarningDialog =
- BraveNotificationWarningDialog.newInstance(
- BraveNotificationWarningDialog.FROM_LAUNCHED_BRAVE_PANEL);
- notificationWarningDialog.setCancelable(false);
- notificationWarningDialog.show(mActivity.getSupportFragmentManager(),
- BraveNotificationWarningDialog.NOTIFICATION_WARNING_DIALOG_TAG);
- }
-
@Override
public void onGetAdsAccountStatement(
boolean success,
@@ -1062,16 +1026,16 @@ private void showTermsOfServiceUi() {
enableControls(false, mRewardsMainLayout);
mRewardsTosModal.setVisibility(View.VISIBLE);
- NoUnderlineClickableSpan resetClickableSpan =
- new NoUnderlineClickableSpan(
+ ChromeClickableSpan resetClickableSpan =
+ new ChromeClickableSpan(
mActivity,
R.color.rewards_panel_notification_secondary_text_color,
(textView) -> {
TabUtils.openUrlInNewTab(false, BraveActivity.BRAVE_REWARDS_RESET_PAGE);
dismiss();
});
- NoUnderlineClickableSpan tosClickableSpan =
- new NoUnderlineClickableSpan(
+ ChromeClickableSpan tosClickableSpan =
+ new ChromeClickableSpan(
mActivity,
R.color.brave_blue_tint_color,
(textView) -> {
@@ -1557,85 +1521,6 @@ private void panelShadow(boolean isEnable) {
}
}
- private void showVbatExpireNotice() {
- if (mRewardsVbatExpireNoticeModal == null) {
- return;
- }
-
- panelShadow(true);
-
- mRewardsVbatExpireNoticeModal.setVisibility(View.VISIBLE);
- TextView vBatModalTitle = mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_title);
- TextView vBatModalText = mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_text);
- FrameLayout vBatConnectButtonLayout =
- mRewardsVbatExpireNoticeModal.findViewById(R.id.layout_vbat_connect_account);
- vBatConnectButtonLayout.setVisibility(
- mBraveRewardsNativeWorker.canConnectAccount() ? View.VISIBLE : View.GONE);
- vBatConnectButtonLayout.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- TabUtils.openUrlInNewTab(
- false,
- BraveActivity.BRAVE_REWARDS_SETTINGS_WALLET_VERIFICATION_URL);
- dismiss();
- }
- });
-
- Button vBatConnectButton =
- mRewardsVbatExpireNoticeModal.findViewById(R.id.btn_vbat_connect_account);
- vBatConnectButton.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- TabUtils.openUrlInNewTab(
- false,
- BraveActivity.BRAVE_REWARDS_SETTINGS_WALLET_VERIFICATION_URL);
- dismiss();
- }
- });
-
- Button vBatLearnMoreButton =
- mRewardsVbatExpireNoticeModal.findViewById(R.id.btn_vbat_learn_more);
- vBatLearnMoreButton.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- CustomTabActivity.showInfoPage(mActivity, BRAVE_REWARDS_CHANGES_PAGE);
- }
- });
- AppCompatImageView vbatCloseBtn =
- mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_close);
- vbatCloseBtn.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mRewardsVbatExpireNoticeModal != null) {
- mRewardsVbatExpireNoticeModal.setVisibility(View.GONE);
- }
- panelShadow(false);
- }
- });
-
- String vbatModalTitleString = "";
- String vbatModalTextString = "";
- double dueDateInMillis = mBraveRewardsNativeWorker.getVbatDeadline();
- SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd, yyyy h:mm a", Locale.getDefault());
- String dueDate = sdf.format(new Date((long) dueDateInMillis));
- if (mBraveRewardsNativeWorker.canConnectAccount()) {
- vbatModalTitleString = mActivity.getString(R.string.vbat_supported_region_title);
- vbatModalTextString = String.format(
- mActivity.getString(R.string.vbat_supported_region_text), dueDate);
- } else {
- vbatModalTitleString = mActivity.getString(R.string.vbat_unsupported_region_title);
- vbatModalTextString =
- String.format(mActivity.getString(R.string.vbat_unsupported_region_text),
- dueDate, mBraveRewardsNativeWorker.getCountryCode());
- }
- vBatModalTitle.setText(vbatModalTitleString);
- vBatModalText.setText(vbatModalTextString);
- }
-
private void showConnectAccountModal() {
if (mConnectAccountModal == null) {
return;
@@ -1687,13 +1572,18 @@ private SpannableString learnMoreSpannableString(String text) {
SpannableString ss = new SpannableString(textToAgree.toString());
- NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan(
- mActivity, R.color.brave_rewards_modal_theme_color, (textView) -> {
- CustomTabActivity.showInfoPage(mActivity, NEW_SIGNUP_DISABLED_URL);
- });
+ ChromeClickableSpan clickableSpan =
+ new ChromeClickableSpan(
+ mActivity,
+ R.color.brave_rewards_modal_theme_color,
+ (textView) -> {
+ CustomTabActivity.showInfoPage(mActivity, NEW_SIGNUP_DISABLED_URL);
+ });
int learnMoreIndex = text.indexOf(mActivity.getResources().getString(R.string.learn_more));
- ss.setSpan(clickableSpan, learnMoreIndex,
+ ss.setSpan(
+ clickableSpan,
+ learnMoreIndex,
learnMoreIndex + mActivity.getResources().getString(R.string.learn_more).length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return ss;
@@ -1705,84 +1595,23 @@ private SpannableString spannableClickSpan(
SpannableString ss = new SpannableString(textMain.toString());
- NoUnderlineClickableSpan clickableSpan =
- new NoUnderlineClickableSpan(mActivity, R.color.brave_rewards_modal_theme_color,
- (textView) -> { CustomTabActivity.showInfoPage(mActivity, clickUrl); });
+ ChromeClickableSpan clickableSpan =
+ new ChromeClickableSpan(
+ mActivity,
+ R.color.brave_rewards_modal_theme_color,
+ (textView) -> {
+ CustomTabActivity.showInfoPage(mActivity, clickUrl);
+ });
int clickableTextIndex = mainText.indexOf(clickableText);
- ss.setSpan(clickableSpan, clickableTextIndex, clickableTextIndex + clickableText.length(),
+ ss.setSpan(
+ clickableSpan,
+ clickableTextIndex,
+ clickableTextIndex + clickableText.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return ss;
}
- private void showRewardsResponseModal(boolean isSuccess, String errorMessage) {
- if (mRewardsResponseModal == null) {
- return;
- }
- mRewardsResponseModal.setVisibility(View.VISIBLE);
-
- TextView responseModalTitle = mRewardsResponseModal.findViewById(R.id.response_modal_title);
- TextView responseModalText = mRewardsResponseModal.findViewById(R.id.response_modal_text);
- TextView responseErrorText = mRewardsResponseModal.findViewById(R.id.response_error_text);
- TextView responseRewardsBtn = mRewardsResponseModal.findViewById(R.id.response_action_btn);
- AppCompatImageView responseCloseBtn =
- mRewardsResponseModal.findViewById(R.id.response_modal_close);
- if (isSuccess) {
- responseModalTitle.setText(mActivity.getString(R.string.thank_you));
- responseModalTitle.setCompoundDrawablesWithIntrinsicBounds(
- 0, R.drawable.checked_circle_filled, 0, 0);
- responseModalText.setText(
- String.format(mActivity.getString(R.string.declare_geo_success_response_text),
- new Locale("", mBraveRewardsNativeWorker.getCountryCode())
- .getDisplayCountry()));
- responseRewardsBtn.setText(mActivity.getString(R.string.close_text));
- } else {
- String title = mActivity.getString(R.string.something_went_wrong_text);
- String text = mActivity.getString(R.string.declare_geo_failed_response_text);
- String actionText = mActivity.getString(R.string.retry_text);
- if (errorMessage.equals(WALLET_GENERATION_DISABLED_ERROR)) {
- title = mActivity.getString(R.string.wallet_generation_disabled_error_title);
- text =
- String.format(
- mActivity.getString(R.string.wallet_generation_disabled_error_text),
- mActivity.getResources().getString(R.string.learn_more));
- SpannableString spannableWithLearnMore = learnMoreSpannableString(text);
- responseModalText.setMovementMethod(LinkMovementMethod.getInstance());
- responseModalText.setText(spannableWithLearnMore);
- actionText = mActivity.getString(R.string.close_text);
- } else {
- responseModalText.setText(text);
- }
- responseModalTitle.setText(title);
- responseModalTitle.setCompoundDrawablesWithIntrinsicBounds(
- 0, R.drawable.ic_warning_circle_filled, 0, 0);
- responseRewardsBtn.setText(actionText);
- responseErrorText.setText(errorMessage);
- }
-
- responseRewardsBtn.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- mRewardsResponseModal.setVisibility(View.GONE);
- mRewardsMainLayout.setForeground(null);
- panelShadow(false);
- if (!isSuccess && !errorMessage.equals(WALLET_GENERATION_DISABLED_ERROR)) {
- showOnBoarding();
- }
- }
- });
-
- responseCloseBtn.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- mRewardsResponseModal.setVisibility(View.GONE);
- mRewardsMainLayout.setForeground(null);
- }
- });
- }
-
@Override
public void onGetPublishersVisitedCount(int count) {
if (mPopupView != null) {
@@ -2002,13 +1831,6 @@ private void updateMonthlyContributionUI() {
}
}
- private void openBannerActivity() {
- Intent intent = new Intent(
- ContextUtils.getApplicationContext(), RewardsTippingBannerActivity.class);
- intent.putExtra(RewardsTippingBannerActivity.TAB_ID_EXTRA, mCurrentTabId);
- mActivity.startActivityForResult(intent, BraveConstants.MONTHLY_CONTRIBUTION_REQUEST_CODE);
- }
-
private void updatePublisherStatus(int pubStatus) {
TextView publisherVerified = mPopupView.findViewById(R.id.publisher_verified);
publisherVerified.setAlpha(1f);
diff --git a/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java b/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java
index 151a83c3695a..f1b6dfa83be2 100644
--- a/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java
+++ b/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java
@@ -38,7 +38,7 @@
import org.chromium.chrome.browser.rewards.BraveRewardsPanel;
import org.chromium.chrome.browser.util.BraveTouchUtils;
import org.chromium.chrome.browser.util.TabUtils;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import java.text.Collator;
import java.util.ArrayList;
@@ -289,14 +289,19 @@ private SpannableString learnMoreSpannableString(Context context, String text) {
SpannableString ss = new SpannableString(textToAgree.toString());
- NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan(
- context, R.color.brave_rewards_modal_theme_color, (textView) -> {
- CustomTabActivity.showInfoPage(
- context, BraveRewardsPanel.NEW_SIGNUP_DISABLED_URL);
- });
+ ChromeClickableSpan clickableSpan =
+ new ChromeClickableSpan(
+ context,
+ R.color.brave_rewards_modal_theme_color,
+ (textView) -> {
+ CustomTabActivity.showInfoPage(
+ context, BraveRewardsPanel.NEW_SIGNUP_DISABLED_URL);
+ });
int learnMoreIndex = text.indexOf(context.getResources().getString(R.string.learn_more));
- ss.setSpan(clickableSpan, learnMoreIndex,
+ ss.setSpan(
+ clickableSpan,
+ learnMoreIndex,
learnMoreIndex + context.getResources().getString(R.string.learn_more).length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return ss;
diff --git a/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java b/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java
index 771e93cafc7f..21aab07895a4 100644
--- a/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java
+++ b/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java
@@ -22,7 +22,6 @@
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
-import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -32,9 +31,6 @@
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.Fragment;
-import com.google.android.material.bottomsheet.BottomSheetBehavior;
-import com.google.android.material.bottomsheet.BottomSheetDialog;
-
import org.json.JSONException;
import org.chromium.base.Log;
@@ -52,7 +48,7 @@
import org.chromium.chrome.browser.rewards.BraveRewardsBannerInfo;
import org.chromium.chrome.browser.util.TabUtils;
import org.chromium.ui.base.DeviceFormFactor;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import java.math.RoundingMode;
import java.text.DecimalFormat;
@@ -168,17 +164,12 @@ public void onBalance(boolean success) {
private void setMonthlyInformationClick(View view) {
View informationButton = view.findViewById(R.id.info_outline);
- informationButton.setOnClickListener(v -> {
- MonthlyContributionToolTip toolTip = new MonthlyContributionToolTip(view.getContext());
- toolTip.show(informationButton);
- });
- }
-
- private void setupFullHeight(BottomSheetDialog bottomSheetDialog) {
- FrameLayout bottomSheet =
- (FrameLayout) bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
- BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);
- behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
+ informationButton.setOnClickListener(
+ v -> {
+ MonthlyContributionToolTip toolTip =
+ new MonthlyContributionToolTip(view.getContext());
+ toolTip.show(informationButton);
+ });
}
private void updateTermsOfServicePlaceHolder(View view) {
@@ -340,15 +331,22 @@ private void showAlreadySetMonthlyContribution() {
private SpannableString stringMonthlyToSpannableString(String text) {
Spanned textSpanned = BraveRewardsHelper.spannedFromHtmlString(text);
SpannableString textSpannableString = new SpannableString(textSpanned.toString());
- NoUnderlineClickableSpan monthlyContributionClickableSpan = new NoUnderlineClickableSpan(
- getActivity(), R.color.monthly_contributions_text_color, (textView) -> {
- TabUtils.openUrlInNewTab(
- false, BraveActivity.BRAVE_REWARDS_SETTINGS_MONTHLY_URL);
- dismissRewardsPanel();
- });
-
- BraveRewardsHelper.setSpan(getActivity(), text, textSpannableString,
- R.string.monthly_contributions, monthlyContributionClickableSpan);
+ ChromeClickableSpan monthlyContributionClickableSpan =
+ new ChromeClickableSpan(
+ getActivity(),
+ R.color.monthly_contributions_text_color,
+ (textView) -> {
+ TabUtils.openUrlInNewTab(
+ false, BraveActivity.BRAVE_REWARDS_SETTINGS_MONTHLY_URL);
+ dismissRewardsPanel();
+ });
+
+ BraveRewardsHelper.setSpan(
+ getActivity(),
+ text,
+ textSpannableString,
+ R.string.monthly_contributions,
+ monthlyContributionClickableSpan);
return textSpannableString;
}
diff --git a/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java b/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java
index 322f8244b577..72464be2fc7f 100644
--- a/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java
+++ b/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java
@@ -27,7 +27,7 @@
import org.chromium.chrome.R;
import org.chromium.chrome.browser.BraveRewardsHelper;
import org.chromium.chrome.browser.customtabs.CustomTabActivity;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
public class TippingVerifiedCreatorToolTip {
private static final String NEW_SIGNUP_DISABLED_URL =
@@ -77,10 +77,13 @@ private SpannableString learnMoreSpannableString(Context context, String text) {
SpannableString ss = new SpannableString(textToAgree.toString());
- NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan(
- context, R.color.brave_rewards_modal_theme_color, (textView) -> {
- CustomTabActivity.showInfoPage(context, NEW_SIGNUP_DISABLED_URL);
- });
+ ChromeClickableSpan clickableSpan =
+ new ChromeClickableSpan(
+ context,
+ R.color.brave_rewards_modal_theme_color,
+ (textView) -> {
+ CustomTabActivity.showInfoPage(context, NEW_SIGNUP_DISABLED_URL);
+ });
int learnMoreIndex = text.indexOf(context.getResources().getString(R.string.learn_more));
diff --git a/android/java/org/chromium/chrome/browser/search_engines/settings/BraveSearchEngineAdapter.java b/android/java/org/chromium/chrome/browser/search_engines/settings/BraveSearchEngineAdapter.java
index 266206946ffb..587aed0fb49b 100644
--- a/android/java/org/chromium/chrome/browser/search_engines/settings/BraveSearchEngineAdapter.java
+++ b/android/java/org/chromium/chrome/browser/search_engines/settings/BraveSearchEngineAdapter.java
@@ -166,7 +166,7 @@ public void onClick(View view) {
public void onTemplateUrlServiceLoaded() {
// It is necessary to ensure user's selection is updated on first entering private setting
// but it causes updateActiveDSE() to be called twice (once here and
- // once from SearchEngineTabModelSelectorObserver)
+ // once from lambda at BraveSearchEngineUtils.initializeBraveSearchEngineStates)
if (mNeedUpdateActiveDSE) {
mNeedUpdateActiveDSE = false;
updateActiveDSE(mProfile, null);
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java
index a89479476248..d55c4b7c21d6 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java
@@ -6,12 +6,10 @@
package org.chromium.chrome.browser.settings;
import android.content.Intent;
-import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
-import android.util.DisplayMetrics;
import androidx.preference.Preference;
@@ -174,12 +172,12 @@ private void notificationClick() {
private void updateBravePreferences() {
// Below prefs are removed from main settings.
- removePreferenceIfPresent(MainSettings.PREF_SYNC_PROMO);
removePreferenceIfPresent(MainSettings.PREF_SIGN_IN);
removePreferenceIfPresent(MainSettings.PREF_SEARCH_ENGINE);
removePreferenceIfPresent(MainSettings.PREF_UI_THEME);
removePreferenceIfPresent(MainSettings.PREF_DOWNLOADS);
removePreferenceIfPresent(MainSettings.PREF_SAFETY_CHECK);
+ removePreferenceIfPresent(MainSettings.PREF_SAFETY_HUB);
removePreferenceIfPresent(MainSettings.PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION);
removePreferenceIfPresent(MainSettings.PREF_GOOGLE_SERVICES);
removePreferenceIfPresent(MainSettings.PREF_HOME_MODULES_CONFIG);
@@ -455,14 +453,6 @@ public boolean onPreferenceClick(Preference preference) {
}
}
- // TODO(simonhong): Make this static public with proper class.
- private int dp2px(int dp) {
- final float dpPerInchMdpi = 160f;
- DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
- float px = dp * (metrics.densityDpi / dpPerInchMdpi);
- return Math.round(px);
- }
-
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveSearchEngineUtils.java b/android/java/org/chromium/chrome/browser/settings/BraveSearchEngineUtils.java
index 6589d593f1af..adc0e2021b6b 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveSearchEngineUtils.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveSearchEngineUtils.java
@@ -7,11 +7,14 @@
import android.content.SharedPreferences;
+import androidx.annotation.Nullable;
+
import org.chromium.base.ContextUtils;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.profiles.ProfileManager;
import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory;
import org.chromium.chrome.browser.search_engines.settings.BraveSearchEngineAdapter;
+import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.widget.quickactionsearchandbookmark.QuickActionSearchAndBookmarkWidgetProvider;
import org.chromium.components.search_engines.TemplateUrl;
@@ -19,10 +22,21 @@
public class BraveSearchEngineUtils {
public static void initializeBraveSearchEngineStates(TabModelSelector tabModelSelector) {
- // There is no point in creating service for OTR profile in advance since they change
- // It will be initialized in SearchEngineTabModelSelectorObserver when called on an OTR
- // profile
- tabModelSelector.addObserver(new SearchEngineTabModelSelectorObserver());
+ tabModelSelector
+ .getCurrentTabModelSupplier()
+ .addObserver(
+ (@Nullable TabModel newModel) -> {
+ if (newModel == null) {
+ return;
+ }
+
+ if (newModel.getProfile().isOffTheRecord()) {
+ BraveSearchEngineUtils.initializeBraveSearchEngineStates(
+ newModel.getProfile());
+ } else {
+ BraveSearchEngineUtils.updateActiveDSE(newModel.getProfile(), null);
+ }
+ });
// For first-run initialization, it needs default TemplateUrl,
// so do it after TemplateUrlService is loaded to get it if it isn't loaded yet.
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveSettingsLauncherImpl.java b/android/java/org/chromium/chrome/browser/settings/BraveSettingsLauncherImpl.java
index ca858baf4ee8..f81b8ddfec13 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveSettingsLauncherImpl.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveSettingsLauncherImpl.java
@@ -13,8 +13,8 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
-import org.chromium.chrome.browser.browsing_data.BraveClearBrowsingDataFragmentAdvanced;
-import org.chromium.chrome.browser.browsing_data.ClearBrowsingDataFragmentAdvanced;
+import org.chromium.chrome.browser.browsing_data.BraveClearBrowsingDataFragment;
+import org.chromium.chrome.browser.browsing_data.ClearBrowsingDataFragment;
import org.chromium.chrome.browser.download.settings.BraveDownloadSettings;
import org.chromium.chrome.browser.download.settings.DownloadSettings;
import org.chromium.chrome.browser.safe_browsing.settings.BraveStandardProtectionSettingsFragment;
@@ -36,8 +36,8 @@ public void startSettings(
fragment = BraveStandardProtectionSettingsFragment.class;
} else if (fragment.equals(DownloadSettings.class)) {
fragment = BraveDownloadSettings.class;
- } else if (fragment.equals(ClearBrowsingDataFragmentAdvanced.class)) {
- fragment = BraveClearBrowsingDataFragmentAdvanced.class;
+ } else if (fragment.equals(ClearBrowsingDataFragment.class)) {
+ fragment = BraveClearBrowsingDataFragment.class;
}
}
super.startSettings(context, fragment, fragmentArgs);
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java b/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java
index f745ff586614..fb4a578d1650 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java
@@ -96,11 +96,6 @@ public ObservableSupplier getPageTitle() {
return mPageTitle;
}
- private void removePreferenceIfPresent(String key) {
- Preference preference = getPreferenceScreen().findPreference(key);
- if (preference != null) getPreferenceScreen().removePreference(preference);
- }
-
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java b/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java
index 1c840838f1ed..839523d00c05 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java
@@ -12,7 +12,6 @@
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
-import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
@@ -56,7 +55,6 @@
import org.json.JSONException;
import org.json.JSONObject;
-import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.supplier.ObservableSupplier;
@@ -903,38 +901,6 @@ private void seedWordsReceivedImpl(String seedWords, SyncInputType syncInputType
getBraveSyncWorker().finalizeSyncSetup();
}
- private void showMainSyncScrypt() {
- if (null != mScrollViewSyncInitial) {
- mScrollViewSyncInitial.setVisibility(View.VISIBLE);
- }
- if (null != mScrollViewAddMobileDevice) {
- mScrollViewAddMobileDevice.setVisibility(View.GONE);
- }
- if (null != mScrollViewAddLaptop) {
- mScrollViewAddLaptop.setVisibility(View.GONE);
- }
- if (null != mScrollViewSyncStartChain) {
- mScrollViewSyncStartChain.setVisibility(View.GONE);
- }
- if (null != mScrollViewSyncChainCode) {
- mScrollViewSyncChainCode.setVisibility(View.GONE);
- }
- if (null != mScrollViewEnterCodeWords) {
- mScrollViewEnterCodeWords.setVisibility(View.GONE);
- }
- }
-
- // Handles the requesting of the camera permission.
- private void requestCameraPermission() {
- Log.w(TAG, "Camera permission is not granted. Requesting permission");
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- final String[] permissions = new String[] {Manifest.permission.CAMERA};
-
- requestPermissions(permissions, RC_HANDLE_CAMERA_PERM);
- }
- }
-
@SuppressLint("InlinedApi")
private void createCameraSource(boolean autoFocus, boolean useFlash) {
Context context = getActivity().getApplicationContext();
@@ -1594,15 +1560,6 @@ private void clearBackground(View view) {
}
}
- private Context getBaseApplicationContext() {
- Context context = ContextUtils.getApplicationContext();
- if (context instanceof ContextWrapper) {
- return ((ContextWrapper) context).getBaseContext();
- } else {
- return context;
- }
- }
-
// Handles 'Back' button. Returns true if it is handled, false otherwise.
@Override
public boolean onBackPressed() {
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java b/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java
index 54c4a7b1c9aa..2486a2050dda 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java
@@ -195,6 +195,7 @@ public void updateNetworks() {
});
}
+ @SuppressWarnings("NoStreams")
private NetworkInfo[] filterNetworksByCoin(
@CoinType.EnumType final int coinType, NetworkInfo[] networks) {
return Arrays.stream(networks).filter(n -> n.coin == coinType).toArray(NetworkInfo[]::new);
diff --git a/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java b/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java
index a4b1fb463943..91862740dee6 100644
--- a/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java
+++ b/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java
@@ -31,7 +31,7 @@
import org.chromium.components.browser_ui.settings.TextMessagePreference;
import org.chromium.mojo.bindings.ConnectionErrorHandler;
import org.chromium.mojo.system.MojoException;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import org.chromium.ui.text.SpanApplier;
public class BraveWalletPreferences extends BravePreferenceFragment
@@ -179,7 +179,7 @@ private void setUpNftDiscoveryPreference() {
new SpanApplier.SpanInfo(
"",
"",
- new NoUnderlineClickableSpan(
+ new ChromeClickableSpan(
requireContext(),
R.color.brave_link,
result -> {
diff --git a/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java b/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java
index 635aad7051d8..6a2654e146aa 100644
--- a/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java
+++ b/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java
@@ -33,7 +33,7 @@
import org.chromium.ui.listmenu.BasicListMenu;
import org.chromium.ui.listmenu.ListMenu;
import org.chromium.ui.listmenu.ListMenuButton;
-import org.chromium.ui.listmenu.ListMenuButtonDelegate;
+import org.chromium.ui.listmenu.ListMenuDelegate;
import org.chromium.ui.listmenu.ListMenuItemProperties;
import org.chromium.ui.modelutil.MVCListAdapter.ModelList;
@@ -461,9 +461,9 @@ static class NetworkViewHolder extends ViewHolder {
/**
* Sets up the menu button at the end of this row with a given delegate.
*
- * @param delegate A {@link ListMenuButtonDelegate}.
+ * @param delegate A {@link ListMenuDelegate}.
*/
- void setMenuButtonDelegate(@NonNull final ListMenuButtonDelegate delegate) {
+ void setMenuButtonDelegate(@NonNull final ListMenuDelegate delegate) {
mMoreButton.setVisibility(View.VISIBLE);
mMoreButton.setDelegate(delegate);
}
diff --git a/android/java/org/chromium/chrome/browser/settings/SearchEngineTabModelSelectorObserver.java b/android/java/org/chromium/chrome/browser/settings/SearchEngineTabModelSelectorObserver.java
deleted file mode 100644
index ccf98e24de6c..000000000000
--- a/android/java/org/chromium/chrome/browser/settings/SearchEngineTabModelSelectorObserver.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (c) 2019 The Brave Authors. All rights reserved.
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-package org.chromium.chrome.browser.settings;
-
-import org.chromium.chrome.browser.tab.Tab;
-import org.chromium.chrome.browser.tab.TabCreationState;
-import org.chromium.chrome.browser.tabmodel.TabModel;
-import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver;
-
-/**
- * Set proper active default search engine(DSE) provider when current TabModel is changed.
- * Whenever current TabModel is changed, we should set appropriate DSE because
- * we use different DSE for normal and private tab.
- */
-public class SearchEngineTabModelSelectorObserver implements TabModelSelectorObserver {
- public SearchEngineTabModelSelectorObserver() {}
-
- @Override
- public void onChange() {}
-
- @Override
- public void onNewTabCreated(Tab tab, @TabCreationState int creationState) {}
-
- @Override
- public void onTabModelSelected(TabModel newModel, TabModel oldModel) {
- if (newModel.getProfile().isOffTheRecord()) {
- BraveSearchEngineUtils.initializeBraveSearchEngineStates(newModel.getProfile());
- } else {
- BraveSearchEngineUtils.updateActiveDSE(newModel.getProfile(), null);
- }
- }
-
- @Override
- public void onTabStateInitialized() {}
-
- @Override
- public void onTabHidden(Tab tab) {}
-}
diff --git a/android/java/org/chromium/chrome/browser/share/BraveShareDelegateImpl.java b/android/java/org/chromium/chrome/browser/share/BraveShareDelegateImpl.java
index 497077738d10..4e1e20cdaa04 100644
--- a/android/java/org/chromium/chrome/browser/share/BraveShareDelegateImpl.java
+++ b/android/java/org/chromium/chrome/browser/share/BraveShareDelegateImpl.java
@@ -7,6 +7,7 @@
import org.chromium.base.BravePreferenceKeys;
import org.chromium.base.supplier.Supplier;
+import org.chromium.chrome.browser.data_sharing.DataSharingTabManager;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
import org.chromium.chrome.browser.profiles.Profile;
@@ -15,12 +16,24 @@
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
public class BraveShareDelegateImpl extends ShareDelegateImpl {
- public BraveShareDelegateImpl(BottomSheetController controller,
- ActivityLifecycleDispatcher lifecycleDispatcher, Supplier tabProvider,
- Supplier tabModelSelectorProvider, Supplier profileSupplier,
- ShareSheetDelegate delegate, boolean isCustomTab) {
- super(controller, lifecycleDispatcher, tabProvider, tabModelSelectorProvider,
- profileSupplier, delegate, isCustomTab);
+ public BraveShareDelegateImpl(
+ BottomSheetController controller,
+ ActivityLifecycleDispatcher lifecycleDispatcher,
+ Supplier tabProvider,
+ Supplier tabModelSelectorProvider,
+ Supplier profileSupplier,
+ ShareSheetDelegate delegate,
+ boolean isCustomTab,
+ DataSharingTabManager dataSharingTabManager) {
+ super(
+ controller,
+ lifecycleDispatcher,
+ tabProvider,
+ tabModelSelectorProvider,
+ profileSupplier,
+ delegate,
+ isCustomTab,
+ dataSharingTabManager);
}
@Override
diff --git a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java
index 3534f0882a6c..84ee3af8e339 100644
--- a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java
+++ b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java
@@ -510,11 +510,6 @@ public void onClick(View view) {
initWebcompatReporterService();
}
- private void shareStats() {
- View shareStatsLayout = BraveStatsUtil.getLayout(R.layout.brave_stats_share_layout);
- BraveStatsUtil.updateBraveShareStatsLayoutAndShare(shareStatsLayout);
- }
-
private void setToggleView(boolean shouldShow) {
if (shouldShow) {
mSecondaryLayout.setVisibility(View.VISIBLE);
diff --git a/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java b/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java
index a6dc911a0d04..90d487cf1691 100644
--- a/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java
+++ b/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java
@@ -28,7 +28,7 @@
import org.chromium.chrome.browser.settings.BravePreferenceFragment;
import org.chromium.mojo.bindings.ConnectionErrorHandler;
import org.chromium.mojo.system.MojoException;
-import org.chromium.ui.text.NoUnderlineClickableSpan;
+import org.chromium.ui.text.ChromeClickableSpan;
import org.chromium.ui.widget.Toast;
public class CreateCustomFiltersFragment extends BravePreferenceFragment
@@ -72,8 +72,8 @@ private void setData() {
new SpannableString(summaryTextSpanned.toString());
if (getActivity() != null) {
- NoUnderlineClickableSpan summaryTextClickableSpan =
- new NoUnderlineClickableSpan(
+ ChromeClickableSpan summaryTextClickableSpan =
+ new ChromeClickableSpan(
getActivity(),
R.color.brave_link,
(textView) -> {
diff --git a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java
index 6d636dd2fa5c..f5a69bc3fb9f 100644
--- a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java
+++ b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java
@@ -11,6 +11,7 @@
import androidx.annotation.Nullable;
import org.jni_zero.CalledByNative;
+import org.jni_zero.JniType;
import org.chromium.base.Callback;
import org.chromium.chrome.browser.profiles.Profile;
@@ -96,8 +97,8 @@ public String extractDomainName(String accountEmail) {
@CalledByNative
static SigninManager create(
long nativeSigninManagerAndroid,
- Profile profile,
- IdentityManager identityManager,
+ @JniType("Profile*") Profile profile,
+ @JniType("signin::IdentityManager*") IdentityManager identityManager,
IdentityMutator identityMutator,
SyncService syncService) {
AccountInfoServiceProvider.init(identityManager);
diff --git a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java
index 55cba0d26498..60f118167792 100644
--- a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java
+++ b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java
@@ -33,6 +33,8 @@ public boolean isCategoryVisible(@SiteSettingsCategory.Type int type) {
switch (type) {
case SiteSettingsCategory.Type.STORAGE_ACCESS:
return false;
+ case SiteSettingsCategory.Type.ANTI_ABUSE:
+ return false;
default:
return super.isCategoryVisible(type);
}
diff --git a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java
index 66b53eafde64..82105b23935c 100644
--- a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java
@@ -48,7 +48,8 @@
import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.system.StatusBarColorController.StatusBarColorProvider;
-import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeStateProvider;
+import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeManager;
+import org.chromium.components.browser_ui.edge_to_edge.SystemBarColorHelper;
import org.chromium.components.browser_ui.widget.MenuOrKeyboardActionController;
import org.chromium.ui.InsetObserver;
import org.chromium.ui.base.ActivityWindowAndroid;
@@ -76,7 +77,6 @@ public BraveTabbedRootUiCoordinator(
@NonNull OneshotSupplier hubManagerSupplier,
@NonNull OneshotSupplier intentMetadataOneshotSupplier,
@NonNull OneshotSupplier layoutStateProviderOneshotSupplier,
- @NonNull Supplier lastUserInteractionTimeSupplier,
@NonNull BrowserControlsManager browserControlsManager,
@NonNull ActivityWindowAndroid windowAndroid,
@NonNull ActivityLifecycleDispatcher activityLifecycleDispatcher,
@@ -93,6 +93,7 @@ public BraveTabbedRootUiCoordinator(
@NonNull Supplier tabContentManagerSupplier,
@NonNull Supplier snackbarManagerSupplier,
@NonNull ObservableSupplierImpl edgeToEdgeSupplier,
+ @NonNull OneshotSupplierImpl systemBarColorHelperSupplier,
@ActivityType int activityType,
@NonNull Supplier isInOverviewModeSupplier,
@NonNull AppMenuDelegate appMenuDelegate,
@@ -109,7 +110,7 @@ public BraveTabbedRootUiCoordinator(
@Nullable ObservableSupplier overviewColorSupplier,
@Nullable View baseChromeLayout,
@NonNull ManualFillingComponentSupplier manualFillingComponentSupplier,
- @NonNull EdgeToEdgeStateProvider edgeToEdgeStateProvider) {
+ @NonNull EdgeToEdgeManager edgeToEdgeManager) {
super(
activity,
onOmniboxFocusChangedListener,
@@ -124,7 +125,6 @@ public BraveTabbedRootUiCoordinator(
hubManagerSupplier,
intentMetadataOneshotSupplier,
layoutStateProviderOneshotSupplier,
- lastUserInteractionTimeSupplier,
browserControlsManager,
windowAndroid,
activityLifecycleDispatcher,
@@ -141,6 +141,7 @@ public BraveTabbedRootUiCoordinator(
tabContentManagerSupplier,
snackbarManagerSupplier,
edgeToEdgeSupplier,
+ systemBarColorHelperSupplier,
activityType,
isInOverviewModeSupplier,
appMenuDelegate,
@@ -157,7 +158,7 @@ public BraveTabbedRootUiCoordinator(
overviewColorSupplier,
baseChromeLayout,
manualFillingComponentSupplier,
- edgeToEdgeStateProvider);
+ edgeToEdgeManager);
mActivity = activity;
mHubManagerSupplier = hubManagerSupplier;
diff --git a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java
index e2aab8824a0c..1bcced81f8ff 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java
@@ -275,6 +275,7 @@ public void enableBottomControls() {
new BottomUiThemeColorProvider(
mTopUiThemeColorProvider,
mBrowserControlsSizer,
+ mBottomControlsStacker,
mIncognitoStateProvider,
mActivity);
@@ -358,7 +359,8 @@ public void initializeWithNative(
Runnable openGridTabSwitcherHandler,
OnClickListener bookmarkClickHandler,
OnClickListener customTabsBackClickHandler,
- @Nullable ObservableSupplier archivedTabCountSupplier) {
+ @Nullable ObservableSupplier archivedTabCountSupplier,
+ ObservableSupplier tabModelNotificationDotSupplier) {
super.initializeWithNative(
layoutManager,
@@ -366,7 +368,8 @@ public void initializeWithNative(
openGridTabSwitcherHandler,
bookmarkClickHandler,
customTabsBackClickHandler,
- archivedTabCountSupplier);
+ archivedTabCountSupplier,
+ tabModelNotificationDotSupplier);
if (isToolbarPhone() && BottomToolbarConfiguration.isBottomToolbarEnabled()) {
enableBottomControls();
@@ -374,7 +377,8 @@ public void initializeWithNative(
() -> {
mTabModelSelector
.getModel(mIncognitoStateProvider.isIncognitoSelected())
- .closeTabs(TabClosureParams.closeAllTabs().build());
+ .getTabRemover()
+ .closeTabs(TabClosureParams.closeAllTabs().build(), false);
};
assert (mActivity instanceof ChromeActivity);
diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java
index 3ce540050799..453d02ae3ab3 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java
@@ -5,8 +5,6 @@
package org.chromium.chrome.browser.toolbar.bottom;
-import androidx.annotation.ColorInt;
-
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.theme.ThemeColorProvider.ThemeColorObserver;
@@ -53,14 +51,4 @@ void destroy() {
public void onThemeColorChanged(int primaryColor, boolean shouldAnimate) {
mModel.set(BrowsingModeBottomToolbarModel.PRIMARY_COLOR, primaryColor);
}
-
- /**
- * Set the alpha for the color.
- * @param baseColor The color which alpha will apply to.
- * @param alpha The desired alpha for the color. The value should between 0 to 1. 0 means total
- * transparency, 1 means total non-transparency.
- */
- private @ColorInt int applyCustomAlphaToColor(@ColorInt int baseColor, float alpha) {
- return (baseColor & 0x00FFFFFF) | ((int) (alpha * 255) << 24);
- }
}
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 6e517783ed2c..5f6cec22aef2 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
@@ -10,7 +10,6 @@
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Activity;
-import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
@@ -19,25 +18,17 @@
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
-import android.text.SpannableString;
-import android.text.Spanned;
-import android.text.TextPaint;
-import android.text.method.LinkMovementMethod;
-import android.text.style.ClickableSpan;
-import android.text.style.ForegroundColorSpan;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
-import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.widget.ImageViewCompat;
@@ -67,7 +58,6 @@
import org.chromium.chrome.browser.brave_stats.BraveStatsUtil;
import org.chromium.chrome.browser.crypto_wallet.controller.DAppsWalletController;
import org.chromium.chrome.browser.custom_layout.popup_window_tooltip.PopupWindowTooltip;
-import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar;
import org.chromium.chrome.browser.dialogs.BraveAdsSignupDialog;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
@@ -962,109 +952,6 @@ public void onConfigurationChanged(Configuration newConfig) {
// TODO: show wallet panel
}
- private void showBraveRewardsOnboardingModal() {
- Context context = getContext();
- final Dialog dialog = new Dialog(context);
- dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
- dialog.setCancelable(false);
- dialog.setContentView(R.layout.brave_rewards_onboarding_modal);
- dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
-
- View braveRewardsOnboardingModalView =
- dialog.findViewById(R.id.brave_rewards_onboarding_modal_layout);
-
- String tosText =
- String.format(context.getResources().getString(R.string.brave_rewards_tos_text),
- context.getResources().getString(R.string.terms_of_service),
- context.getResources().getString(R.string.privacy_policy));
- int termsOfServiceIndex =
- tosText.indexOf(context.getResources().getString(R.string.terms_of_service));
- Spanned tosTextSpanned = BraveRewardsHelper.spannedFromHtmlString(tosText);
- SpannableString tosTextSS = new SpannableString(tosTextSpanned.toString());
-
- ClickableSpan tosClickableSpan = new ClickableSpan() {
- @Override
- public void onClick(@NonNull View textView) {
- CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_TERMS_PAGE);
- }
- @Override
- public void updateDrawState(@NonNull TextPaint ds) {
- super.updateDrawState(ds);
- ds.setUnderlineText(false);
- }
- };
-
- tosTextSS.setSpan(
- tosClickableSpan,
- termsOfServiceIndex,
- termsOfServiceIndex
- + context.getResources().getString(R.string.terms_of_service).length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- tosTextSS.setSpan(
- new ForegroundColorSpan(context.getColor(R.color.brave_rewards_modal_theme_color)),
- termsOfServiceIndex,
- termsOfServiceIndex
- + context.getResources().getString(R.string.terms_of_service).length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-
- ClickableSpan privacyProtectionClickableSpan = new ClickableSpan() {
- @Override
- public void onClick(@NonNull View textView) {
- CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_PRIVACY_POLICY);
- }
- @Override
- public void updateDrawState(@NonNull TextPaint ds) {
- super.updateDrawState(ds);
- ds.setUnderlineText(false);
- }
- };
-
- int privacyPolicyIndex =
- tosText.indexOf(context.getResources().getString(R.string.privacy_policy));
- tosTextSS.setSpan(privacyProtectionClickableSpan, privacyPolicyIndex,
- privacyPolicyIndex
- + context.getResources().getString(R.string.privacy_policy).length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- tosTextSS.setSpan(
- new ForegroundColorSpan(context.getColor(R.color.brave_rewards_modal_theme_color)),
- privacyPolicyIndex,
- privacyPolicyIndex
- + context.getResources().getString(R.string.privacy_policy).length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-
- TextView tosAndPpText = braveRewardsOnboardingModalView.findViewById(
- R.id.brave_rewards_onboarding_modal_tos_pp_text);
- tosAndPpText.setMovementMethod(LinkMovementMethod.getInstance());
- tosAndPpText.setText(tosTextSS);
- BraveTouchUtils.ensureMinTouchTarget(tosAndPpText);
-
- TextView takeQuickTourButton =
- braveRewardsOnboardingModalView.findViewById(R.id.take_quick_tour_button);
- takeQuickTourButton.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- BraveRewardsHelper.setShowBraveRewardsOnboardingOnce(true);
- openRewardsPanel();
- dialog.dismiss();
- }
- });
- BraveTouchUtils.ensureMinTouchTarget(takeQuickTourButton);
- TextView btnBraveRewards =
- braveRewardsOnboardingModalView.findViewById(R.id.start_using_brave_rewards_text);
- btnBraveRewards.setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- BraveRewardsHelper.setShowDeclareGeoModal(true);
- openRewardsPanel();
- dialog.dismiss();
- }
- });
-
- dialog.show();
- }
-
private void addSavedBandwidthToDb(long savings) {
new AsyncTask() {
@Override
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 d985ca7b5ea3..f6a2d87e98ab 100644
--- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
+++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
@@ -202,7 +202,7 @@ public void initializeWithNative(
ObservableSupplier tabSupplier,
BrowserControlsVisibilityManager browserControlsVisibilityManager,
TopUiThemeColorProvider topUiThemeColorProvider,
- Supplier bottomToolbarControlsOffsetSupplier) {
+ ObservableSupplier bottomToolbarControlsOffsetSupplier) {
super.initializeWithNative(
profile,
layoutUpdater,
diff --git a/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java b/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java
index ffc418040db0..4afb4abf425d 100644
--- a/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java
+++ b/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java
@@ -38,6 +38,7 @@ public void addDelegate(TouchDelegate delegate) {
}
/** Add a delegate by bounds and view. */
+ @SuppressWarnings("NoStreams")
public void addDelegate(Rect bounds, View view) {
mDelegates =
mDelegates.stream()
diff --git a/android/java/res/drawable-hdpi/omnibox_https_valid.png b/android/java/res/drawable-hdpi/omnibox_https_valid_lock.png
similarity index 100%
rename from android/java/res/drawable-hdpi/omnibox_https_valid.png
rename to android/java/res/drawable-hdpi/omnibox_https_valid_lock.png
diff --git a/android/java/res/drawable-mdpi/omnibox_https_valid.png b/android/java/res/drawable-mdpi/omnibox_https_valid_lock.png
similarity index 100%
rename from android/java/res/drawable-mdpi/omnibox_https_valid.png
rename to android/java/res/drawable-mdpi/omnibox_https_valid_lock.png
diff --git a/android/java/res/drawable-xhdpi/omnibox_https_valid.png b/android/java/res/drawable-xhdpi/omnibox_https_valid_lock.png
similarity index 100%
rename from android/java/res/drawable-xhdpi/omnibox_https_valid.png
rename to android/java/res/drawable-xhdpi/omnibox_https_valid_lock.png
diff --git a/android/java/res/drawable-xxhdpi/omnibox_https_valid.png b/android/java/res/drawable-xxhdpi/omnibox_https_valid_lock.png
similarity index 100%
rename from android/java/res/drawable-xxhdpi/omnibox_https_valid.png
rename to android/java/res/drawable-xxhdpi/omnibox_https_valid_lock.png
diff --git a/android/java/res/drawable-xxxhdpi/omnibox_https_valid.png b/android/java/res/drawable-xxxhdpi/omnibox_https_valid_lock.png
similarity index 100%
rename from android/java/res/drawable-xxxhdpi/omnibox_https_valid.png
rename to android/java/res/drawable-xxxhdpi/omnibox_https_valid_lock.png
diff --git a/android/java/res/drawable/add_widget_button.xml b/android/java/res/drawable/add_widget_button.xml
index 5cf4f87b325d..5313692f7e5d 100644
--- a/android/java/res/drawable/add_widget_button.xml
+++ b/android/java/res/drawable/add_widget_button.xml
@@ -7,7 +7,7 @@
-
-
+
diff --git a/android/java/res/drawable/checked_circle_filled.xml b/android/java/res/drawable/checked_circle_filled.xml
deleted file mode 100644
index 46844e26a34d..000000000000
--- a/android/java/res/drawable/checked_circle_filled.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
diff --git a/android/java/res/drawable/crypto_wallet_blue_button.xml b/android/java/res/drawable/crypto_wallet_blue_button.xml
index 7429467ed3cb..4616e61455b8 100644
--- a/android/java/res/drawable/crypto_wallet_blue_button.xml
+++ b/android/java/res/drawable/crypto_wallet_blue_button.xml
@@ -2,7 +2,7 @@
-
-
+
diff --git a/android/java/res/drawable/crypto_wallet_hollow_button.xml b/android/java/res/drawable/crypto_wallet_hollow_button.xml
index 936e5972d884..768c6f9ce8a2 100644
--- a/android/java/res/drawable/crypto_wallet_hollow_button.xml
+++ b/android/java/res/drawable/crypto_wallet_hollow_button.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/android/java/res/layout/brave_sync_done.xml b/android/java/res/layout/brave_sync_done.xml
index 9dfec08fc1f9..a1ce4ee6dc3c 100644
--- a/android/java/res/layout/brave_sync_done.xml
+++ b/android/java/res/layout/brave_sync_done.xml
@@ -25,7 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/brave_sync_settings_title"
- android:textColor="@color/modern_grey_500"
+ android:textColor="@color/baseline_neutral_50"
android:paddingStart="15dip"
android:paddingTop="30dip"
android:visibility="gone" />
@@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:text="@string/brave_sync_settings_description"
android:paddingStart="15dip"
- android:textColor="@color/modern_grey_500"
+ android:textColor="@color/baseline_neutral_50"
android:visibility="gone" />
+ android:textColor="@color/baseline_neutral_50" />
+ android:textColor="@color/baseline_neutral_40" />
+ android:textColor="@color/baseline_neutral_40" />
diff --git a/android/java/res/layout/brave_sync_layout.xml b/android/java/res/layout/brave_sync_layout.xml
index 844f7390c111..1953531c9da5 100644
--- a/android/java/res/layout/brave_sync_layout.xml
+++ b/android/java/res/layout/brave_sync_layout.xml
@@ -64,7 +64,7 @@
android:text="@string/brave_sync_start_new_chain"
style="@style/BraveSyncBottomButton"
android:background="@android:color/transparent"
- android:textColor="@color/modern_grey_600" />
+ android:textColor="@color/baseline_neutral_40" />
@@ -129,7 +129,7 @@
android:text="@string/enter_code_words_sync"
style="@style/BraveSyncBottomButton"
android:background="@android:color/transparent"
- android:textColor="@color/modern_grey_600" />
+ android:textColor="@color/baseline_neutral_40" />
@@ -271,7 +271,7 @@
android:text="@string/brave_sync_use_camera_text"
style="@style/BraveSyncBottomButton"
android:background="@android:color/transparent"
- android:textColor="@color/modern_grey_600" />
+ android:textColor="@color/baseline_neutral_40" />
diff --git a/android/java/res/values-night/brave_colors.xml b/android/java/res/values-night/brave_colors.xml
index dbb321e6a9a1..8913f20bec34 100644
--- a/android/java/res/values-night/brave_colors.xml
+++ b/android/java/res/values-night/brave_colors.xml
@@ -88,7 +88,7 @@
@android:color/transparent
- @color/modern_grey_800
+ @color/baseline_neutral_20
#212529
#0d1214
@@ -101,7 +101,7 @@
@android:color/white
- @color/modern_grey_800
+ @color/baseline_neutral_20
#F0F2FF
#F0F2FF
diff --git a/android/java/res/values/brave_colors.xml b/android/java/res/values/brave_colors.xml
index 09f69db7f793..241b8046802e 100644
--- a/android/java/res/values/brave_colors.xml
+++ b/android/java/res/values/brave_colors.xml
@@ -116,9 +116,9 @@
@color/baseline_neutral_90
- @color/modern_grey_700
+ @color/baseline_neutral_30
- @color/modern_grey_700
+ @color/baseline_neutral_30
#fb542b
@@ -166,7 +166,7 @@
@color/white_alpha_70
@android:color/white
- @color/modern_grey_800
+ @color/baseline_neutral_20
#AA3B3B3B
#F1F3F5
#49CC69
diff --git a/android/java/res/values/brave_styles.xml b/android/java/res/values/brave_styles.xml
index 98bc38386bb3..49edf504604a 100644
--- a/android/java/res/values/brave_styles.xml
+++ b/android/java/res/values/brave_styles.xml
@@ -21,8 +21,8 @@
+
$i18n{appearanceSettingsBookmarBar}
diff --git a/browser/resources/settings/brave_appearance_page/sidebar.html b/browser/resources/settings/brave_appearance_page/sidebar.html
index 5e6aee67e2e2..b6819adaa633 100644
--- a/browser/resources/settings/brave_appearance_page/sidebar.html
+++ b/browser/resources/settings/brave_appearance_page/sidebar.html
@@ -1,4 +1,4 @@
-
+
+
+
diff --git a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
index afeb2ec5a58c..c8a5b532210d 100644
--- a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
+++ b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
@@ -1,4 +1,4 @@
-
diff --git a/browser/resources/settings/brave_overrides/people_page.ts b/browser/resources/settings/brave_overrides/people_page.ts
index 933b67fd9c12..587bf6156226 100644
--- a/browser/resources/settings/brave_overrides/people_page.ts
+++ b/browser/resources/settings/brave_overrides/people_page.ts
@@ -50,14 +50,6 @@ RegisterPolymerTemplateModifications({
} else {
console.error('[Brave Settings Overrides] People Page cannot find syncSetup/advanced template')
}
- const syncSetupPageContent = templateContent.querySelector(
- 'template[is=dom-if][route-path="/syncSetup/pageContent"]')
- if (syncSetupPageContent) {
- syncSetupPageContent.remove()
- } else {
- console.error('[Brave Settings Overrides] People Page cannot ' +
- 'find syncSetup/pageContent template')
- }
// always show the template content
signinTemplate.setAttribute('if', 'true')
// remove the google account button
diff --git a/browser/resources/settings/brave_overrides/privacy_page.ts b/browser/resources/settings/brave_overrides/privacy_page.ts
index 27b011b2d2ab..b0c109f71b96 100644
--- a/browser/resources/settings/brave_overrides/privacy_page.ts
+++ b/browser/resources/settings/brave_overrides/privacy_page.ts
@@ -264,22 +264,6 @@ RegisterPolymerTemplateModifications({
`)
}
- const cookiesTemplate = templateContent.querySelector(
- 'template[is="dom-if"][if="[[!is3pcdRedesignEnabled_]]"]')
- if (!cookiesTemplate) {
- console.error(
- '[Brave Settings Overrides] Couldn\'t find cookies template')
- } else {
- const cookiesLinkRow = cookiesTemplate.content.
- getElementById('thirdPartyCookiesLinkRow')
- if (!cookiesLinkRow) {
- console.error(
- '[Brave Settings Overrides] ' +
- 'Couldn\'t find thirdPartyCookiesLinkRow')
- } else {
- cookiesLinkRow.setAttribute('hidden', 'true')
- }
- }
}
if (!loadTimeData.getBoolean('isPrivacySandboxRestricted')) {
const privacySandboxSettings3Template = templateContent.
diff --git a/browser/resources/settings/brave_overrides/site_settings_page.ts b/browser/resources/settings/brave_overrides/site_settings_page.ts
index 414da03740ed..4725bdc8973f 100644
--- a/browser/resources/settings/brave_overrides/site_settings_page.ts
+++ b/browser/resources/settings/brave_overrides/site_settings_page.ts
@@ -21,6 +21,7 @@ const PERMISSIONS_ADVANCED_REMOVE_IDS = [
]
const CONTENT_ADVANCED_REMOVE_IDS = [
ContentSettingsTypes.ADS,
+ ContentSettingsTypes.ANTI_ABUSE,
ContentSettingsTypes.PERFORMANCE,
]
diff --git a/browser/resources/settings/brave_privacy_page/brave_personalization_options.html b/browser/resources/settings/brave_privacy_page/brave_personalization_options.html
index 844f45b951c4..5442c69375dc 100644
--- a/browser/resources/settings/brave_privacy_page/brave_personalization_options.html
+++ b/browser/resources/settings/brave_privacy_page/brave_personalization_options.html
@@ -1,5 +1,5 @@
-
diff --git a/browser/resources/settings/brave_sync_page/brave_sync_subpage.html b/browser/resources/settings/brave_sync_page/brave_sync_subpage.html
index 5a8f2dabdd0b..c552194468b6 100644
--- a/browser/resources/settings/brave_sync_page/brave_sync_subpage.html
+++ b/browser/resources/settings/brave_sync_page/brave_sync_subpage.html
@@ -1,4 +1,4 @@
-
diff --git a/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html b/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html
index 3f423750441c..d14120e0be43 100644
--- a/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html
+++ b/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html
@@ -4,7 +4,7 @@
You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
diff --git a/browser/resources/settings/social_blocking_page/social_blocking_page.html b/browser/resources/settings/social_blocking_page/social_blocking_page.html
index cbadea799ecb..623e46d5ac64 100644
--- a/browser/resources/settings/social_blocking_page/social_blocking_page.html
+++ b/browser/resources/settings/social_blocking_page/social_blocking_page.html
@@ -1,5 +1,5 @@
-
GetExtensionId();
extensions::ExtensionPrefs* prefs =
extensions::ExtensionPrefs::Get(otr_profile_->GetOriginalProfile());
- auto time = prefs->GetLastUpdateTime(extension_id);
+ auto time = extensions::GetLastUpdateTime(prefs, extension_id);
auto turl =
std::make_unique(data, type, extension_id, time, true);
diff --git a/browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView.java b/browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView.java
index fb7cfeca12e2..09c36c787e0a 100644
--- a/browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView.java
+++ b/browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView.java
@@ -12,6 +12,7 @@
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.components.signin.base.AccountInfo;
+import org.chromium.components.signin.base.GaiaId;
public class BraveManageAccountDevicesLinkView extends LinearLayout {
public BraveManageAccountDevicesLinkView(Context context, AttributeSet attrs) {
@@ -21,6 +22,6 @@ public BraveManageAccountDevicesLinkView(Context context, AttributeSet attrs) {
}
public static AccountInfo getSharingAccountInfo(Profile profile) {
- return new AccountInfo.Builder("", "").build();
+ return new AccountInfo.Builder("", new GaiaId("")).build();
}
}
diff --git a/browser/sources.gni b/browser/sources.gni
index d0c67b924f6a..9f4822ecbed8 100644
--- a/browser/sources.gni
+++ b/browser/sources.gni
@@ -498,6 +498,7 @@ if (is_win && is_official_build) {
brave_chrome_browser_public_deps = [
"//brave/app/vector_icons",
"//brave/browser:browser_process",
+ "//brave/common/importer:interfaces",
"//brave/components/brave_sync:constants",
"//brave/components/variations",
]
diff --git a/browser/speedreader/speedreader_tab_helper.cc b/browser/speedreader/speedreader_tab_helper.cc
index 98b48dcf0d9b..56a070862906 100644
--- a/browser/speedreader/speedreader_tab_helper.cc
+++ b/browser/speedreader/speedreader_tab_helper.cc
@@ -76,6 +76,7 @@ SpeedreaderTabHelper::SpeedreaderTabHelper(
dom_distiller::AddObserver(web_contents, this);
speedreader_service_observation_.Observe(GetSpeedreaderService());
tts_player_observation_.Observe(speedreader::TtsPlayer::GetInstance());
+ is_visible_ = web_contents->GetVisibility() != content::Visibility::HIDDEN;
}
SpeedreaderTabHelper::~SpeedreaderTabHelper() {
@@ -627,7 +628,7 @@ bool SpeedreaderTabHelper::SendGestureEvent(ui::ViewAndroid* view,
int64_t time_ms,
float scale) {
float dip_scale = view->GetDipScale();
- auto size = view->GetSize();
+ auto size = view->GetSizeDIPs();
float x = size.width() / 2;
float y = size.height() / 2;
gfx::PointF root_location =
diff --git a/browser/storage_access_api/api_browsertest.cc b/browser/storage_access_api/api_browsertest.cc
index 708ffee5f08e..6eecddd27012 100644
--- a/browser/storage_access_api/api_browsertest.cc
+++ b/browser/storage_access_api/api_browsertest.cc
@@ -111,8 +111,9 @@ class StorageAccessAPIBrowserTest : public PlatformBrowserTest {
void SetCrossSiteCookieOnDomain(std::string_view domain) {
GURL domain_url = GetURL(domain);
std::string cookie = base::StrCat({"cross-site=", domain});
- content::SetCookie(profile(), domain_url,
- base::StrCat({cookie, CookieAttributes(domain)}));
+ ASSERT_TRUE(
+ content::SetCookie(profile(), domain_url,
+ base::StrCat({cookie, CookieAttributes(domain)})));
ASSERT_THAT(content::GetCookies(profile(), domain_url),
testing::HasSubstr(cookie));
}
diff --git a/browser/sync/brave_sync_alerts_service_factory.cc b/browser/sync/brave_sync_alerts_service_factory.cc
index 6c543075f667..7e9cd4a7d630 100644
--- a/browser/sync/brave_sync_alerts_service_factory.cc
+++ b/browser/sync/brave_sync_alerts_service_factory.cc
@@ -52,3 +52,7 @@ content::BrowserContext* BraveSyncAlertsServiceFactory::GetBrowserContextToUse(
bool BraveSyncAlertsServiceFactory::ServiceIsCreatedWithBrowserContext() const {
return true;
}
+
+bool BraveSyncAlertsServiceFactory::ServiceIsNULLWhileTesting() const {
+ return true;
+}
diff --git a/browser/sync/brave_sync_alerts_service_factory.h b/browser/sync/brave_sync_alerts_service_factory.h
index 0314b2fa52ee..3f64755f40a8 100644
--- a/browser/sync/brave_sync_alerts_service_factory.h
+++ b/browser/sync/brave_sync_alerts_service_factory.h
@@ -40,6 +40,7 @@ class BraveSyncAlertsServiceFactory : public BrowserContextKeyedServiceFactory {
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
+ bool ServiceIsNULLWhileTesting() const override;
};
#endif // BRAVE_BROWSER_SYNC_BRAVE_SYNC_ALERTS_SERVICE_FACTORY_H_
diff --git a/browser/tor/test/brave_tor_browsertest.cc b/browser/tor/test/brave_tor_browsertest.cc
index 555228a88281..f98c83ef187d 100644
--- a/browser/tor/test/brave_tor_browsertest.cc
+++ b/browser/tor/test/brave_tor_browsertest.cc
@@ -46,7 +46,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
-#include "components/autofill/core/browser/browser_autofill_manager.h"
+#include "components/autofill/core/browser/foundations/browser_autofill_manager.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/ssl_host_state_delegate.h"
@@ -76,10 +76,7 @@ void TestAutofillInWindow(content::WebContents* active_contents,
autofill::ContentAutofillDriver::GetForRenderFrameHost(
active_contents->GetPrimaryMainFrame());
ASSERT_TRUE(cross_driver);
- EXPECT_EQ(static_cast(
- &cross_driver->GetAutofillManager())
- ->IsAutofillEnabled(),
- enabled);
+ EXPECT_EQ(cross_driver->GetAutofillClient().IsAutofillEnabled(), enabled);
}
struct MockTorLauncherObserver : public TorLauncherObserver {
diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn
index 42b2b2d14f37..c1f09256d9ae 100644
--- a/browser/ui/BUILD.gn
+++ b/browser/ui/BUILD.gn
@@ -621,6 +621,7 @@ source_set("ui") {
"//chrome/browser/ui/exclusive_access",
"//chrome/browser/ui/javascript_dialogs",
"//chrome/browser/ui/views/bubble",
+ "//chrome/browser/ui/views/download",
"//chrome/browser/ui/views/toolbar",
"//components/bookmarks/browser",
]
@@ -851,7 +852,6 @@ source_set("ui") {
"//chrome/browser/ui/color:color_headers",
"//chrome/browser/ui/color:mixers",
"//chrome/browser/ui/webui",
- "//chrome/browser/ui/webui:webui_util",
"//chrome/common",
"//components/bookmarks/common",
"//components/content_settings/browser",
diff --git a/browser/ui/android/default_browser_promo/java/src/org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils.java b/browser/ui/android/default_browser_promo/java/src/org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils.java
index 0ade97526db6..aa012bee8903 100644
--- a/browser/ui/android/default_browser_promo/java/src/org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils.java
+++ b/browser/ui/android/default_browser_promo/java/src/org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils.java
@@ -21,10 +21,7 @@ public BraveDefaultBrowserPromoUtils(
@Override
public boolean prepareLaunchPromoIfNeeded(
- Activity activity,
- WindowAndroid windowAndroid,
- Tracker tracker,
- boolean ignoreMaxCount) {
+ Activity activity, WindowAndroid windowAndroid, Tracker tracker) {
return false;
}
}
diff --git a/browser/ui/android/strings/android_brave_strings.grd b/browser/ui/android/strings/android_brave_strings.grd
index 1a30b22a0057..da7e8e8bc6d8 100644
--- a/browser/ui/android/strings/android_brave_strings.grd
+++ b/browser/ui/android/strings/android_brave_strings.grd
@@ -1519,12 +1519,6 @@ Are you sure you want to do this?
Maybe Later
-
- Earn tokens for viewing this image and pay it forward to creators. %1$s
-
-
- You're earning tokens for viewing this image.\n%1$s
-
The payout for %1$s rewards will begin processing by %2$s.
@@ -3418,9 +3412,6 @@ If you don't accept this request, VPN will not reconnect and your internet conne
Select your country
-
- Your Brave Rewards region has been set to %1$s.
-
Unfortunately, there was an error while trying to set up Brave Rewards. Please try again.
@@ -3619,18 +3610,6 @@ If you don't accept this request, VPN will not reconnect and your internet conne
Test Networks
-
- Action required: Connect a custodial account or your vBAT will be lost
-
-
- On %1$s, we will be discontinuing support for existing virtual BAT balances. Connect a custodial account before this date so we can transfer your earned balance to your custodial account, otherwise your balance will be lost.
-
-
- You still have time to contribute your vBAT to your favorite creators
-
-
- On %1$s, we will be discontinuing support for existing virtual BAT balances. Unfortunately, there are no available custodians in your region (%2$s) to withdraw your earnings. Until then, you can still contribute to your favorite creators.
-
View page with Speedreader?
diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd
index 6e10ee5833be..cd1b1d36b171 100644
--- a/browser/ui/android/strings/android_chrome_strings.grd
+++ b/browser/ui/android/strings/android_chrome_strings.grd
@@ -29,7 +29,7 @@ CHAR_LIMIT guidelines:
* Action bar items - 32 characters
-->
-
+
@@ -274,6 +274,9 @@ CHAR_LIMIT guidelines:
USB
+
+ Collaboration
+
@@ -285,12 +288,6 @@ CHAR_LIMIT guidelines:
You are currently customizing your Sync settings. To finish turning on sync, tap the Confirm button near the bottom of the screen. Navigate up
-
- Sync and personalize across devices
-
-
- Disabled by the administrator of this device
-
Not available on your device
@@ -416,12 +413,6 @@ CHAR_LIMIT guidelines:
For more settings that relate to privacy, security, and data collection, see <link>Sync and Brave services</link>
-
- For more settings that relate to privacy, security, and data collection, see <link1>Sync</link1> and <link2>Brave services</link2>
-
-
- For more settings that relate to privacy, security, and data collection, see <link>Brave services</link>
-
You can <link1>manage what Brave data is saved</link1> in your Brave sync chain.
@@ -467,6 +458,14 @@ For more settings that use data to improve your Brave experience, go to
+
+ You can also touch and hold the address bar to change the position.
+
+
+
+ When your device is folded, you can choose an option or touch and hold the address bar to change the position.
+
+
Top
@@ -797,9 +796,6 @@ For more settings that use data to improve your Brave experience, go to
Turn on screen lock in Settings to export your passwords from this device
-
- Showing password generation popup
-
Export passwords…
@@ -1017,14 +1013,17 @@ For more settings that use data to improve your Brave experience, go to
+
+ Password suggestion confirmation
+
Use your %1$sexample.com password?
<b1>%1$sexample.com</b1> and <b2>%2$sexample.com</b2> seem to be related. Make sure you trust <b3>%2$sexample.com</b3> before using your password.
-
- Password used.
+
+ Password suggestion is closed.
@@ -1374,33 +1373,12 @@ Your Brave account may have other forms of browsing history like searches and ac
Signs you out of most sites
-
- Signs you out of most sites. You won't be signed out of your Brave sync chain.
-
Deletes history, including in the search box
-
- Deletes history from all synced devices
-
-
- <link1>Search history</link1> and <link2>other forms of activity</link2> may be saved in your Brave sync chain when you’re signed in. You can delete them anytime.
-
-
- <link1>Other forms of activity</link1> may be saved in your Brave sync chain when you’re signed in. You can delete them anytime.
-
-
- To sign out of your Brave sync chain on all websites, <link1>sign out of Brave</link1>.
-
Deleting your browsing data doesn't sign you out of your Brave sync chain. To do so, <link1>sign out of Brave</link1>.
-
- Your search engine is %1$sBing. See their instructions for deleting your search history, if applicable.
-
-
- See your search engine’s instructions for deleting your search history, if applicable
-
Saved passwords
@@ -1464,9 +1442,6 @@ Your Brave account may have other forms of browsing history like searches and ac
Open full Brave history
-
- Basic
-
Some of your history might not show up here. To see all your Brave history, open full Brave history.
@@ -1605,14 +1580,6 @@ Your Brave account may have other forms of browsing history like searches and ac
Privacy guide explanation closed
-
-
- Tracking Protection
-
-
- Manage third-party cookies and tracking protections
-
-
Hide your IP address
@@ -2276,6 +2243,9 @@ Your Brave account may have other forms of browsing history like searches and ac
Share
+
+ Also share tab audio
+
@@ -2553,6 +2523,9 @@ Your Brave account may have other forms of browsing history like searches and ac
Payment methods, offers, and addresses using Google Pay
+
+ Account
+
In your Brave sync chain
@@ -2777,6 +2750,12 @@ To change this setting, BEGIN_LINKdelete the Brave da
Password sync isn't working
+
+ Get access to all your passwords
+
+
+ Some of your passwords aren’t available on this device
+
Initial sync setup not finished
@@ -2798,6 +2777,12 @@ To change this setting, BEGIN_LINKdelete the Brave da
To sync your passwords, verify it's you
+
+ Verify it’s you to make sure you can access all your passwords on this device
+
+
+ Verify it’s you to access passwords in your Brave sync chain
+
To start sync, enter your passphrase
@@ -2938,11 +2923,8 @@ To change this setting, BEGIN_LINKdelete the Brave da
Private tabs
-
- Restored %1$sYouTube, tab
-
-
- Restored %1$s3 tabs
+
+ Manage open tabs
%1$sWelcome to Facebook, tab
@@ -3299,6 +3281,15 @@ To change this setting, BEGIN_LINKdelete the Brave da
Manage
+
+ Possible spam
+
+
+ Brave detected possible spam from %1$sexample.com.
+
+
+ Show notification
+
@@ -3427,7 +3418,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Pages
- Video
+ Videos
Audio
@@ -3577,7 +3568,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Open in Private Brave tab
-
+
Unlock Private
@@ -3585,7 +3576,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
See other tabs
-
+
Lock Private tabs when you leave Brave
@@ -3658,9 +3649,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Things to consider
-
- Info is sent to Brave about your Brave usage, but it isn\u2019t tied to you\n\nIf Brave crashes, details about the crash may include some personal info\n\nIf you turn on sync, metrics may also include info about URLs you visit
-
Info is sent to Brave about your Brave usage, but it isn\u2019t tied to you\n\nIf Brave crashes, details about the crash may include some personal info\n\nIf you sync your history to your Brave sync chain, metrics may also include info about URLs you visit
@@ -3695,9 +3683,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
To protect your sensitive content in the car, you must create a car profile lock. You can do this with a pin, code, or password.
-
- Your profile lock keeps your info secure in the car, including synced passwords, payments and more.
-
Your profile lock keeps your info secure in the car, including passwords, payments, and more saved in your Brave sync chain.
@@ -3825,9 +3810,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Manage your interests and preferences
-
- Sign in to manage your preferences
-
Get your bookmarks, passwords, and more on all your devices
@@ -3835,14 +3817,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Sign in to this site and Brave to get your bookmarks and more on all your devices
-
-
- Get better suggestions
-
-
- Sync to get the most relevant content from Brave
-
-
Continue as %1$sJohn
@@ -3857,8 +3831,8 @@ To change this setting, BEGIN_LINKdelete the Brave da
Get all your bookmarks
-
- Sync to get your bookmarks from your other devices
+
+ To get your bookmarks on all your devices, turn on “Bookmarks” in settings
Get all your bookmarks
@@ -3866,36 +3840,18 @@ To change this setting, BEGIN_LINKdelete the Brave da
Sign in to get your bookmarks and more on all your devices
-
- Get better suggestions
-
-
- Sync to get the most relevant content from Brave
-
Get better content
Sign in to get content based on your interests
-
- Get all your tabs
-
You’ll find your tabs from other devices here
-
- Sync to get your tabs from your other devices
-
To see tabs from your other devices, sync your tabs and history
-
- Use Brave your way
-
-
- Sync to get your bookmarks, history and more on your other devices
-
Choose another account
@@ -3992,9 +3948,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Manage interests
-
- Manage reactions
-
Manage
@@ -4082,18 +4035,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Discover by Brave - off
-
- Content for young minds
-
-
- Content by Brave for young minds
-
-
- Content for young minds - off
-
-
- Content by Brave for young minds - off
-
Following
@@ -4234,6 +4175,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
Toolbar shortcut
+
+ Touch and hold the address bar to change its position.
+
Quickly open a new tab. To edit this shortcut, touch and hold.
@@ -4308,6 +4252,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
Download
+
+ Download page
+
Page info
@@ -4404,6 +4351,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
Switch out of Private
+
+ Open with…
+
@@ -4517,7 +4467,15 @@ To change this setting, BEGIN_LINKdelete the Brave da
to %1$sReading List
-
+
+
+ Bookmark bar button icon
+
+
+ All Bookmarks
+
+
+
Bookmark saved
@@ -4899,9 +4857,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Signed in as %sBruce Wayne. Opens settings.
-
- Signed out. Opens dialog to sign in and turn on sync.
-
Signed out. Opens options to sign in.
@@ -4972,7 +4927,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Search: %sWeather in San Francisco
- Navigate: %1$sCrater Lake National Park (U.S. National Park Service): %2$shttps://www.nps.gov/crla
+ %1$sCrater Lake National Park (U.S. National Park Service): %2$shttps://www.nps.gov/crla
Most visited sites
@@ -5104,12 +5059,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
%1$s3 downloads deleted
-
- Restored %1$sYouTube
-
-
- %1$s3 downloads restored
-
@@ -5777,22 +5726,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Submit %1$s123 to %2$sexample.com?
-
-
- Redirect blocked:
-
-
- Redirect blocked.
-
-
- Always allow
-
-
- This page uses too much memory, so Brave paused it.
-
-
- Resume
-
Show your Brave activity in Digital Wellbeing?
@@ -5955,6 +5888,10 @@ To change this setting, BEGIN_LINKdelete the Brave da
Including link: %1$shttps://www.example.com
+
+ Tab group
+
+
chrome_qrcode_%1$s1582667748515
@@ -6204,6 +6141,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
To continue, %1$sidp.com will share your %2$sname and email address with this site. See this site's <link_privacy_policy>privacy policy</link_privacy_policy> and <link_terms_of_service>terms of service</link_terms_of_service>.
+
+ You can’t sign in using this account
+
Sign in
@@ -6214,6 +6154,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
Sign in to Brave
+
+ Something went wrong. Try again.
+
Continue as %1$sAlbus (or Albus Dumbledore)
@@ -6310,6 +6253,25 @@ To change this setting, BEGIN_LINKdelete the Brave da
Always use secure connections
+
+ For sites that don’t support secure connections, get warned before visiting the site
+
+
+ For sites that don’t support secure connections, get warned before visiting the site. You can’t change this setting because you have Advanced Protection enabled.
+
+
+ Off
+
+
+ Warns you for insecure public & private sites
+
+
+ Private sites might include things like your company’s intranet
+
+
+ Warns you for insecure public sites
+
+
Use HTTPS whenever possible and get warned before loading sites that don’t support it
@@ -6383,10 +6345,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Select from the dropdown list
-
-
- Price drop spotted
-
Bottom sheet
@@ -6398,7 +6356,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Full-size sheet
-
+
Delete browsing data
@@ -6633,6 +6591,213 @@ To change this setting, BEGIN_LINKdelete the Brave da
+
+
+ Share “%1$sVacation” tab group
+
+
+
+
+
+ Manage access
+
+
+ Stop sharing
+
+
+
+
+
+ Stop sharing?
+
+
+
+
+
+ Remove %1$sJohn Doe?
+
+
+ Remove
+
+
+
+
+
+ Delete tab group?
+
+
+ Delete
+
+
+
+
+
+ Join tab group with %1$sAli
+
+
+
+ {NUM_OTHER_MEMBERS, plural,
+ =1 {Join tab group with %1$sAli and %2$d1 other}
+ other {Join tab group with %1$sAli and %2$d1 others}
+ }
+
+
+ Join and open
+
+
+ Tab group details
+
+
+ This link doesn’t work
+
+
+
+
+
+ Leave tab group?
+
+
+ Leave
+
+
+
+
+
+ Block %1$sJohn Doe?
+
+
+ Block
+
+
+
+
+
+ Block and leave group?
+
+
+ Block and leave
+
+
+
+
+
+ Keep tab group?
+
+
+ Keep group
+
+
+ Delete group
+
+
+ Leave group
+
+
+
+
+ Anyone with the link can edit all tabs, so share wisely. Link expires in 48 hours.
+ Share as %1$sJohn Doe
+
+
+
+
+ Anyone with the link can edit all tabs.
+
+
+ Always share wisely. Links expire in 48 hours.
+
+
+
+
+
+ Everyone will immediately lose access to the “%1$sVacation” tab group, and all invitation links will be turned off
+
+
+
+
+
+ %1$sJohn Doe (%2$sjohndoe@gmail.com) will immediately lose access to the “%3$sVacation” tab group
+
+
+
+
+
+ Everyone will immediately lose access to the “%1$sVacation” tab group, and it will be deleted from all devices
+
+
+
+
+
+ %1$sAli Connors (%2$sali.connors@gmail.com) wants you to join a tab group. Anyone with the link can edit all tabs, so join with care. Link expires in 48 hr.
+
+
+ {TABS_COUNT, plural,
+ =1 {1 tab}
+ other {%1$d4 tabs}
+ }
+
+
+ Tabs in group
+
+
+ Contact the sender to ask for a new link
+
+
+ Join as %1$sJohn Doe
+
+
+
+
+
+ You’ll immediately lose access to the “%1$sVacation” tab group, and it will be deleted from all your devices
+
+
+
+
+
+ %1$sJohn Doe (%2$sjohndoe@gmail.com) will immediately lose access to the “%3$sVacation” tab group, and will no longer be able to interact with you across Brave services.
+
+
+
+
+
+ You’ll immediately lose access to the “%1$sVacation” tab group, and %1$sAli Connors (%2$sali.connors@gmail.com) will no longer be able to interact with you across Brave services.
+
+
+ Learn about blocked accounts
+
+
+
+
+
+ Keep this group to add tabs later, or delete it if you no longer need it.
+
+
+ If you delete it, everyone will immediately lose access to the "%1$sVacation" tab group, and it will be deleted from all devices.
+
+
+ Keep this group to add tabs later, or leave it if you no longer want access to it
+
+
+
+
+
+ Learn about shared tab groups
+
+
+ People with access
+
+
+ Anyone with the link can edit all tabs
+
+
+ Let anyone with the link join
+
+
+ Cancel
+
+
+
+%1$s1
@@ -6694,6 +6859,19 @@ To change this setting, BEGIN_LINKdelete the Brave da
Changed
+
+ Recent Activity
+
+
+ Recent activity bottom sheet
+
+
+ Recent activity bottom sheet opened at full height
+
+
+ Recent activity bottom sheet closed
+
+
Make sure you trust this site with your data
@@ -6762,7 +6940,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Open Settings
-
+
Identity Check is on and can’t verify it’s you
diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd
index 4aa05c52769c..326964f21edb 100644
--- a/browser/ui/android/strings/android_chrome_strings_override.grd
+++ b/browser/ui/android/strings/android_chrome_strings_override.grd
@@ -28,7 +28,7 @@ CHAR_LIMIT guidelines:
* Context menu items - 30 characters
* Action bar items - 32 characters
-->
-
+
@@ -170,7 +170,7 @@ CHAR_LIMIT guidelines:
Open in Private Brave tab
-
+
Unlock Private
@@ -204,7 +204,6 @@ CHAR_LIMIT guidelines:
Switch out of Private
-
Open in Private Brave
diff --git a/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java b/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java
index 327b0f5b4e50..6a45581449d1 100644
--- a/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java
+++ b/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java
@@ -38,6 +38,7 @@ class BraveBottomControlsMediator extends BottomControlsMediator {
FullscreenManager fullscreenManager,
TabObscuringHandler tabObscuringHandler,
int bottomControlsHeight,
+ int bottomControlsShadowHeight,
ObservableSupplier overlayPanelVisibilitySupplier,
ObservableSupplier edgeToEdgeControllerSupplier,
Supplier readAloudRestoringSupplier) {
@@ -49,6 +50,7 @@ class BraveBottomControlsMediator extends BottomControlsMediator {
fullscreenManager,
tabObscuringHandler,
bottomControlsHeight,
+ bottomControlsShadowHeight,
overlayPanelVisibilitySupplier,
edgeToEdgeControllerSupplier,
readAloudRestoringSupplier);
diff --git a/browser/ui/browser_commands.cc b/browser/ui/browser_commands.cc
index 7c19b8366885..46f6975df24f 100644
--- a/browser/ui/browser_commands.cc
+++ b/browser/ui/browser_commands.cc
@@ -131,7 +131,7 @@ std::optional GetActiveTabHandle(Browser* browser) {
}
const int active_tab_index = model->GetIndexOfWebContents(active_contents);
- return model->GetTabHandleAt(active_tab_index);
+ return model->GetTabAtIndex(active_tab_index)->GetHandle();
}
std::vector GetSelectedIndices(Browser* browser) {
@@ -1015,7 +1015,7 @@ void NewSplitViewForTab(Browser* browser,
}
auto* model = browser->tab_strip_model();
- const int tab_index = model->GetIndexOfTab(*tab);
+ const int tab_index = model->GetIndexOfTab(tab->Get());
const int new_tab_index = model->IsTabPinned(tab_index)
? model->IndexOfFirstNonPinnedTab()
: tab_index + 1;
@@ -1028,8 +1028,9 @@ void NewSplitViewForTab(Browser* browser,
/*foreground*/ true);
}
- split_view_data->TileTabs({.first = model->GetTabHandleAt(tab_index),
- .second = model->GetTabHandleAt(new_tab_index)});
+ split_view_data->TileTabs(
+ {.first = model->GetTabAtIndex(tab_index)->GetHandle(),
+ .second = model->GetTabAtIndex(new_tab_index)->GetHandle()});
}
void TileTabs(Browser* browser, const std::vector& indices) {
@@ -1057,15 +1058,16 @@ void TileTabs(Browser* browser, const std::vector& indices) {
auto* model = browser->tab_strip_model();
auto tab1 = indices[0];
auto tab2 = indices[1];
- CHECK(!split_view_data->IsTabTiled(model->GetTabHandleAt(tab1)));
- CHECK(!split_view_data->IsTabTiled(model->GetTabHandleAt(tab2)));
+ CHECK(!split_view_data->IsTabTiled(model->GetTabAtIndex(tab1)->GetHandle()));
+ CHECK(!split_view_data->IsTabTiled(model->GetTabAtIndex(tab2)->GetHandle()));
if (tab2 < tab1) {
std::swap(tab1, tab2);
}
- split_view_data->TileTabs({.first = model->GetTabHandleAt(tab1),
- .second = model->GetTabHandleAt(tab2)});
+ split_view_data->TileTabs(
+ {.first = model->GetTabAtIndex(tab1)->GetHandle(),
+ .second = model->GetTabAtIndex(tab2)->GetHandle()});
}
void BreakTiles(Browser* browser, const std::vector& indices) {
@@ -1081,7 +1083,7 @@ void BreakTiles(Browser* browser, const std::vector& indices) {
auto* model = browser->tab_strip_model();
for (auto index : indices) {
// The tile could have already been broken from the earlier iteration.
- if (auto tab_handle = model->GetTabHandleAt(index);
+ if (auto tab_handle = model->GetTabAtIndex(index)->GetHandle();
split_view_data->IsTabTiled(tab_handle)) {
split_view_data->BreakTile(tab_handle);
}
@@ -1105,7 +1107,8 @@ bool IsTabsTiled(Browser* browser, const std::vector& indices) {
auto* model = browser->tab_strip_model();
return base::ranges::any_of(indices, [&](auto index) {
- return split_view_data->IsTabTiled(model->GetTabHandleAt(index));
+ return split_view_data->IsTabTiled(
+ model->GetTabAtIndex(index)->GetHandle());
});
}
@@ -1129,7 +1132,8 @@ bool CanTileTabs(Browser* browser, const std::vector& indices) {
auto* model = browser->tab_strip_model();
return base::ranges::none_of(indices, [&](auto index) {
- return split_view_data->IsTabTiled(model->GetTabHandleAt(index));
+ return split_view_data->IsTabTiled(
+ model->GetTabAtIndex(index)->GetHandle());
});
}
@@ -1152,8 +1156,8 @@ void SwapTabsInTile(Browser* browser) {
auto tile = *split_view_data->GetTile(tab);
split_view_data->SwapTabsInTile(tile);
- model->MoveWebContentsAt(model->GetIndexOfTab(tile.second),
- model->GetIndexOfTab(tile.first),
+ model->MoveWebContentsAt(model->GetIndexOfTab(tile.second.Get()),
+ model->GetIndexOfTab(tile.first.Get()),
/*select_after_move*/ false);
}
diff --git a/browser/ui/omnibox/brave_omnibox_client_impl.cc b/browser/ui/omnibox/brave_omnibox_client_impl.cc
index 7f0a12ae7b37..d1f23c7a97eb 100644
--- a/browser/ui/omnibox/brave_omnibox_client_impl.cc
+++ b/browser/ui/omnibox/brave_omnibox_client_impl.cc
@@ -113,8 +113,7 @@ void BraveOmniboxClientImpl::OnAutocompleteAccept(
bool destination_url_entered_with_http_scheme,
const std::u16string& text,
const AutocompleteMatch& match,
- const AutocompleteMatch& alternative_nav_match,
- IDNA2008DeviationCharacter deviation_char_in_hostname) {
+ const AutocompleteMatch& alternative_nav_match) {
if (IsSearchEvent(match)) {
// TODO(iefremov): Optimize this.
search_storage_.AddDelta(1);
@@ -130,5 +129,5 @@ void BraveOmniboxClientImpl::OnAutocompleteAccept(
destination_url, post_content, disposition, transition, match_type,
match_selection_timestamp, destination_url_entered_without_scheme,
destination_url_entered_with_http_scheme, text, match,
- alternative_nav_match, deviation_char_in_hostname);
+ alternative_nav_match);
}
diff --git a/browser/ui/omnibox/brave_omnibox_client_impl.h b/browser/ui/omnibox/brave_omnibox_client_impl.h
index f82392019357..3ac1816cf18b 100644
--- a/browser/ui/omnibox/brave_omnibox_client_impl.h
+++ b/browser/ui/omnibox/brave_omnibox_client_impl.h
@@ -45,8 +45,7 @@ class BraveOmniboxClientImpl : public ChromeOmniboxClient {
bool destination_url_entered_with_http_scheme,
const std::u16string& text,
const AutocompleteMatch& match,
- const AutocompleteMatch& alternative_nav_match,
- IDNA2008DeviationCharacter deviation_char_in_hostname) override;
+ const AutocompleteMatch& alternative_nav_match) override;
private:
raw_ptr profile_ = nullptr;
diff --git a/browser/ui/startup/brave_startup_tab_provider_impl.cc b/browser/ui/startup/brave_startup_tab_provider_impl.cc
index 5401f7349f8e..7fddf73afe0e 100644
--- a/browser/ui/startup/brave_startup_tab_provider_impl.cc
+++ b/browser/ui/startup/brave_startup_tab_provider_impl.cc
@@ -5,16 +5,16 @@
#include "brave/browser/ui/startup/brave_startup_tab_provider_impl.h"
+#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/ui/startup/startup_tab.h"
-#include "chrome/common/webui_url_constants.h"
StartupTabs BraveStartupTabProviderImpl::GetDistributionFirstRunTabs(
StartupBrowserCreator* browser_creator) const {
StartupTabs tabs =
StartupTabProviderImpl::GetDistributionFirstRunTabs(browser_creator);
if (first_run::IsChromeFirstRun()) {
- tabs.emplace_back(GURL(chrome::kChromeUIWelcomeURL));
+ tabs.emplace_back(GURL(kWelcomeURL));
}
return tabs;
}
diff --git a/browser/ui/tabs/split_view_browser_data.cc b/browser/ui/tabs/split_view_browser_data.cc
index c7a61e2e7b73..36103086753b 100644
--- a/browser/ui/tabs/split_view_browser_data.cc
+++ b/browser/ui/tabs/split_view_browser_data.cc
@@ -32,7 +32,8 @@ void SplitViewBrowserData::TileTabs(const TabTile& tile) {
CHECK(!IsTabTiled(tile.second));
auto& model = tab_strip_model_adapter_.tab_strip_model();
- CHECK_LT(model.GetIndexOfTab(tile.first), model.GetIndexOfTab(tile.second));
+ CHECK_LT(model.GetIndexOfTab(tile.first.Get()),
+ model.GetIndexOfTab(tile.second.Get()));
tiles_.push_back(tile);
@@ -43,7 +44,7 @@ void SplitViewBrowserData::TileTabs(const TabTile& tile) {
tab_strip_model_adapter_.SynchronizePinnedState(tile, tile.first);
tabs_are_adjacent |= tab_strip_model_adapter_.SynchronizeGroupedState(
tile, /*source=*/tile.first,
- model.GetTabGroupForTab(model.GetIndexOfTab(tile.first)));
+ model.GetTabGroupForTab(model.GetIndexOfTab(tile.first.Get())));
if (!tabs_are_adjacent) {
tab_strip_model_adapter_.MakeTiledTabsAdjacent(tile);
diff --git a/browser/ui/tabs/split_view_tab_strip_model_adapter.cc b/browser/ui/tabs/split_view_tab_strip_model_adapter.cc
index 2f6671431248..8b02fb657531 100644
--- a/browser/ui/tabs/split_view_tab_strip_model_adapter.cc
+++ b/browser/ui/tabs/split_view_tab_strip_model_adapter.cc
@@ -29,10 +29,8 @@ SplitViewTabStripModelAdapter::~SplitViewTabStripModelAdapter() = default;
void SplitViewTabStripModelAdapter::MakeTiledTabsAdjacent(const TabTile& tile,
bool move_right_tab) {
- auto tab1 = tile.first;
- auto tab2 = tile.second;
- auto index1 = model_->GetIndexOfTab(tab1);
- auto index2 = model_->GetIndexOfTab(tab2);
+ auto index1 = model_->GetIndexOfTab(tile.first.Get());
+ auto index2 = model_->GetIndexOfTab(tile.second.Get());
if (index1 + 1 == index2) {
// Already adjacent
@@ -61,13 +59,13 @@ bool SplitViewTabStripModelAdapter::SynchronizeGroupedState(
DCHECK(!is_in_synch_grouped_state_);
base::AutoReset resetter(&is_in_synch_grouped_state_, true);
auto other_tab = tile.first == source ? tile.second : tile.first;
- auto other_tab_index = model_->GetIndexOfTab(other_tab);
+ auto other_tab_index = model_->GetIndexOfTab(other_tab.Get());
auto tab_group_for_secondary_tab = model_->GetTabGroupForTab(other_tab_index);
if (group == tab_group_for_secondary_tab) {
return false;
}
- auto tab_index = model_->GetIndexOfTab(other_tab);
+ auto tab_index = model_->GetIndexOfTab(other_tab.Get());
if (group) {
model_->AddToExistingGroup({tab_index}, group.value());
} else {
@@ -89,13 +87,13 @@ bool SplitViewTabStripModelAdapter::SynchronizePinnedState(
}
const bool source_tab_is_pinned =
- model_->IsTabPinned(model_->GetIndexOfTab(source));
+ model_->IsTabPinned(model_->GetIndexOfTab(source.Get()));
if (source_tab_is_pinned ==
- model_->IsTabPinned(model_->GetIndexOfTab(tab2))) {
+ model_->IsTabPinned(model_->GetIndexOfTab(tab2.Get()))) {
return false;
}
- model_->SetTabPinned(model_->GetIndexOfTab(tab2), source_tab_is_pinned);
+ model_->SetTabPinned(model_->GetIndexOfTab(tab2.Get()), source_tab_is_pinned);
MakeTiledTabsAdjacent(tile, true);
return true;
}
@@ -105,10 +103,8 @@ void SplitViewTabStripModelAdapter::TabDragEnded() {
// the tiles.
std::vector tiles_to_break;
for (const auto& tile : split_view_browser_data_->tiles()) {
- auto tab1 = tile.first;
- auto tab2 = tile.second;
- int index1 = model_->GetIndexOfTab(tab1);
- int index2 = model_->GetIndexOfTab(tab2);
+ int index1 = model_->GetIndexOfTab(tile.first.Get());
+ int index2 = model_->GetIndexOfTab(tile.second.Get());
if (index2 - index1 == 1) {
return;
}
@@ -166,8 +162,8 @@ void SplitViewTabStripModelAdapter::OnTabInserted(
std::vector indices_to_be_moved;
for (const auto& tile : split_view_browser_data_->tiles()) {
- auto lower_index = model_->GetIndexOfTab(tile.first);
- auto higher_index = model_->GetIndexOfTab(tile.second);
+ auto lower_index = model_->GetIndexOfTab(tile.first.Get());
+ auto higher_index = model_->GetIndexOfTab(tile.second.Get());
CHECK_LT(lower_index, higher_index);
for (auto inserted_index : inserted_indices) {
@@ -188,7 +184,8 @@ void SplitViewTabStripModelAdapter::OnTabInserted(
return;
}
- if (index != adapter->model_->GetIndexOfTab(tab)) [[unlikely]] {
+ if (index != adapter->model_->GetIndexOfTab(tab.Get()))
+ [[unlikely]] {
// Index changed. Cancel the move.
return;
}
@@ -196,8 +193,8 @@ void SplitViewTabStripModelAdapter::OnTabInserted(
adapter->model_->MoveWebContentsAt(index, index + 1,
/*select_after_move*/ false);
},
- weak_ptr_factory_.GetWeakPtr(), model_->GetTabHandleAt(index),
- index));
+ weak_ptr_factory_.GetWeakPtr(),
+ model_->GetTabAtIndex(index)->GetHandle(), index));
}
// TODO(sko) There're a few more things to consider
@@ -211,7 +208,8 @@ void SplitViewTabStripModelAdapter::OnTabMoved(
// In case a tiled tab is moved, we need to move the corresponding tile
// together
auto tab_handle =
- model_->GetTabHandleAt(model_->GetIndexOfWebContents(move->contents));
+ model_->GetTabAtIndex(model_->GetIndexOfWebContents(move->contents))
+ ->GetHandle();
auto tile = split_view_browser_data_->GetTile(tab_handle);
if (!tile) {
@@ -230,11 +228,11 @@ void SplitViewTabStripModelAdapter::OnTabWillBeRemoved(
content::WebContents* contents,
int index) {
auto get_web_contents_from_tab_handle = [this](tabs::TabHandle tab) {
- return model_->GetWebContentsAt(model_->GetIndexOfTab(tab));
+ return model_->GetWebContentsAt(model_->GetIndexOfTab(tab.Get()));
};
// In case a tiled tab is removed, we need to remove the corresponding tile
- if (auto tab = model_->GetTabHandleAt(index);
+ if (auto tab = model_->GetTabAtIndex(index)->GetHandle();
split_view_browser_data_->IsTabTiled(tab)) {
auto tile = *split_view_browser_data_->GetTile(tab);
@@ -252,7 +250,7 @@ void SplitViewTabStripModelAdapter::TabPinnedStateChanged(
int index) {
// In case a tiled tab is pinned or unpinned, we need to synchronize the other
// tab together.
- auto changed_tab_handle = model_->GetTabHandleAt(index);
+ auto changed_tab_handle = model_->GetTabAtIndex(index)->GetHandle();
auto tile = split_view_browser_data_->GetTile(changed_tab_handle);
if (!tile) {
@@ -260,7 +258,8 @@ void SplitViewTabStripModelAdapter::TabPinnedStateChanged(
}
auto source_tab =
- model_->GetTabHandleAt(model_->GetIndexOfWebContents(contents));
+ model_->GetTabAtIndex(model_->GetIndexOfWebContents(contents))
+ ->GetHandle();
DCHECK(tile->first == source_tab || tile->second == source_tab);
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
@@ -290,7 +289,7 @@ void SplitViewTabStripModelAdapter::TabGroupedStateChanged(
// In case a tiled tab is grouped or ungrouped, we need to synchronize the
// other tab together.
- auto changed_tab_handle = model_->GetTabHandleAt(index);
+ auto changed_tab_handle = model_->GetTabAtIndex(index)->GetHandle();
auto tile = split_view_browser_data_->GetTile(changed_tab_handle);
if (!tile) {
return;
diff --git a/browser/ui/tabs/test/brave_tab_strip_model_browsertest.cc b/browser/ui/tabs/test/brave_tab_strip_model_browsertest.cc
index ea0d241be583..f4b511b7a3b2 100644
--- a/browser/ui/tabs/test/brave_tab_strip_model_browsertest.cc
+++ b/browser/ui/tabs/test/brave_tab_strip_model_browsertest.cc
@@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "base/run_loop.h"
#include "brave/components/constants/pref_names.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
@@ -10,8 +11,41 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/prefs/pref_service.h"
+#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
+namespace {
+
+class TabVisibilityWaiter : public content::WebContentsObserver {
+ public:
+ explicit TabVisibilityWaiter(content::WebContents* web_contents)
+ : content::WebContentsObserver(web_contents) {}
+
+ TabVisibilityWaiter(const TabVisibilityWaiter&) = delete;
+ TabVisibilityWaiter& operator=(const TabVisibilityWaiter&) = delete;
+
+ ~TabVisibilityWaiter() override = default;
+
+ void WaitForTabToBecomeVisible() {
+ if (web_contents()->GetVisibility() == content::Visibility::VISIBLE) {
+ return;
+ }
+ visibility_changed_run_loop_.Run();
+ }
+
+ // content::WebContentsObserver:
+ void OnVisibilityChanged(content::Visibility visibility) override {
+ if (visibility == content::Visibility::VISIBLE) {
+ visibility_changed_run_loop_.Quit();
+ }
+ }
+
+ private:
+ base::RunLoop visibility_changed_run_loop_;
+};
+
+} // namespace
+
using BraveTabStripModelTest = InProcessBrowserTest;
IN_PROC_BROWSER_TEST_F(BraveTabStripModelTest, MRUCyclingBasic) {
@@ -20,12 +54,18 @@ IN_PROC_BROWSER_TEST_F(BraveTabStripModelTest, MRUCyclingBasic) {
// Open 3 tabs
chrome::NewTab(browser());
chrome::NewTab(browser());
- EXPECT_EQ(browser()->tab_strip_model()->count(), 3);
- EXPECT_EQ(browser()->tab_strip_model()->active_index(), 2);
+ EXPECT_EQ(tab_strip_model->count(), 3);
+ EXPECT_EQ(tab_strip_model->active_index(), 2);
+ // Before enabling MRU set up tab visibility waiter to make sure the activated
+ // tab's WebContents becomes visible which will update the last active time on
+ // which MRU relies to sort the tabs in MR order.
+ TabVisibilityWaiter tab_visibility_waiter(
+ tab_strip_model->GetWebContentsAt(0));
// Normal next tab expected by default, 2 -> 0
chrome::ExecuteCommand(browser(), IDC_SELECT_NEXT_TAB);
EXPECT_EQ(tab_strip_model->active_index(), 0);
+ tab_visibility_waiter.WaitForTabToBecomeVisible();
// Activate MRU cycling
browser()->profile()->GetPrefs()->SetBoolean(kMRUCyclingEnabled, true);
@@ -51,26 +91,42 @@ IN_PROC_BROWSER_TEST_F(BraveTabStripModelTest, TabClosingWhileMRUCycling) {
TabStripModel* tab_strip_model = browser()->tab_strip_model();
- // Open 3 tabs
+ // Open 3 tabs. There's some kind of timing issue or flakiness on MacOS that
+ // causes the tabs visibility not to be updated and the last active timestamp
+ // doesn't get changed. So we force the visibility here.
chrome::NewTab(browser());
+ tab_strip_model->GetWebContentsAt(1)->WasShown();
chrome::NewTab(browser());
+ tab_strip_model->GetWebContentsAt(2)->WasShown();
chrome::NewTab(browser());
- EXPECT_EQ(browser()->tab_strip_model()->count(), 4);
- EXPECT_EQ(browser()->tab_strip_model()->active_index(), 3);
+ tab_strip_model->GetWebContentsAt(3)->WasShown();
+ EXPECT_EQ(tab_strip_model->count(), 4);
+ EXPECT_EQ(tab_strip_model->active_index(), 3);
+ // MRU should be 3 > 2 > 1 > 0
// MRU cycling, 3 -> 2
chrome::ExecuteCommand(browser(), IDC_SELECT_NEXT_TAB);
EXPECT_EQ(tab_strip_model->active_index(), 2);
+ // Again, force visibility to update its last active timestamp.
+ tab_strip_model->GetWebContentsAt(2)->WasShown();
+ // MRU should be 2 > 1 > 0 > 3
// MRU cycling, 2 -> 1
chrome::ExecuteCommand(browser(), IDC_SELECT_NEXT_TAB);
EXPECT_EQ(tab_strip_model->active_index(), 1);
+ // MRU should be 1 > 0 > 3 > 2. No point in updating visibility since we are
+ // going to close the tab.
// Close current tab (index 1).
chrome::ExecuteCommand(browser(), IDC_CLOSE_TAB);
EXPECT_EQ(tab_strip_model->active_index(), 1);
+ // Again, force visibility to update its last active timestamp.
+ tab_strip_model->GetWebContentsAt(1)->WasShown();
+ // MRU restarts and resorts tabs by last active timestamp.
+ // MRU should be 1 (former 2) > 2 (former 3) > 0
- // New MRU cycling is started
+ // New MRU cycling is started, 1 -> 2
chrome::ExecuteCommand(browser(), IDC_SELECT_NEXT_TAB);
EXPECT_EQ(tab_strip_model->active_index(), 2);
+ // MRU should be: 2 > 0 > 1
}
diff --git a/browser/ui/tabs/test/split_view_tab_strip_model_adapter_browsertest.cc b/browser/ui/tabs/test/split_view_tab_strip_model_adapter_browsertest.cc
index 29c59d73820d..0105b3535f75 100644
--- a/browser/ui/tabs/test/split_view_tab_strip_model_adapter_browsertest.cc
+++ b/browser/ui/tabs/test/split_view_tab_strip_model_adapter_browsertest.cc
@@ -57,15 +57,17 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
/*foreground=*/true);
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground=*/true);
- auto secondary_tab = tab_strip_model()->GetTabHandleAt(3);
+ auto secondary_tab = tab_strip_model()->GetTabAtIndex(3)->GetHandle();
// When tiling two tabs that are not adjacent,
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0), secondary_tab});
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(0)));
+ data().TileTabs(
+ {tab_strip_model()->GetTabAtIndex(0)->GetHandle(), secondary_tab});
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(0)->GetHandle()));
ASSERT_TRUE(data().IsTabTiled(secondary_tab));
// Then the tabs should get adjacent.
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(secondary_tab));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(secondary_tab.Get()));
}
IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
@@ -81,10 +83,12 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
ASSERT_FALSE(tab_strip_model()->GetTabGroupForTab(2));
- data().TileTabs({tab_strip_model()->GetTabHandleAt(1),
- tab_strip_model()->GetTabHandleAt(2)});
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(2)));
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(1)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(2)->GetHandle()});
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(2)->GetHandle()));
base::RunLoop().RunUntilIdle();
// Then the other tab should be grouped too
@@ -109,10 +113,12 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
ASSERT_EQ(second_group_id, *tab_strip_model()->GetTabGroupForTab(2));
// When tiling with a tab in another group,
- data().TileTabs({tab_strip_model()->GetTabHandleAt(1),
- tab_strip_model()->GetTabHandleAt(2)});
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(2)));
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(1)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(2)->GetHandle()});
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(2)->GetHandle()));
base::RunLoop().RunUntilIdle();
// Then the other tab should be moved to the first tab's group
@@ -132,10 +138,12 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
ASSERT_FALSE(tab_strip_model()->IsTabPinned(1));
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(0)));
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
base::RunLoop().RunUntilIdle();
// Then the other tab should be pinned too
@@ -147,10 +155,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Given that two tabs are tiled
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- auto tab1 = tab_strip_model()->GetTabHandleAt(0);
- auto tab2 = tab_strip_model()->GetTabHandleAt(1);
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ auto tab1 = tab_strip_model()->GetTabAtIndex(0)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
ASSERT_TRUE(data().IsTabTiled(tab1));
ASSERT_TRUE(data().IsTabTiled(tab2));
@@ -165,8 +173,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
EXPECT_TRUE(data().IsTabTiled(tab1));
EXPECT_TRUE(data().IsTabTiled(tab2));
- EXPECT_EQ(tab1, tab_strip_model()->GetTabHandleAt(0));
- EXPECT_EQ(tab2, tab_strip_model()->GetTabHandleAt(1));
+ EXPECT_EQ(tab1, tab_strip_model()->GetTabAtIndex(0)->GetHandle());
+ EXPECT_EQ(tab2, tab_strip_model()->GetTabAtIndex(1)->GetHandle());
EXPECT_EQ(new_contents_ptr, tab_strip_model()->GetWebContentsAt(2));
}
@@ -179,10 +187,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
/*foreground*/ true);
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- auto tab1 = tab_strip_model()->GetTabHandleAt(0);
- auto tab2 = tab_strip_model()->GetTabHandleAt(1);
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ auto tab1 = tab_strip_model()->GetTabAtIndex(0)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
ASSERT_TRUE(data().IsTabTiled(tab1));
ASSERT_TRUE(data().IsTabTiled(tab2));
@@ -193,8 +201,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then the the tab should follow.
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2.Get()));
// when moving the left tab to the left
ASSERT_EQ(0,
@@ -203,8 +211,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then the the tab should follow.
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(0, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(0, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab2.Get()));
// When moving the right tab to the right,
ASSERT_EQ(2,
@@ -213,8 +221,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then the the tab should follow.
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2.Get()));
// When moving the right tab to the left,
ASSERT_EQ(0,
@@ -223,8 +231,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then the the tab should follow.
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(0, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(0, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab2.Get()));
}
IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
@@ -232,10 +240,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Given that two tabs are tiled
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- auto tab1 = tab_strip_model()->GetTabHandleAt(0);
- auto tab2 = tab_strip_model()->GetTabHandleAt(1);
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ auto tab1 = tab_strip_model()->GetTabAtIndex(0)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
ASSERT_TRUE(data().IsTabTiled(tab1));
ASSERT_TRUE(data().IsTabTiled(tab2));
@@ -252,40 +260,40 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Given that two tabs are tiled
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- auto tab1 = tab_strip_model()->GetTabHandleAt(0);
- auto tab2 = tab_strip_model()->GetTabHandleAt(1);
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ auto tab1 = tab_strip_model()->GetTabAtIndex(0)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
ASSERT_TRUE(data().IsTabTiled(tab1));
ASSERT_TRUE(data().IsTabTiled(tab2));
// When one of tab is pinned,
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1),
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1.Get()),
/*pinned*/ true);
// Then the other tab should be pinned together.
base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(
- tab_strip_model()->IsTabPinned(tab_strip_model()->GetIndexOfTab(tab2)));
+ EXPECT_TRUE(tab_strip_model()->IsTabPinned(
+ tab_strip_model()->GetIndexOfTab(tab2.Get())));
// Also unpinning is synced too.
tab_strip_model()->SetTabPinned(1, /*pinned*/ false);
base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(
- tab_strip_model()->IsTabPinned(tab_strip_model()->GetIndexOfTab(tab1)));
+ EXPECT_FALSE(tab_strip_model()->IsTabPinned(
+ tab_strip_model()->GetIndexOfTab(tab1.Get())));
// This also should be work the same with the other tab.
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2),
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2.Get()),
/*pinned*/ true);
base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(
- tab_strip_model()->IsTabPinned(tab_strip_model()->GetIndexOfTab(tab1)));
+ EXPECT_TRUE(tab_strip_model()->IsTabPinned(
+ tab_strip_model()->GetIndexOfTab(tab1.Get())));
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2),
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2.Get()),
/*pinned*/ false);
base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(
- tab_strip_model()->IsTabPinned(tab_strip_model()->GetIndexOfTab(tab1)));
+ EXPECT_FALSE(tab_strip_model()->IsTabPinned(
+ tab_strip_model()->GetIndexOfTab(tab1.Get())));
}
IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
@@ -298,11 +306,11 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
tab_strip_model()->AppendWebContents(CreateWebContents(),
/*foreground*/ true);
tab_strip_model()->SetTabPinned(0, /*pinned*/ true);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(2),
- tab_strip_model()->GetTabHandleAt(3)});
- auto non_tiled_tab = tab_strip_model()->GetTabHandleAt(1);
- auto tab1 = tab_strip_model()->GetTabHandleAt(2);
- auto tab2 = tab_strip_model()->GetTabHandleAt(3);
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(2)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(3)->GetHandle()});
+ auto non_tiled_tab = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
+ auto tab1 = tab_strip_model()->GetTabAtIndex(2)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(3)->GetHandle();
// |pin| |
// | x | non_tiled_tab, tab1, tab2 |
@@ -310,49 +318,49 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
ASSERT_TRUE(data().IsTabTiled(tab2));
// When one of tab is pinned,
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1),
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1.Get()),
/*pinned*/ true);
// Then the other tab should be pinned and moved to together.
// | pin | |
// | x, tab1, tab2 | non_tiled_tab |
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2.Get()));
// Also unpinning is synced too.
tab_strip_model()->SetTabPinned(
- tab_strip_model()->GetIndexOfTab(non_tiled_tab), true);
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1),
+ tab_strip_model()->GetIndexOfTab(non_tiled_tab.Get()), true);
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab1.Get()),
/*pinned*/ false);
// | pin | |
// | x, non_tiled_tab | tab1, tab2 |
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2.Get()));
// This should work when the right tab's pinned state changes
tab_strip_model()->SetTabPinned(
- tab_strip_model()->GetIndexOfTab(non_tiled_tab), false);
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2),
+ tab_strip_model()->GetIndexOfTab(non_tiled_tab.Get()), false);
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2.Get()),
/*pinned*/ true);
// | pin | |
// | x , tab1, tab2 | non_tiled_tab |
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2.Get()));
tab_strip_model()->SetTabPinned(3, true);
- tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2),
+ tab_strip_model()->SetTabPinned(tab_strip_model()->GetIndexOfTab(tab2.Get()),
/*pinned*/ false);
// | pin | |
// | x , non_tiled_tab | tab1, tab2 |
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(3, tab_strip_model()->GetIndexOfTab(tab2.Get()));
}
IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
@@ -368,11 +376,11 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
/*add_types*/ 0, group_id);
tab_strip_model()->InsertWebContentsAt(-1, CreateWebContents(),
/*add_types*/ 0, group_id);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(1),
- tab_strip_model()->GetTabHandleAt(2)});
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(1)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(2)->GetHandle()});
- auto tab1 = tab_strip_model()->GetTabHandleAt(1);
- auto tab2 = tab_strip_model()->GetTabHandleAt(2);
+ auto tab1 = tab_strip_model()->GetTabAtIndex(1)->GetHandle();
+ auto tab2 = tab_strip_model()->GetTabAtIndex(2)->GetHandle();
// When removing a tab from a group,
tab_strip_model()->RemoveFromGroup({1});
@@ -380,7 +388,7 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then the other should be inserted to the group together.
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(tab_strip_model()->GetTabGroupForTab(
- tab_strip_model()->GetIndexOfTab(tab2)));
+ tab_strip_model()->GetIndexOfTab(tab2.Get())));
// When adding a tab to a group,
tab_strip_model()->AddToExistingGroup({2}, group_id);
@@ -388,8 +396,8 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
// Then The other tab should be grouped too
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(tab_strip_model()->GetTabGroupForTab(1));
- EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1));
- EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2));
+ EXPECT_EQ(1, tab_strip_model()->GetIndexOfTab(tab1.Get()));
+ EXPECT_EQ(2, tab_strip_model()->GetIndexOfTab(tab2.Get()));
}
IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
@@ -401,27 +409,36 @@ IN_PROC_BROWSER_TEST_F(SplitViewTabStripModelAdapterBrowserTest,
tab_strip_model()->AddWebContents(CreateWebContents(), -1,
ui::PageTransition::PAGE_TRANSITION_TYPED,
/*add_types=*/0);
- data().TileTabs({tab_strip_model()->GetTabHandleAt(0),
- tab_strip_model()->GetTabHandleAt(1)});
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(0)));
- ASSERT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
- ASSERT_FALSE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(2)));
+ data().TileTabs({tab_strip_model()->GetTabAtIndex(0)->GetHandle(),
+ tab_strip_model()->GetTabAtIndex(1)->GetHandle()});
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
+ ASSERT_FALSE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(2)->GetHandle()));
// When moving non-tiled tab between tiled tabs
adapter().TabDragStarted();
tab_strip_model()->MoveWebContentsAt(2, 1, /*select_after_move*/ false);
// Then the tile should be kept during drag and drop session
- EXPECT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(0)));
- EXPECT_FALSE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
- EXPECT_TRUE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(2)));
+ EXPECT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(0)->GetHandle()));
+ EXPECT_FALSE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
+ EXPECT_TRUE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(2)->GetHandle()));
// When drag-and-drop session ends
adapter().TabDragEnded();
// Then the tile should be broken.
base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(0)));
- EXPECT_FALSE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(1)));
- EXPECT_FALSE(data().IsTabTiled(tab_strip_model()->GetTabHandleAt(2)));
+ EXPECT_FALSE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(0)->GetHandle()));
+ EXPECT_FALSE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(1)->GetHandle()));
+ EXPECT_FALSE(
+ data().IsTabTiled(tab_strip_model()->GetTabAtIndex(2)->GetHandle()));
}
diff --git a/browser/ui/toolbar/app_menu_icons.cc b/browser/ui/toolbar/app_menu_icons.cc
index ee4dd4d383d6..5c6a4ec07e1d 100644
--- a/browser/ui/toolbar/app_menu_icons.cc
+++ b/browser/ui/toolbar/app_menu_icons.cc
@@ -109,7 +109,7 @@ const std::map& GetCommandIcons() {
{IDC_SHOW_APPS_PAGE, kLeoGrid04Icon},
{IDC_PERFORMANCE, kLeoNetworkSpeedFastIcon},
{IDC_DEV_TOOLS, kLeoCodeIcon},
- {IDC_TASK_MANAGER, kLeoWindowBinaryCodeIcon},
+ {IDC_TASK_MANAGER_APP_MENU, kLeoWindowBinaryCodeIcon},
{IDC_SHOW_BRAVE_SYNC, kLeoProductSyncIcon},
{IDC_ROUTE_MEDIA, kLeoChromeCastIcon},
{IDC_SIDEBAR_SHOW_OPTION_MENU, kLeoBrowserSidebarRightIcon},
diff --git a/browser/ui/toolbar/brave_app_menu_model.cc b/browser/ui/toolbar/brave_app_menu_model.cc
index eeaffb4aa064..423a2e36bc91 100644
--- a/browser/ui/toolbar/brave_app_menu_model.cc
+++ b/browser/ui/toolbar/brave_app_menu_model.cc
@@ -318,8 +318,8 @@ void BraveAppMenuModel::BuildMoreToolsSubMenu() {
}
#endif
- if (auto index =
- more_tools_menu_model->GetIndexOfCommandId(IDC_TASK_MANAGER)) {
+ if (auto index = more_tools_menu_model->GetIndexOfCommandId(
+ IDC_TASK_MANAGER_APP_MENU)) {
more_tools_menu_model->InsertItemWithStringIdAt(*index, IDC_DEV_TOOLS,
IDS_DEV_TOOLS);
}
@@ -381,7 +381,8 @@ void BraveAppMenuModel::RemoveUpstreamMenus() {
// item. Otherwise, remove separator and item both.
DCHECK_EQ(ui::MenuModel::TYPE_SEPARATOR,
more_tools_model->GetTypeAt((*index) - 1));
- if (!more_tools_model->GetIndexOfCommandId(IDC_TASK_MANAGER).has_value()) {
+ if (!more_tools_model->GetIndexOfCommandId(IDC_TASK_MANAGER_APP_MENU)
+ .has_value()) {
more_tools_model->RemoveItemAt((*index) - 1);
} else {
more_tools_model->RemoveItemAt(*index);
diff --git a/browser/ui/toolbar/brave_app_menu_model_browsertest.cc b/browser/ui/toolbar/brave_app_menu_model_browsertest.cc
index 58a154be3c57..8c3df1e4d5d7 100644
--- a/browser/ui/toolbar/brave_app_menu_model_browsertest.cc
+++ b/browser/ui/toolbar/brave_app_menu_model_browsertest.cc
@@ -209,7 +209,7 @@ IN_PROC_BROWSER_TEST_F(BraveAppMenuModelBrowserTest, MenuOrderTest) {
std::vector more_tools_in_order = {
IDC_ADD_NEW_PROFILE, IDC_OPEN_GUEST_PROFILE, IDC_SHOW_BRAVE_SYNC,
- IDC_SHOW_APPS_PAGE, IDC_DEV_TOOLS, IDC_TASK_MANAGER,
+ IDC_SHOW_APPS_PAGE, IDC_DEV_TOOLS, IDC_TASK_MANAGER_APP_MENU,
};
if (!syncer::IsSyncAllowedByFlag()) {
@@ -312,7 +312,7 @@ IN_PROC_BROWSER_TEST_F(BraveAppMenuModelBrowserTest, MenuOrderTest) {
std::vector more_tools_in_order_for_guest_profile = {
IDC_DEV_TOOLS,
- IDC_TASK_MANAGER,
+ IDC_TASK_MANAGER_APP_MENU,
};
CheckMoreToolsCommandsAreInOrderInMenuModel(
guest_browser, more_tools_in_order_for_guest_profile);
diff --git a/browser/ui/toolbar/brave_bookmark_context_menu_controller.cc b/browser/ui/toolbar/brave_bookmark_context_menu_controller.cc
index dbe6332ae46e..3ea506208f25 100644
--- a/browser/ui/toolbar/brave_bookmark_context_menu_controller.cc
+++ b/browser/ui/toolbar/brave_bookmark_context_menu_controller.cc
@@ -28,7 +28,6 @@ BraveBookmarkContextMenuController::BraveBookmarkContextMenuController(
Browser* browser,
Profile* profile,
BookmarkLaunchLocation opened_from,
- const bookmarks::BookmarkNode* parent,
const std::vector<
raw_ptr>& selection)
: BookmarkContextMenuController(parent_window,
@@ -36,7 +35,6 @@ BraveBookmarkContextMenuController::BraveBookmarkContextMenuController(
browser,
profile,
opened_from,
- parent,
selection),
browser_(browser),
prefs_(browser_ ? browser_->profile()->GetPrefs() : nullptr) {
diff --git a/browser/ui/toolbar/brave_bookmark_context_menu_controller.h b/browser/ui/toolbar/brave_bookmark_context_menu_controller.h
index 8a77feb0cb0a..3405a180038d 100644
--- a/browser/ui/toolbar/brave_bookmark_context_menu_controller.h
+++ b/browser/ui/toolbar/brave_bookmark_context_menu_controller.h
@@ -31,7 +31,6 @@ class BraveBookmarkContextMenuController
Browser* browser,
Profile* profile,
BookmarkLaunchLocation opened_from,
- const bookmarks::BookmarkNode* parent,
const std::vector>& selection);
diff --git a/browser/ui/toolbar/brave_bookmark_context_menu_controller_unittest.cc b/browser/ui/toolbar/brave_bookmark_context_menu_controller_unittest.cc
index 7c5a99e0884a..b33380ad4b72 100644
--- a/browser/ui/toolbar/brave_bookmark_context_menu_controller_unittest.cc
+++ b/browser/ui/toolbar/brave_bookmark_context_menu_controller_unittest.cc
@@ -68,9 +68,7 @@ TEST_F(BraveBookmarkContextMenuControllerTest,
BookmarkContextMenuController controller(
nullptr, nullptr, nullptr, profile_.get(),
BookmarkLaunchLocation::kSidePanelContextMenu,
- model_->bookmark_bar_node(),
- std::vector<
- raw_ptr>());
+ {model_->bookmark_bar_node()});
// Show apps command is not present by default.
sync_preferences::TestingPrefServiceSyncable* prefs =
@@ -107,9 +105,7 @@ TEST_F(BraveBookmarkContextMenuControllerTest,
TEST_F(BraveBookmarkContextMenuControllerTest, AddBraveBookmarksSubmenu) {
BraveBookmarkContextMenuController controller(
nullptr, nullptr, nullptr, profile_.get(),
- BookmarkLaunchLocation::kSidePanelFolder, model_->bookmark_bar_node(),
- std::vector<
- raw_ptr>());
+ BookmarkLaunchLocation::kSidePanelFolder, {model_->bookmark_bar_node()});
EXPECT_FALSE(controller.menu_model()
->GetIndexOfCommandId(IDC_BOOKMARK_BAR_ALWAYS_SHOW)
.has_value());
diff --git a/browser/ui/views/bookmarks/brave_bookmark_bar_view.cc b/browser/ui/views/bookmarks/brave_bookmark_bar_view.cc
index 8b329da029b4..31fc3b0a1553 100644
--- a/browser/ui/views/bookmarks/brave_bookmark_bar_view.cc
+++ b/browser/ui/views/bookmarks/brave_bookmark_bar_view.cc
@@ -27,7 +27,8 @@ BraveBookmarkBarView::BraveBookmarkBarView(Browser* browser,
BraveBookmarkBarView::~BraveBookmarkBarView() = default;
void BraveBookmarkBarView::MaybeUpdateOtherAndManagedButtonsVisibility() {
- if (bookmark_model_ && bookmark_model_->loaded()) {
+ if (bookmark_service_ && bookmark_service_->bookmark_model() &&
+ bookmark_service_->bookmark_model()->loaded()) {
UpdateOtherAndManagedButtonsVisibility();
}
}
diff --git a/browser/ui/views/bookmarks/brave_bookmark_context_menu.cc b/browser/ui/views/bookmarks/brave_bookmark_context_menu.cc
index 243b98ef1319..2fdf038e67ee 100644
--- a/browser/ui/views/bookmarks/brave_bookmark_context_menu.cc
+++ b/browser/ui/views/bookmarks/brave_bookmark_context_menu.cc
@@ -19,7 +19,6 @@ BraveBookmarkContextMenu::BraveBookmarkContextMenu(
Browser* browser,
Profile* profile,
BookmarkLaunchLocation opened_from,
- const bookmarks::BookmarkNode* parent,
const std::vector<
raw_ptr>& selection,
bool close_on_remove)
@@ -27,7 +26,6 @@ BraveBookmarkContextMenu::BraveBookmarkContextMenu(
browser,
profile,
opened_from,
- parent,
selection,
close_on_remove) {
auto* submenu = menu()->GetMenuItemByID(IDC_BRAVE_BOOKMARK_BAR_SUBMENU);
diff --git a/browser/ui/views/bookmarks/brave_bookmark_context_menu.h b/browser/ui/views/bookmarks/brave_bookmark_context_menu.h
index 4c2fc9a9ff9b..7958e97c2fc3 100644
--- a/browser/ui/views/bookmarks/brave_bookmark_context_menu.h
+++ b/browser/ui/views/bookmarks/brave_bookmark_context_menu.h
@@ -19,7 +19,6 @@ class BraveBookmarkContextMenu : public BookmarkContextMenu {
Browser* browser,
Profile* profile,
BookmarkLaunchLocation opened_from,
- const bookmarks::BookmarkNode* parent,
const std::vector>& selection,
bool close_on_remove);
diff --git a/browser/ui/views/bookmarks/brave_bookmark_context_menu_unittest.cc b/browser/ui/views/bookmarks/brave_bookmark_context_menu_unittest.cc
index 2821cd9cd158..8438bdbe76f8 100644
--- a/browser/ui/views/bookmarks/brave_bookmark_context_menu_unittest.cc
+++ b/browser/ui/views/bookmarks/brave_bookmark_context_menu_unittest.cc
@@ -59,11 +59,10 @@ class BraveBookmarkContextMenuTest : public testing::Test {
protected:
std::unique_ptr CreateBookmarkContextMenu() {
+ std::vector> nodes = {
+ model_->bookmark_bar_node()};
auto menu = std::make_unique(
- nullptr, nullptr, profile_.get(), BookmarkLaunchLocation::kNone,
- nullptr,
- std::vector<
- raw_ptr>(),
+ nullptr, nullptr, profile_.get(), BookmarkLaunchLocation::kNone, nodes,
false);
menu->GetControllerForTesting()->SetPrefsForTesting(prefs_.get());
return menu;
diff --git a/browser/ui/views/brave_actions/brave_shields_action_view.cc b/browser/ui/views/brave_actions/brave_shields_action_view.cc
index 6fb80d28259e..64e38cf94c7a 100644
--- a/browser/ui/views/brave_actions/brave_shields_action_view.cc
+++ b/browser/ui/views/brave_actions/brave_shields_action_view.cc
@@ -275,7 +275,7 @@ BraveShieldsActionView::CreateDefaultBorder() const {
return border;
}
-std::u16string BraveShieldsActionView::GetTooltipText(
+std::u16string BraveShieldsActionView::GetRenderedTooltipText(
const gfx::Point& p) const {
auto* web_contents = tab_strip_model_->GetActiveWebContents();
diff --git a/browser/ui/views/brave_actions/brave_shields_action_view.h b/browser/ui/views/brave_actions/brave_shields_action_view.h
index fb219b3c7185..efdd136f8cf0 100644
--- a/browser/ui/views/brave_actions/brave_shields_action_view.h
+++ b/browser/ui/views/brave_actions/brave_shields_action_view.h
@@ -40,7 +40,7 @@ class BraveShieldsActionView
// views::LabelButton:
std::unique_ptr CreateDefaultBorder()
const override;
- std::u16string GetTooltipText(const gfx::Point& p) const override;
+ std::u16string GetRenderedTooltipText(const gfx::Point& p) const override;
void OnThemeChanged() override;
SkPath GetHighlightPath() const;
diff --git a/browser/ui/views/brave_javascript_tab_modal_dialog_view_views.cc b/browser/ui/views/brave_javascript_tab_modal_dialog_view_views.cc
index 875106509a06..08f17502a66a 100644
--- a/browser/ui/views/brave_javascript_tab_modal_dialog_view_views.cc
+++ b/browser/ui/views/brave_javascript_tab_modal_dialog_view_views.cc
@@ -134,8 +134,10 @@ gfx::Point BraveJavaScriptTabModalDialogViewViews::
}
auto* tab_strip_model = browser->tab_strip_model();
- auto tab_handle = tab_strip_model->GetTabHandleAt(
- tab_strip_model->GetIndexOfWebContents(base::to_address(web_contents_)));
+ auto tab_handle = tab_strip_model
+ ->GetTabAtIndex(tab_strip_model->GetIndexOfWebContents(
+ base::to_address(web_contents_)))
+ ->GetHandle();
auto* split_view_browser_data = SplitViewBrowserData::FromBrowser(browser);
CHECK(split_view_browser_data);
diff --git a/browser/ui/views/crash_report_permission_ask_dialog_view.cc b/browser/ui/views/crash_report_permission_ask_dialog_view.cc
index 7e70d9d27a77..03d0eb7ef64e 100644
--- a/browser/ui/views/crash_report_permission_ask_dialog_view.cc
+++ b/browser/ui/views/crash_report_permission_ask_dialog_view.cc
@@ -238,7 +238,8 @@ void CrashReportPermissionAskDialogView::OnWidgetInitialized() {
void CrashReportPermissionAskDialogView::OnAcceptButtonClicked() {
// Enable crash reporting.
- ChangeMetricsReportingState(true);
+ ChangeMetricsReportingState(
+ true, ChangeMetricsReportingStateCalledFrom::kSessionCrashedDialog);
}
void CrashReportPermissionAskDialogView::OnWindowClosing() {
diff --git a/browser/ui/views/download/bubble/BUILD.gn b/browser/ui/views/download/bubble/BUILD.gn
index 4e536d4c12a1..2da4d06060df 100644
--- a/browser/ui/views/download/bubble/BUILD.gn
+++ b/browser/ui/views/download/bubble/BUILD.gn
@@ -12,6 +12,7 @@ source_set("unit_tests") {
"//base",
"//chrome/browser",
"//chrome/browser/download",
+ "//chrome/browser/ui/views/download",
"//chrome/test:test_support",
"//components/download/public/common:test_support",
"//components/safe_browsing/core/common",
diff --git a/browser/ui/views/frame/brave_browser_view.cc b/browser/ui/views/frame/brave_browser_view.cc
index 00500d98470d..2f5ed9a768da 100644
--- a/browser/ui/views/frame/brave_browser_view.cc
+++ b/browser/ui/views/frame/brave_browser_view.cc
@@ -338,13 +338,10 @@ void BraveBrowserView::UpdateSideBarHorizontalAlignment() {
}
void BraveBrowserView::UpdateSearchTabsButtonState() {
- if (auto* tab_search_container =
- tab_strip_region_view()->tab_search_container()) {
- if (auto* button = tab_search_container->tab_search_button()) {
- auto is_tab_search_visible =
- GetProfile()->GetPrefs()->GetBoolean(kTabsSearchShow);
- button->SetVisible(is_tab_search_visible);
- }
+ if (auto* tab_search_button = tab_strip_region_view_->GetTabSearchButton()) {
+ auto is_tab_search_visible =
+ GetProfile()->GetPrefs()->GetBoolean(kTabsSearchShow);
+ tab_search_button->SetVisible(is_tab_search_visible);
}
}
diff --git a/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc b/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc
index 4c2550c45301..14346b7718c6 100644
--- a/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc
+++ b/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc
@@ -35,14 +35,7 @@ IN_PROC_BROWSER_TEST_F(BraveTabsSearchButtonTest, HideShowSettingTest) {
views::View* button = nullptr;
auto* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
- auto* tab_search_container =
- browser_view->tab_strip_region_view()->tab_search_container();
- if (!tab_search_container) {
- return;
- }
- button = browser_view->tab_strip_region_view()
- ->tab_search_container()
- ->tab_search_button();
+ button = browser_view->tab_strip_region_view()->GetTabSearchButton();
ASSERT_NE(nullptr, button);
EXPECT_TRUE(button->GetVisible());
diff --git a/browser/ui/views/frame/vertical_tab_strip_region_view.cc b/browser/ui/views/frame/vertical_tab_strip_region_view.cc
index aa3461fbf51a..b6eb1b2e3246 100644
--- a/browser/ui/views/frame/vertical_tab_strip_region_view.cc
+++ b/browser/ui/views/frame/vertical_tab_strip_region_view.cc
@@ -107,7 +107,7 @@ class ToggleButton : public ToolbarButton {
}
}
- std::u16string GetTooltipText(const gfx::Point& p) const override {
+ std::u16string GetRenderedTooltipText(const gfx::Point& p) const override {
if (region_view_->state() == VerticalTabStripRegionView::State::kExpanded) {
return l10n_util::GetStringUTF16(IDS_VERTICAL_TABS_MINIMIZE);
}
@@ -132,11 +132,15 @@ class VerticalTabSearchButton : public BraveTabSearchButton {
TabStripController* tab_strip_controller,
BrowserWindowInterface* browser_window_interface,
Edge fixed_flat_edge,
- Edge animated_flat_edge)
+ Edge animated_flat_edge,
+ views::View* anchor_view,
+ TabStrip* tab_strip)
: BraveTabSearchButton(tab_strip_controller,
browser_window_interface,
fixed_flat_edge,
- animated_flat_edge) {
+ animated_flat_edge,
+ anchor_view,
+ tab_strip) {
SetPreferredSize(
gfx::Size{ToggleButton::GetIconWidth(), ToggleButton::GetIconWidth()});
SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_SEARCH));
@@ -477,7 +481,8 @@ class VerticalTabStripRegionView::HeaderView : public views::View {
// way to change its bubble arrow from TOP_RIGHT at the moment.
tab_search_button_ = AddChildView(std::make_unique(
region_view, region_view->tab_strip()->controller(),
- browser_window_interface, Edge::kNone, Edge::kNone));
+ browser_window_interface, Edge::kNone, Edge::kNone, this,
+ region_view->tab_strip()));
UpdateTabSearchButtonVisibility();
vertical_tab_on_right_.Init(
@@ -1195,7 +1200,7 @@ void VerticalTabStripRegionView::AnimationEnded(
void VerticalTabStripRegionView::UpdateNewTabButtonVisibility() {
const bool is_vertical_tabs = tabs::utils::ShouldShowVerticalTabs(browser_);
- auto* original_ntb = original_region_view_->new_tab_button();
+ auto* original_ntb = original_region_view_->GetNewTabButton();
original_ntb->SetVisible(!is_vertical_tabs);
new_tab_button_->SetVisible(is_vertical_tabs);
separator_->SetVisible(is_vertical_tabs);
@@ -1224,11 +1229,8 @@ void VerticalTabStripRegionView::UpdateOriginalTabSearchButtonVisibility() {
const bool is_vertical_tabs = tabs::utils::ShouldShowVerticalTabs(browser_);
const bool use_search_button =
browser_->profile()->GetPrefs()->GetBoolean(kTabsSearchShow);
- if (auto* tab_search_container =
- original_region_view_->tab_search_container()) {
- if (auto* tab_search_button = tab_search_container->tab_search_button()) {
- tab_search_button->SetVisible(!is_vertical_tabs && use_search_button);
- }
+ if (auto* tab_search_button = original_region_view_->GetTabSearchButton()) {
+ tab_search_button->SetVisible(!is_vertical_tabs && use_search_button);
}
}
diff --git a/browser/ui/views/sidebar/sidebar_button_view.cc b/browser/ui/views/sidebar/sidebar_button_view.cc
index b94a2b689a7e..ba933f422e9e 100644
--- a/browser/ui/views/sidebar/sidebar_button_view.cc
+++ b/browser/ui/views/sidebar/sidebar_button_view.cc
@@ -31,6 +31,7 @@ SidebarButtonView::SidebarButtonView(const std::u16string& accessible_name) {
// Views resulting in focusable nodes later on in the accessibility tree need
// to have an accessible name for screen readers to see what they are about.
SetAccessibleName(accessible_name);
+ SetTooltipText(accessible_name);
}
SidebarButtonView::~SidebarButtonView() = default;
@@ -52,9 +53,5 @@ gfx::Size SidebarButtonView::CalculatePreferredSize(
return {kSidebarButtonSize + kMargin * 2, kSidebarButtonSize};
}
-std::u16string SidebarButtonView::GetTooltipText(const gfx::Point& p) const {
- return GetAccessibleName();
-}
-
BEGIN_METADATA(SidebarButtonView)
END_METADATA
diff --git a/browser/ui/views/sidebar/sidebar_button_view.h b/browser/ui/views/sidebar/sidebar_button_view.h
index c95508816ade..991f48d565d2 100644
--- a/browser/ui/views/sidebar/sidebar_button_view.h
+++ b/browser/ui/views/sidebar/sidebar_button_view.h
@@ -28,7 +28,6 @@ class SidebarButtonView : public views::ImageButton {
void OnThemeChanged() override;
gfx::Size CalculatePreferredSize(
const views::SizeBounds& available_size) const override;
- std::u16string GetTooltipText(const gfx::Point& p) const override;
};
#endif // BRAVE_BROWSER_UI_VIEWS_SIDEBAR_SIDEBAR_BUTTON_VIEW_H_
diff --git a/browser/ui/views/sidebar/sidebar_items_scroll_view.cc b/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
index fe10645b292e..f22184a84456 100644
--- a/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
+++ b/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
@@ -468,7 +468,8 @@ bool SidebarItemsScrollView::IsInVisibleContentsViewBounds(
bool SidebarItemsScrollView::GetDropFormats(
int* formats,
std::set* format_types) {
- format_types->insert(ui::ClipboardFormatType::GetType(kSidebarItemDragType));
+ format_types->insert(
+ ui::ClipboardFormatType::CustomPlatformType(kSidebarItemDragType));
return true;
}
@@ -480,7 +481,7 @@ bool SidebarItemsScrollView::CanDrop(const OSExchangeData& data) {
}
return data.HasCustomFormat(
- ui::ClipboardFormatType::GetType(kSidebarItemDragType));
+ ui::ClipboardFormatType::CustomPlatformType(kSidebarItemDragType));
}
void SidebarItemsScrollView::OnDragExited() {
@@ -543,8 +544,9 @@ void SidebarItemsScrollView::WriteDragDataForView(views::View* sender,
item_view->GetImage(views::Button::STATE_NORMAL),
press_pt.OffsetFromOrigin());
- data->SetPickledData(ui::ClipboardFormatType::GetType(kSidebarItemDragType),
- base::Pickle());
+ data->SetPickledData(
+ ui::ClipboardFormatType::CustomPlatformType(kSidebarItemDragType),
+ base::Pickle());
}
int SidebarItemsScrollView::GetDragOperationsForView(views::View* sender,
diff --git a/browser/ui/views/split_view/split_view.cc b/browser/ui/views/split_view/split_view.cc
index 0db28f12c62b..8e64de360a27 100644
--- a/browser/ui/views/split_view/split_view.cc
+++ b/browser/ui/views/split_view/split_view.cc
@@ -242,7 +242,7 @@ tabs::TabHandle SplitView::GetActiveTabHandle() const {
if (model->empty()) {
return {};
}
- return model->GetTabHandleAt(model->active_index());
+ return model->GetTabAtIndex(model->active_index())->GetHandle();
}
bool SplitView::IsActiveWebContentsTiled(const TabTile& tile) const {
@@ -257,7 +257,7 @@ bool SplitView::IsWebContentsTiled(content::WebContents* contents) const {
return false;
}
const auto tab_handle =
- browser_->tab_strip_model()->GetTabHandleAt(tab_index);
+ browser_->tab_strip_model()->GetTabAtIndex(tab_index)->GetHandle();
return SplitViewBrowserData::FromBrowser(base::to_address(browser_))
->IsTabTiled(tab_handle);
}
@@ -276,7 +276,9 @@ void SplitView::UpdateSplitViewSizeDelta(content::WebContents* old_contents,
auto* split_view_browser_data =
SplitViewBrowserData::FromBrowser(base::to_address(browser_));
auto get_tab_handle = [this, &get_index_of](content::WebContents* contents) {
- return browser_->tab_strip_model()->GetTabHandleAt(get_index_of(contents));
+ return browser_->tab_strip_model()
+ ->GetTabAtIndex(get_index_of(contents))
+ ->GetHandle();
};
auto old_tab_handle = get_tab_handle(old_contents);
auto new_tab_handle = get_tab_handle(new_contents);
@@ -390,7 +392,8 @@ void SplitView::UpdateSecondaryContentsWebViewVisibility() {
// Contents | secondary_contents_web_view_ | contents_web_view_ |
auto* model = browser_->tab_strip_model();
auto* contents = model->GetWebContentsAt(model->GetIndexOfTab(
- second_tile_is_active_web_contents ? tile->first : tile->second));
+ second_tile_is_active_web_contents ? tile->first.Get()
+ : tile->second.Get()));
CHECK_NE(contents, contents_web_view_->web_contents());
if (secondary_contents_web_view_->web_contents() != contents) {
secondary_contents_web_view_->SetWebContents(contents);
diff --git a/browser/ui/views/split_view/split_view_browsertest.cc b/browser/ui/views/split_view/split_view_browsertest.cc
index e004162dd098..a4701f2202ad 100644
--- a/browser/ui/views/split_view/split_view_browsertest.cc
+++ b/browser/ui/views/split_view/split_view_browsertest.cc
@@ -100,8 +100,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
brave::NewSplitViewForTab(browser());
auto* split_view_data = SplitViewBrowserData::FromBrowser(browser());
ASSERT_TRUE(split_view_data);
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(1)));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(1)->GetHandle()));
// Secondary web view should become visible
EXPECT_TRUE(secondary_contents_container().GetVisible());
@@ -113,13 +115,15 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
brave::NewSplitViewForTab(browser());
auto* split_view_data = SplitViewBrowserData::FromBrowser(browser());
ASSERT_TRUE(split_view_data);
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(1)));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(1)->GetHandle()));
// When breaking the tile
- split_view_data->BreakTile(tab_strip_model().GetTabHandleAt(0));
- ASSERT_FALSE(
- split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
+ split_view_data->BreakTile(tab_strip_model().GetTabAtIndex(0)->GetHandle());
+ ASSERT_FALSE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
// Then, the secondary web view should become hidden
EXPECT_FALSE(secondary_contents_container().GetVisible());
@@ -131,8 +135,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
brave::NewSplitViewForTab(browser());
auto* split_view_data = SplitViewBrowserData::FromBrowser(browser());
ASSERT_TRUE(split_view_data);
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(1)));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(1)->GetHandle()));
chrome::AddTabAt(browser(), GURL(), -1, /*foreground*/ false);
ASSERT_TRUE(secondary_contents_container().GetVisible());
@@ -151,8 +157,10 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
brave::NewSplitViewForTab(browser());
auto* split_view_data = SplitViewBrowserData::FromBrowser(browser());
ASSERT_TRUE(split_view_data);
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(1)));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(1)->GetHandle()));
chrome::AddTabAt(browser(), GURL(), -1, /*foreground*/ true);
ASSERT_FALSE(secondary_contents_container().GetVisible());
@@ -170,33 +178,42 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
brave::NewSplitViewForTab(browser());
auto* split_view_data = SplitViewBrowserData::FromBrowser(browser());
ASSERT_TRUE(split_view_data);
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));
- ASSERT_TRUE(split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(1)));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle()));
+ ASSERT_TRUE(split_view_data->IsTabTiled(
+ tab_strip_model().GetTabAtIndex(1)->GetHandle()));
ASSERT_TRUE(secondary_contents_container().GetVisible());
- auto tile = *split_view_data->GetTile(tab_strip_model().GetTabHandleAt(0));
+ auto tile = *split_view_data->GetTile(
+ tab_strip_model().GetTabAtIndex(0)->GetHandle());
// When the tile.first is active contents,
- tab_strip_model().ActivateTabAt(tab_strip_model().GetIndexOfTab(tile.first));
+ tab_strip_model().ActivateTabAt(
+ tab_strip_model().GetIndexOfTab(tile.first.Get()));
auto active_tab_handle =
- tab_strip_model().GetTabHandleAt(tab_strip_model().GetIndexOfWebContents(
- tab_strip_model().GetActiveWebContents()));
+ tab_strip_model()
+ .GetTabAtIndex(tab_strip_model().GetIndexOfWebContents(
+ tab_strip_model().GetActiveWebContents()))
+ ->GetHandle();
ASSERT_EQ(active_tab_handle, tile.first);
// Then the secondary web view should hold the tile.second
EXPECT_EQ(tab_strip_model().GetWebContentsAt(
- tab_strip_model().GetIndexOfTab(tile.second)),
+ tab_strip_model().GetIndexOfTab(tile.second.Get())),
secondary_contents_view().web_contents());
// On the other hand, when tile.second is active contents,
- tab_strip_model().ActivateTabAt(tab_strip_model().GetIndexOfTab(tile.second));
+ tab_strip_model().ActivateTabAt(
+ tab_strip_model().GetIndexOfTab(tile.second.Get()));
active_tab_handle =
- tab_strip_model().GetTabHandleAt(tab_strip_model().GetIndexOfWebContents(
- tab_strip_model().GetActiveWebContents()));
+ tab_strip_model()
+ .GetTabAtIndex(tab_strip_model().GetIndexOfWebContents(
+ tab_strip_model().GetActiveWebContents()))
+ ->GetHandle();
ASSERT_EQ(active_tab_handle, tile.second);
// Then the secondary web view should hold the tile.first
EXPECT_EQ(tab_strip_model().GetWebContentsAt(
- tab_strip_model().GetIndexOfTab(tile.first)),
+ tab_strip_model().GetIndexOfTab(tile.first.Get())),
secondary_contents_view().web_contents());
}
diff --git a/browser/ui/views/tabs/brave_tab.cc b/browser/ui/views/tabs/brave_tab.cc
index 1ef9a6100671..c555c6fdc587 100644
--- a/browser/ui/views/tabs/brave_tab.cc
+++ b/browser/ui/views/tabs/brave_tab.cc
@@ -28,14 +28,14 @@
BraveTab::~BraveTab() = default;
-std::u16string BraveTab::GetTooltipText(const gfx::Point& p) const {
+std::u16string BraveTab::GetRenderedTooltipText(const gfx::Point& p) const {
auto* browser = controller_->GetBrowser();
if (browser &&
brave_tabs::AreTooltipsEnabled(browser->profile()->GetPrefs())) {
return Tab::GetTooltipText(data_.title,
GetAlertStateToShow(data_.alert_state));
}
- return Tab::GetTooltipText(p);
+ return TabSlotView::GetTooltipText();
}
int BraveTab::GetWidthOfLargestSelectableRegion() const {
@@ -164,6 +164,6 @@ void BraveTab::SetData(TabRendererData data) {
if (data_changed &&
tabs::utils::ShouldShowVerticalTabs(controller()->GetBrowser()) &&
data_.pinned) {
- set_group(std::nullopt);
+ SetGroup(std::nullopt);
}
}
diff --git a/browser/ui/views/tabs/brave_tab.h b/browser/ui/views/tabs/brave_tab.h
index ed770cfeddd3..05c7411d43fd 100644
--- a/browser/ui/views/tabs/brave_tab.h
+++ b/browser/ui/views/tabs/brave_tab.h
@@ -20,7 +20,7 @@ class BraveTab : public Tab {
~BraveTab() override;
// Tab:
- std::u16string GetTooltipText(const gfx::Point& p) const override;
+ std::u16string GetRenderedTooltipText(const gfx::Point& p) const override;
// Overridden because we moved alert button to left side in the tab whereas
// upstream put it on right side. Need to consider this change for calculating
diff --git a/browser/ui/views/tabs/brave_tab_container.cc b/browser/ui/views/tabs/brave_tab_container.cc
index aaf79c8f4a39..b0dba4f7c1d0 100644
--- a/browser/ui/views/tabs/brave_tab_container.cc
+++ b/browser/ui/views/tabs/brave_tab_container.cc
@@ -31,8 +31,8 @@
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/tab_style.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
#include "chrome/browser/ui/views/tabs/tab_container.h"
-#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
#include "chrome/grit/theme_resources.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/metadata/metadata_impl_macros.h"
@@ -313,8 +313,8 @@ void BraveTabContainer::PaintBoundingBoxForTile(gfx::Canvas& canvas,
const int offset =
IsPinnedTabContainer() ? 0 : tab_strip_model->IndexOfFirstNonPinnedTab();
- auto tab1_index = tab_strip_model->GetIndexOfTab(tile.first) - offset;
- auto tab2_index = tab_strip_model->GetIndexOfTab(tile.second) - offset;
+ auto tab1_index = tab_strip_model->GetIndexOfTab(tile.first.Get()) - offset;
+ auto tab2_index = tab_strip_model->GetIndexOfTab(tile.second.Get()) - offset;
if (!controller_->IsValidModelIndex(tab1_index) ||
!controller_->IsValidModelIndex(tab2_index)) {
// In case the tiled tab is not in this container, this can happen.
@@ -353,7 +353,8 @@ void BraveTabContainer::PaintBoundingBoxForTile(gfx::Canvas& canvas,
canvas.DrawRoundRect(bounding_rects, kRadius, flags);
auto active_tab_handle =
- tab_strip_model->GetTabHandleAt(tab_strip_model->active_index());
+ tab_strip_model->GetTabAtIndex(tab_strip_model->active_index())
+ ->GetHandle();
if (!is_vertical_tab && active_tab_handle != tile.first &&
active_tab_handle != tile.second &&
!GetTabAtModelIndex(tab1_index)->IsMouseHovered() &&
@@ -432,7 +433,7 @@ void BraveTabContainer::SetTabSlotVisibility() {
for (Tab* tab : layout_helper_->GetTabs()) {
if (std::optional group = tab->group();
group && !group_views_.contains(*group)) {
- tab->set_group(std::nullopt);
+ tab->SetGroup(std::nullopt);
}
}
@@ -773,8 +774,8 @@ void BraveTabContainer::UpdateTabsBorderInTile(const TabTile& tile) {
const int offset =
IsPinnedTabContainer() ? 0 : tab_strip_model->IndexOfFirstNonPinnedTab();
- auto tab1_index = tab_strip_model->GetIndexOfTab(tile.first) - offset;
- auto tab2_index = tab_strip_model->GetIndexOfTab(tile.second) - offset;
+ auto tab1_index = tab_strip_model->GetIndexOfTab(tile.first.Get()) - offset;
+ auto tab2_index = tab_strip_model->GetIndexOfTab(tile.second.Get()) - offset;
if (!controller_->IsValidModelIndex(tab1_index) ||
!controller_->IsValidModelIndex(tab2_index)) {
diff --git a/browser/ui/views/tabs/brave_tab_container.h b/browser/ui/views/tabs/brave_tab_container.h
index 476eda70b93f..d13c69d24076 100644
--- a/browser/ui/views/tabs/brave_tab_container.h
+++ b/browser/ui/views/tabs/brave_tab_container.h
@@ -12,8 +12,8 @@
#include "brave/browser/ui/tabs/split_view_browser_data.h"
#include "brave/browser/ui/tabs/split_view_browser_data_observer.h"
#include "chrome/browser/ui/tabs/tab_style.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_context.h"
#include "chrome/browser/ui/views/tabs/tab_container_impl.h"
-#include "chrome/browser/ui/views/tabs/tab_drag_context.h"
#include "ui/gfx/canvas.h"
class BraveTabContainer : public TabContainerImpl,
diff --git a/browser/ui/views/tabs/brave_tab_context_menu_contents.cc b/browser/ui/views/tabs/brave_tab_context_menu_contents.cc
index a8e06c8f1862..3443575291e2 100644
--- a/browser/ui/views/tabs/brave_tab_context_menu_contents.cc
+++ b/browser/ui/views/tabs/brave_tab_context_menu_contents.cc
@@ -265,8 +265,8 @@ void BraveTabContextMenuContents::OnMenuClosed() {
void BraveTabContextMenuContents::NewSplitView() {
auto* model = browser_->tab_strip_model();
- auto tab = model->GetTabHandleAt(tab_index_);
- brave::NewSplitViewForTab(browser_, tab);
+ auto* tab = model->GetTabAtIndex(tab_index_);
+ brave::NewSplitViewForTab(browser_, tab->GetHandle());
}
void BraveTabContextMenuContents::TileSelectedTabs() {
diff --git a/browser/ui/views/tabs/brave_tab_hover_browsertest.cc b/browser/ui/views/tabs/brave_tab_hover_browsertest.cc
index 87519353262e..19507ee4db1e 100644
--- a/browser/ui/views/tabs/brave_tab_hover_browsertest.cc
+++ b/browser/ui/views/tabs/brave_tab_hover_browsertest.cc
@@ -80,29 +80,6 @@ class BraveTabHoverTest : public InProcessBrowserTest {
animation_mode_reset_;
};
-// There should be no tooltip unless the mode is |TOOLTIP|, as otherwise we'll
-// get a tooltip AND a card showing up.
-IN_PROC_BROWSER_TEST_F(BraveTabHoverTest,
- GetTooltipOnlyHasTextWhenHoverModeIsTooltip) {
- TabRendererData data;
- data.visible_url = GURL("https://example.com");
- data.title = u"Hello World";
- tabstrip()->SetTabData(browser()->tab_strip_model()->active_index(), data);
- EXPECT_EQ(u"Hello World", active_tab()->data().title);
-
- browser()->profile()->GetPrefs()->SetInteger(brave_tabs::kTabHoverMode,
- brave_tabs::TabHoverMode::CARD);
- EXPECT_EQ(u"", active_tab()->GetTooltipText(gfx::Point()));
-
- browser()->profile()->GetPrefs()->SetInteger(
- brave_tabs::kTabHoverMode, brave_tabs::TabHoverMode::CARD_WITH_PREVIEW);
- EXPECT_EQ(u"", active_tab()->GetTooltipText(gfx::Point()));
-
- browser()->profile()->GetPrefs()->SetInteger(
- brave_tabs::kTabHoverMode, brave_tabs::TabHoverMode::TOOLTIP);
- EXPECT_EQ(u"Hello World", active_tab()->GetTooltipText(gfx::Point()));
-}
-
// The ThumbnailTabHelper needs to be attached in all |TabHoverModes| so that
// we can change between modes safely without restarting.
IN_PROC_BROWSER_TEST_F(BraveTabHoverTest, ThumbnailHelperIsAlwaysAttached) {
diff --git a/browser/ui/views/tabs/brave_tab_search_button.cc b/browser/ui/views/tabs/brave_tab_search_button.cc
index 98aa9ab54e8e..0223fd922369 100644
--- a/browser/ui/views/tabs/brave_tab_search_button.cc
+++ b/browser/ui/views/tabs/brave_tab_search_button.cc
@@ -11,6 +11,7 @@
#include "brave/browser/ui/views/brave_tab_search_bubble_host.h"
#include "brave/components/vector_icons/vector_icons.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
+#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/metadata/metadata_impl_macros.h"
@@ -19,11 +20,15 @@ BraveTabSearchButton::BraveTabSearchButton(
TabStripController* tab_strip_controller,
BrowserWindowInterface* browser_window_interface,
Edge fixed_flat_edge,
- Edge animated_flat_edge)
+ Edge animated_flat_edge,
+ views::View* anchor_view,
+ TabStrip* tab_strip)
: TabSearchButton(tab_strip_controller,
browser_window_interface,
fixed_flat_edge,
- animated_flat_edge) {
+ animated_flat_edge,
+ anchor_view,
+ tab_strip) {
// Resetting the tab search bubble host first, to avoid a dangling in
// `BraveTabSearchButton`, triggered `TabSearchBubbleHost` calling
// `SetButtonController` and in the process destroying the still alive
@@ -32,7 +37,7 @@ BraveTabSearchButton::BraveTabSearchButton(
tab_search_bubble_host_ = nullptr;
tab_search_bubble_host_ = std::make_unique(
- this, browser_window_interface);
+ this, browser_window_interface, anchor_view, tab_strip->AsWeakPtr());
// Apply toolbar's icon color to search button.
SetForegroundFrameActiveColorId(kColorToolbarButtonIcon);
diff --git a/browser/ui/views/tabs/brave_tab_search_button.h b/browser/ui/views/tabs/brave_tab_search_button.h
index d45a395bc391..3af9529ea2fa 100644
--- a/browser/ui/views/tabs/brave_tab_search_button.h
+++ b/browser/ui/views/tabs/brave_tab_search_button.h
@@ -17,7 +17,9 @@ class BraveTabSearchButton : public TabSearchButton {
TabStripController* tab_strip_controller,
BrowserWindowInterface* browser_window_interface,
Edge fixed_flat_edge,
- Edge animated_flat_edge);
+ Edge animated_flat_edge,
+ views::View* anchor_view,
+ TabStrip* tab_strip);
~BraveTabSearchButton() override;
BraveTabSearchButton(const BraveTabSearchButton&) = delete;
BraveTabSearchButton& operator=(const BraveTabSearchButton&) = delete;
diff --git a/browser/ui/views/tabs/brave_tab_strip.cc b/browser/ui/views/tabs/brave_tab_strip.cc
index 9cea21086654..c09aa425c187 100644
--- a/browser/ui/views/tabs/brave_tab_strip.cc
+++ b/browser/ui/views/tabs/brave_tab_strip.cc
@@ -176,9 +176,9 @@ void BraveTabStrip::MaybeStartDrag(
auto* tab_strip_model = controller_->GetBrowser()->tab_strip_model();
// Make sure both tiled tabs are in selection.
new_selection.AddIndexToSelection(
- tab_strip_model->GetIndexOfTab(tile->first));
+ tab_strip_model->GetIndexOfTab(tile->first.Get()));
new_selection.AddIndexToSelection(
- tab_strip_model->GetIndexOfTab(tile->second));
+ tab_strip_model->GetIndexOfTab(tile->second.Get()));
new_selection.set_active(tab_strip_model->active_index());
tab_strip_model->SetSelectionFromModel(new_selection);
}
@@ -239,7 +239,7 @@ bool BraveTabStrip::IsFirstTabInTile(const Tab* tab) const {
auto tile = GetTileForTab(tab);
DCHECK(tile) << "This must be called only when IsTabTiled() returned true";
- return browser->tab_strip_model()->GetIndexOfTab(tile->first) == *index;
+ return browser->tab_strip_model()->GetIndexOfTab(tile->first.Get()) == *index;
}
TabTiledState BraveTabStrip::GetTiledStateForTab(int index) const {
@@ -271,7 +271,8 @@ std::optional BraveTabStrip::GetTileForTab(const Tab* tab) const {
return std::nullopt;
}
- return data->GetTile(browser->tab_strip_model()->GetTabHandleAt(*index));
+ return data->GetTile(
+ browser->tab_strip_model()->GetTabAtIndex(*index)->GetHandle());
}
void BraveTabStrip::UpdateTabContainer() {
@@ -331,7 +332,7 @@ void BraveTabStrip::UpdateTabContainer() {
auto* tab = original_container->GetTabAtModelIndex(i);
// At this point, we don't have group views in the container. So before
// restoring groups, clears group for tabs.
- tab->set_group(std::nullopt);
+ tab->SetGroup(std::nullopt);
tab_container_->AddTab(
tab->parent()->RemoveChildViewT(tab), i,
tab->data().pinned ? TabPinned::kPinned : TabPinned::kUnpinned);
diff --git a/browser/ui/views/tabs/tab_drag_controller.cc b/browser/ui/views/tabs/tab_drag_controller.cc
index fdb9b1d88b25..ac9548bfbcfc 100644
--- a/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/browser/ui/views/tabs/tab_drag_controller.cc
@@ -20,7 +20,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
-#include "chrome/browser/ui/views/tabs/tab_drag_context.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_context.h"
#include "chrome/browser/ui/views/tabs/window_finder.h"
#include "components/prefs/pref_service.h"
#include "ui/views/view_utils.h"
@@ -174,9 +174,7 @@ TabDragController::Liveness TabDragController::GetLocalProcessWindow(
void TabDragController::DetachAndAttachToNewContext(
ReleaseCapture release_capture,
- TabDragContext* target_context,
- const gfx::Point& point_in_screen,
- bool set_capture) {
+ TabDragContext* target_context) {
auto* browser_widget = GetAttachedBrowserWidget();
auto* browser = BrowserView::GetBrowserViewForNativeWindow(
browser_widget->GetNativeWindow())
@@ -190,15 +188,17 @@ void TabDragController::DetachAndAttachToNewContext(
auto drag_data =
base::span(drag_data_).subspan(static_cast(first_tab_index()));
for (const auto& data : drag_data) {
- tabs.push_back(tab_strip_model->GetTabHandleAt(
- tab_strip_model->GetIndexOfWebContents(data.contents)));
+ tabs.push_back(tab_strip_model
+ ->GetTabAtIndex(tab_strip_model->GetIndexOfWebContents(
+ data.contents))
+ ->GetHandle());
}
old_split_view_browser_data->TabsWillBeAttachedToNewBrowser(tabs);
}
if (!is_showing_vertical_tabs_) {
- TabDragControllerChromium::DetachAndAttachToNewContext(
- release_capture, target_context, point_in_screen, set_capture);
+ TabDragControllerChromium::DetachAndAttachToNewContext(release_capture,
+ target_context);
if (old_split_view_browser_data) {
auto* new_browser = BrowserView::GetBrowserViewForNativeWindow(
@@ -234,8 +234,8 @@ void TabDragController::DetachAndAttachToNewContext(
vertical_tab_state_resetter_ = region_view->ExpandTabStripForDragging();
}
- TabDragControllerChromium::DetachAndAttachToNewContext(
- release_capture, target_context, point_in_screen, set_capture);
+ TabDragControllerChromium::DetachAndAttachToNewContext(release_capture,
+ target_context);
auto* region_view = get_region_view();
@@ -250,8 +250,8 @@ void TabDragController::DetachAndAttachToNewContext(
}
attached_context_->LayoutDraggedViewsAt(
- std::move(views), source_view_drag_data()->attached_view, point_in_screen,
- initial_move_);
+ std::move(views), source_view_drag_data()->attached_view,
+ GetCursorScreenPoint(), initial_move_);
if (old_split_view_browser_data) {
auto* new_browser = BrowserView::GetBrowserViewForNativeWindow(
@@ -261,66 +261,6 @@ void TabDragController::DetachAndAttachToNewContext(
}
}
-gfx::Rect TabDragController::CalculateNonMaximizedDraggedBrowserBounds(
- views::Widget* widget,
- const gfx::Point& point_in_screen) {
- // This method is called when dragging all tabs and moving window.
- auto bounds =
- TabDragControllerChromium::CalculateNonMaximizedDraggedBrowserBounds(
- widget, point_in_screen);
-#if BUILDFLAG(IS_MAC)
- // According to what's been observed, this only needed on Mac. Per platform,
- // window management mechanism is different so this could happen.
- if (is_showing_vertical_tabs_) {
- bounds.Offset(GetVerticalTabStripWidgetOffset());
- }
-#endif
-
- if (is_showing_vertical_tabs_) {
- bounds.set_size(widget->GetTopLevelWidget()->GetRestoredBounds().size());
- }
-
- return bounds;
-}
-
-gfx::Rect TabDragController::CalculateDraggedBrowserBounds(
- TabDragContext* source,
- const gfx::Point& point_in_screen,
- std::vector* drag_bounds) {
- // This method is called when creating new browser by detaching tabs and
- // when dragging all tabs in maximized window.
- auto bounds = TabDragControllerChromium::CalculateDraggedBrowserBounds(
- source, point_in_screen, drag_bounds);
- if (is_showing_vertical_tabs_) {
- // Revert back coordinate adjustment done by Chromium impl.
- bounds.set_origin(point_in_screen);
-
- // Adjust coordinate so that dragged tabs are under cursor.
- DCHECK(!drag_bounds->empty());
- bounds.Offset(-(mouse_offset_.OffsetFromOrigin()));
- bounds.Offset({-drag_bounds->front().x(), 0});
- bounds.Offset({-GetXCoordinateAdjustmentForMultiSelectedTabs(
- attached_views_, source_view_index_),
- 0});
-
- auto* browser_view = static_cast(
- BrowserView::GetBrowserViewForNativeWindow(
- GetAttachedBrowserWidget()->GetNativeWindow()));
- DCHECK(browser_view);
-
- auto* widget_delegate_view =
- browser_view->vertical_tab_strip_widget_delegate_view();
- DCHECK(widget_delegate_view);
-
- bounds.Offset(GetVerticalTabStripWidgetOffset());
- bounds.Offset(-widget_delegate_view->vertical_tab_strip_region_view()
- ->GetOffsetForDraggedTab());
- bounds.set_size(browser_view->GetRestoredBounds().size());
- }
-
- return bounds;
-}
-
[[nodiscard]] TabDragController::Liveness TabDragController::ContinueDragging(
const gfx::Point& point_in_screen) {
auto* browser_widget = GetAttachedBrowserWidget();
diff --git a/browser/ui/views/tabs/tab_drag_controller.h b/browser/ui/views/tabs/tab_drag_controller.h
index e8b5f4d616c3..c5c1cf05c8e3 100644
--- a/browser/ui/views/tabs/tab_drag_controller.h
+++ b/browser/ui/views/tabs/tab_drag_controller.h
@@ -11,7 +11,7 @@
#include "brave/browser/ui/tabs/split_view_browser_data.h"
#include "brave/browser/ui/views/frame/vertical_tab_strip_region_view.h"
-#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
class TabDragController : public TabDragControllerChromium {
public:
@@ -40,17 +40,8 @@ class TabDragController : public TabDragControllerChromium {
gfx::NativeWindow* window) override;
void DetachAndAttachToNewContext(ReleaseCapture release_capture,
- TabDragContext* target_context,
- const gfx::Point& point_in_screen,
- bool set_capture = true) override;
+ TabDragContext* target_context) override;
- gfx::Rect CalculateNonMaximizedDraggedBrowserBounds(
- views::Widget* widget,
- const gfx::Point& point_in_screen) override;
- gfx::Rect CalculateDraggedBrowserBounds(
- TabDragContext* source,
- const gfx::Point& point_in_screen,
- std::vector* drag_bounds) override;
[[nodiscard]] Liveness ContinueDragging(
const gfx::Point& point_in_screen) override;
diff --git a/browser/ui/views/tabs/tab_drag_controller_browsertest.cc b/browser/ui/views/tabs/tab_drag_controller_browsertest.cc
index 0b1273eaa917..19f597bb405e 100644
--- a/browser/ui/views/tabs/tab_drag_controller_browsertest.cc
+++ b/browser/ui/views/tabs/tab_drag_controller_browsertest.cc
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
#include "brave/browser/ui/tabs/features.h"
#include "chrome/browser/ui/browser.h"
diff --git a/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc b/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc
index 09c8aeb518af..14101d05f877 100644
--- a/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc
+++ b/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc
@@ -300,15 +300,15 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, WindowTitle) {
IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, NewTabVisibility) {
EXPECT_TRUE(
- browser_view()->tab_strip_region_view()->new_tab_button()->GetVisible());
+ browser_view()->tab_strip_region_view()->GetNewTabButton()->GetVisible());
ToggleVerticalTabStrip();
EXPECT_FALSE(
- browser_view()->tab_strip_region_view()->new_tab_button()->GetVisible());
+ browser_view()->tab_strip_region_view()->GetNewTabButton()->GetVisible());
ToggleVerticalTabStrip();
EXPECT_TRUE(
- browser_view()->tab_strip_region_view()->new_tab_button()->GetVisible());
+ browser_view()->tab_strip_region_view()->GetNewTabButton()->GetVisible());
}
IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, MinHeight) {
@@ -405,7 +405,7 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, MAYBE_Fullscreen) {
browser_view()->GetExclusiveAccessManager()->fullscreen_controller();
{
auto observer = FullscreenNotificationObserver(browser());
- fullscreen_controller->ToggleBrowserFullscreenMode();
+ fullscreen_controller->ToggleBrowserFullscreenMode(/*user_initiated=*/true);
observer.Wait();
}
@@ -418,7 +418,7 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, MAYBE_Fullscreen) {
{
auto observer = FullscreenNotificationObserver(browser());
- fullscreen_controller->ToggleBrowserFullscreenMode();
+ fullscreen_controller->ToggleBrowserFullscreenMode(/*user_initiated=*/true);
observer.Wait();
}
ASSERT_FALSE(fullscreen_controller->IsFullscreenForBrowser());
@@ -716,13 +716,8 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, OriginalTabSearchButton) {
auto* region_view = widget_delegate_view->vertical_tab_strip_region_view();
ASSERT_TRUE(region_view);
- auto* tab_search_container =
- region_view->original_region_view_->tab_search_container();
- if (!tab_search_container) {
- return;
- }
-
- auto* original_tab_search_button = tab_search_container->tab_search_button();
+ auto* original_tab_search_button =
+ region_view->original_region_view_->GetTabSearchButton();
if (!original_tab_search_button) {
// On Windows 10, the button is on the window frame and vertical tab strip
// does nothing to it.
diff --git a/browser/ui/views/toolbar/brave_toolbar_view.cc b/browser/ui/views/toolbar/brave_toolbar_view.cc
index fe6b674f553a..dfeb102c29d9 100644
--- a/browser/ui/views/toolbar/brave_toolbar_view.cc
+++ b/browser/ui/views/toolbar/brave_toolbar_view.cc
@@ -342,11 +342,6 @@ void BraveToolbarView::OnThemeChanged() {
}
}
-views::View* BraveToolbarView::GetAnchorView(
- std::optional type) {
- return ToolbarView::GetAnchorView(type);
-}
-
void BraveToolbarView::OnProfileAdded(const base::FilePath& profile_path) {
Update(nullptr);
}
diff --git a/browser/ui/views/toolbar/brave_toolbar_view.h b/browser/ui/views/toolbar/brave_toolbar_view.h
index 90a608fef09c..e89a90029733 100644
--- a/browser/ui/views/toolbar/brave_toolbar_view.h
+++ b/browser/ui/views/toolbar/brave_toolbar_view.h
@@ -63,9 +63,6 @@ class BraveToolbarView : public ToolbarView,
void ResetButtonBounds();
void UpdateBookmarkVisibility();
- // ToolbarButtonProvider:
- views::View* GetAnchorView(std::optional type) override;
-
// ProfileAttributesStorage::Observer:
void OnProfileAdded(const base::FilePath& profile_path) override;
void OnProfileWasRemoved(const base::FilePath& profile_path,
diff --git a/browser/ui/views/toolbar/brave_vpn_button.cc b/browser/ui/views/toolbar/brave_vpn_button.cc
index 37420bd24d27..32283a3f0263 100644
--- a/browser/ui/views/toolbar/brave_vpn_button.cc
+++ b/browser/ui/views/toolbar/brave_vpn_button.cc
@@ -311,7 +311,8 @@ const gfx::VectorIcon& BraveVPNButton::GetBadgeIcon() {
return is_connected_ ? kVpnIndicatorOnIcon : kVpnIndicatorOffIcon;
}
-std::u16string BraveVPNButton::GetTooltipText(const gfx::Point& p) const {
+std::u16string BraveVPNButton::GetRenderedTooltipText(
+ const gfx::Point& p) const {
if (!IsPurchased()) {
return l10n_util::GetStringUTF16(IDS_BRAVE_VPN);
}
diff --git a/browser/ui/views/toolbar/brave_vpn_button.h b/browser/ui/views/toolbar/brave_vpn_button.h
index 0ad0acdf7034..f1ee7dedf4a3 100644
--- a/browser/ui/views/toolbar/brave_vpn_button.h
+++ b/browser/ui/views/toolbar/brave_vpn_button.h
@@ -50,7 +50,7 @@ class BraveVPNButton : public ToolbarButton,
// ToolbarButton overrides:
void UpdateColorsAndInsets() override;
- std::u16string GetTooltipText(const gfx::Point& p) const override;
+ std::u16string GetRenderedTooltipText(const gfx::Point& p) const override;
void OnThemeChanged() override;
void InkDropRippleAnimationEnded(views::InkDropState state) override;
diff --git a/browser/ui/webui/ai_chat/ai_chat_ui.cc b/browser/ui/webui/ai_chat/ai_chat_ui.cc
index efc256cb001f..cc91ad0eba0a 100644
--- a/browser/ui/webui/ai_chat/ai_chat_ui.cc
+++ b/browser/ui/webui/ai_chat/ai_chat_ui.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tabs/tab_model.h"
#include "chrome/browser/ui/webui/favicon_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "components/prefs/pref_service.h"
@@ -33,6 +32,7 @@
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/url_constants.h"
#include "ui/webui/mojo_web_ui_controller.h"
+#include "ui/webui/webui_util.h"
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/browser.h"
diff --git a/browser/ui/webui/ai_chat/ai_chat_untrusted_conversation_ui.cc b/browser/ui/webui/ai_chat/ai_chat_untrusted_conversation_ui.cc
index fc96fa2a849f..4b8ad90e14e0 100644
--- a/browser/ui/webui/ai_chat/ai_chat_untrusted_conversation_ui.cc
+++ b/browser/ui/webui/ai_chat/ai_chat_untrusted_conversation_ui.cc
@@ -21,13 +21,13 @@
#include "brave/components/ai_chat/resources/grit/ai_chat_ui_generated_map.h"
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/localization_util.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/url_constants.h"
+#include "ui/webui/webui_util.h"
#if BUILDFLAG(IS_ANDROID)
#include "brave/browser/ui/android/ai_chat/brave_leo_settings_launcher_helper.h"
diff --git a/browser/ui/webui/brave_rewards/rewards_page_data_source.cc b/browser/ui/webui/brave_rewards/rewards_page_data_source.cc
index 8fe750a42a08..35aa4d48c63d 100644
--- a/browser/ui/webui/brave_rewards/rewards_page_data_source.cc
+++ b/browser/ui/webui/brave_rewards/rewards_page_data_source.cc
@@ -15,7 +15,6 @@
#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/favicon_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
@@ -23,6 +22,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "ui/webui/webui_util.h"
namespace brave_rewards {
diff --git a/browser/ui/webui/brave_rewards/rewards_panel_ui.cc b/browser/ui/webui/brave_rewards/rewards_panel_ui.cc
index d8c8faf318ff..28dde7bdefcc 100644
--- a/browser/ui/webui/brave_rewards/rewards_panel_ui.cc
+++ b/browser/ui/webui/brave_rewards/rewards_panel_ui.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
@@ -31,6 +30,7 @@
#include "content/public/common/url_constants.h"
#include "services/network/public/mojom/content_security_policy.mojom.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/webui/webui_util.h"
namespace brave_rewards {
diff --git a/browser/ui/webui/brave_rewards/tip_panel_ui.cc b/browser/ui/webui/brave_rewards/tip_panel_ui.cc
index 6d8e68a3b34c..d400988ad2d4 100644
--- a/browser/ui/webui/brave_rewards/tip_panel_ui.cc
+++ b/browser/ui/webui/brave_rewards/tip_panel_ui.cc
@@ -14,13 +14,13 @@
#include "brave/components/brave_rewards/resources/grit/tip_panel_generated_map.h"
#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/url_constants.h"
+#include "ui/webui/webui_util.h"
namespace brave_rewards {
diff --git a/browser/ui/webui/brave_shields/cookie_list_opt_in_ui.cc b/browser/ui/webui/brave_shields/cookie_list_opt_in_ui.cc
index cb7f8d8a67d9..08858f3fe7f0 100644
--- a/browser/ui/webui/brave_shields/cookie_list_opt_in_ui.cc
+++ b/browser/ui/webui/brave_shields/cookie_list_opt_in_ui.cc
@@ -15,7 +15,6 @@
#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/favicon_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
@@ -24,6 +23,7 @@
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/url_constants.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/webui/webui_util.h"
namespace {
diff --git a/browser/ui/webui/brave_shields/shields_panel_ui.cc b/browser/ui/webui/brave_shields/shields_panel_ui.cc
index dd029b057e8a..1a3caf2f68f2 100644
--- a/browser/ui/webui/brave_shields/shields_panel_ui.cc
+++ b/browser/ui/webui/brave_shields/shields_panel_ui.cc
@@ -20,12 +20,12 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/webui/favicon_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "net/base/features.h"
+#include "ui/webui/webui_util.h"
// Cache active Browser instance's TabStripModel to give
// to ShieldsPanelDataHandler when this is created because
diff --git a/browser/ui/webui/brave_vpn/vpn_panel_ui.cc b/browser/ui/webui/brave_vpn/vpn_panel_ui.cc
index 6de64d865679..abdf54e84edd 100644
--- a/browser/ui/webui/brave_vpn/vpn_panel_ui.cc
+++ b/browser/ui/webui/brave_vpn/vpn_panel_ui.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/favicon_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/favicon_base/favicon_url_parser.h"
#include "components/grit/brave_components_resources.h"
#include "components/sessions/content/session_tab_helper.h"
@@ -30,6 +29,7 @@
#include "content/public/common/bindings_policy.h"
#include "content/public/common/url_constants.h"
#include "ui/webui/untrusted_web_ui_controller.h"
+#include "ui/webui/webui_util.h"
VPNPanelUI::VPNPanelUI(content::WebUI* web_ui)
: ui::UntrustedWebUIController(web_ui) {
diff --git a/browser/ui/webui/brave_wallet/android/android_wallet_page_ui.cc b/browser/ui/webui/brave_wallet/android/android_wallet_page_ui.cc
index ad5f8c3f8f73..191f0e8af540 100644
--- a/browser/ui/webui/brave_wallet/android/android_wallet_page_ui.cc
+++ b/browser/ui/webui/brave_wallet/android/android_wallet_page_ui.cc
@@ -27,13 +27,13 @@
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/localization_util.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/common/url_constants.h"
+#include "ui/webui/webui_util.h"
AndroidWalletPageUI::AndroidWalletPageUI(content::WebUI* web_ui,
const GURL& url)
diff --git a/browser/ui/webui/brave_wallet/ledger/ledger_ui.cc b/browser/ui/webui/brave_wallet/ledger/ledger_ui.cc
index e9e40efc2a6a..56391d78caaa 100644
--- a/browser/ui/webui/brave_wallet/ledger/ledger_ui.cc
+++ b/browser/ui/webui/brave_wallet/ledger/ledger_ui.cc
@@ -12,7 +12,7 @@
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/resources/grit/webui_resources.h"
namespace ledger {
diff --git a/browser/ui/webui/brave_wallet/line_chart/line_chart_ui.cc b/browser/ui/webui/brave_wallet/line_chart/line_chart_ui.cc
index 90809659146f..7de3002072df 100644
--- a/browser/ui/webui/brave_wallet/line_chart/line_chart_ui.cc
+++ b/browser/ui/webui/brave_wallet/line_chart/line_chart_ui.cc
@@ -11,13 +11,12 @@
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/localization_util.h"
#include "brave/components/line_chart_display/resources/grit/line_chart_display_generated_map.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/webui_util.h"
namespace line_chart {
diff --git a/browser/ui/webui/brave_wallet/market/market_ui.cc b/browser/ui/webui/brave_wallet/market/market_ui.cc
index 549928322884..a9b3ca9ed429 100644
--- a/browser/ui/webui/brave_wallet/market/market_ui.cc
+++ b/browser/ui/webui/brave_wallet/market/market_ui.cc
@@ -11,13 +11,13 @@
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/localization_util.h"
#include "brave/components/market_display/resources/grit/market_display_generated_map.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/resources/grit/webui_resources.h"
+#include "ui/webui/webui_util.h"
namespace market {
diff --git a/browser/ui/webui/brave_wallet/nft/nft_ui.cc b/browser/ui/webui/brave_wallet/nft/nft_ui.cc
index 014ef21e31fb..cd2217ad9eb4 100644
--- a/browser/ui/webui/brave_wallet/nft/nft_ui.cc
+++ b/browser/ui/webui/brave_wallet/nft/nft_ui.cc
@@ -11,13 +11,13 @@
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/localization_util.h"
#include "brave/components/nft_display/resources/grit/nft_display_generated_map.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/resources/grit/webui_resources.h"
+#include "ui/webui/webui_util.h"
namespace nft {
diff --git a/browser/ui/webui/brave_wallet/trezor/trezor_ui.cc b/browser/ui/webui/brave_wallet/trezor/trezor_ui.cc
index 2991b944a994..30ec3d0b3af8 100644
--- a/browser/ui/webui/brave_wallet/trezor/trezor_ui.cc
+++ b/browser/ui/webui/brave_wallet/trezor/trezor_ui.cc
@@ -12,7 +12,7 @@
#include "components/grit/brave_components_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/resources/grit/webui_resources.h"
namespace {
constexpr char kTrezorConnectURL[] = "https://connect.trezor.io/";
diff --git a/browser/ui/webui/brave_wallet/wallet_page_ui.cc b/browser/ui/webui/brave_wallet/wallet_page_ui.cc
index c1c664e14b77..9229d5a45f30 100644
--- a/browser/ui/webui/brave_wallet/wallet_page_ui.cc
+++ b/browser/ui/webui/brave_wallet/wallet_page_ui.cc
@@ -33,7 +33,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
#include "chrome/browser/ui/webui/sanitized_image_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
#include "content/public/browser/web_contents.h"
@@ -42,6 +41,7 @@
#include "content/public/common/url_constants.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/webui/webui_util.h"
WalletPageUI::WalletPageUI(content::WebUI* web_ui)
: ui::MojoWebUIController(web_ui,
diff --git a/browser/ui/webui/brave_wallet/wallet_panel_ui.cc b/browser/ui/webui/brave_wallet/wallet_panel_ui.cc
index fd393b4e925a..238cb660f987 100644
--- a/browser/ui/webui/brave_wallet/wallet_panel_ui.cc
+++ b/browser/ui/webui/brave_wallet/wallet_panel_ui.cc
@@ -37,7 +37,6 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
#include "chrome/browser/ui/webui/sanitized_image_source.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "components/grit/brave_components_resources.h"
#include "components/grit/brave_components_strings.h"
#include "content/public/browser/web_contents.h"
@@ -46,6 +45,7 @@
#include "content/public/common/url_constants.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/webui/webui_util.h"
WalletPanelUI::WalletPanelUI(content::WebUI* web_ui)
: TopChromeWebUIController(web_ui,
diff --git a/browser/ui/webui/brave_web_ui_controller_factory.cc b/browser/ui/webui/brave_web_ui_controller_factory.cc
index 46c16d5feb36..ff5657a8f287 100644
--- a/browser/ui/webui/brave_web_ui_controller_factory.cc
+++ b/browser/ui/webui/brave_web_ui_controller_factory.cc
@@ -201,8 +201,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
// in WebUI.
url.host_piece() == chrome::kChromeUINewTabHost ||
url.host_piece() == chrome::kChromeUISettingsHost ||
- ((url.host_piece() == kWelcomeHost ||
- url.host_piece() == chrome::kChromeUIWelcomeURL) &&
+ ((url.host_piece() == kWelcomeHost || url.host_piece() == kWelcomeURL) &&
!profile->IsGuestSession()) ||
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_TOR)
diff --git a/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_ui.cc b/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_ui.cc
index cb749a7e5ddf..8f2824812441 100644
--- a/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_ui.cc
+++ b/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_ui.cc
@@ -9,7 +9,7 @@
#include "brave/browser/ui/webui/brave_webui_source.h"
#include "brave/components/ethereum_remote_client_page/resources/grit/ethereum_remote_client_page_generated_map.h"
-#include "ui/resources/grit/webui_resources.h"
+#include "ui/webui/resources/grit/webui_resources.h"
EthereumRemoteClientUI::EthereumRemoteClientUI(content::WebUI* web_ui,
const std::string& name)
diff --git a/browser/ui/webui/new_tab_page/brave_new_tab_ui.cc b/browser/ui/webui/new_tab_page/brave_new_tab_ui.cc
index 1548d5d9cb46..d6253f1d547e 100644
--- a/browser/ui/webui/new_tab_page/brave_new_tab_ui.cc
+++ b/browser/ui/webui/new_tab_page/brave_new_tab_ui.cc
@@ -160,7 +160,7 @@ void BraveNewTabUI::BindInterface(
realbox_handler_ = std::make_unique(
std::move(pending_page_handler), profile, web_ui()->GetWebContents(),
- /*metrics_reporter=*/nullptr, /*lens_searchbox_client=*/nullptr,
+ /*metrics_reporter=*/nullptr,
/*omnibox_controller=*/nullptr);
}
diff --git a/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
index 6ca49e39a0f6..7a0084ca402f 100644
--- a/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
+++ b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
@@ -42,15 +42,14 @@ class BraveRealboxHandlerTest : public InProcessBrowserTest {
void OnAutocompleteAccept(const GURL& url, const std::u16string& keyword) {
mojo::Remote remote_page_handler;
RealboxHandler handler(remote_page_handler.BindNewPipeAndPassReceiver(),
- browser()->profile(), contents(), nullptr, nullptr,
- nullptr);
+ browser()->profile(), contents(), nullptr, nullptr);
AutocompleteMatch match;
match.keyword = keyword;
handler.omnibox_controller()->client()->OnAutocompleteAccept(
url, nullptr, WindowOpenDisposition::CURRENT_TAB,
ui::PageTransition::PAGE_TRANSITION_TYPED,
AutocompleteMatchType::SEARCH_SUGGEST, base::TimeTicks::Now(), false,
- false, u"", match, match, IDNA2008DeviationCharacter::kNone);
+ false, u"", match, match);
content::WaitForLoadStop(contents());
}
diff --git a/browser/web_discovery/web_discovery_unittest.cc b/browser/web_discovery/web_discovery_unittest.cc
index a52a74702100..82752b313fc3 100644
--- a/browser/web_discovery/web_discovery_unittest.cc
+++ b/browser/web_discovery/web_discovery_unittest.cc
@@ -55,7 +55,7 @@ class WebDiscoveryCTATest : public testing::Test {
std::unique_ptr brave = CreateTestTemplateURL(
u"brave", "https://search.brave.com/", std::string(),
base::Time::FromTimeT(100), false,
- TemplateURLData::CreatedByPolicy::kNoPolicy,
+ TemplateURLData::PolicyOrigin::kNoPolicy,
TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE);
service()->SetUserSelectedDefaultSearchProvider(brave.get());
ASSERT_TRUE(IsBraveSearchDefault());
@@ -66,7 +66,7 @@ class WebDiscoveryCTATest : public testing::Test {
std::unique_ptr google = CreateTestTemplateURL(
u"google", "https://www.google.com/", std::string(),
base::Time::FromTimeT(100), false,
- TemplateURLData::CreatedByPolicy::kNoPolicy,
+ TemplateURLData::PolicyOrigin::kNoPolicy,
TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_GOOGLE);
service()->SetUserSelectedDefaultSearchProvider(google.get());
ASSERT_FALSE(IsBraveSearchDefault());
diff --git a/build/BUILD.gn b/build/BUILD.gn
index ffdf782baadd..b24f0eb8a72c 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -28,7 +28,7 @@ if (is_redirect_cc_build) {
"BRAVE_GET_TARGET_FOR_DEFAULT_APP_SETTINGS=",
"BRAVE_HISTOGRAM_FUNCTIONS_UMA_HISTOGRAM_ENUMERATION=",
"BRAVE_SCOPED_ALLOW_BASE_SYNC_PRIMITIVES_H=",
- "BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES(X)=",
+ "BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES=",
]
}
}
diff --git a/build/android/bytecode/BUILD.gn b/build/android/bytecode/BUILD.gn
index ea614f7648cb..ff27e4fc1421 100644
--- a/build/android/bytecode/BUILD.gn
+++ b/build/android/bytecode/BUILD.gn
@@ -34,7 +34,7 @@ java_binary("java_bytecode_rewriter") {
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveChromeContextMenuPopulatorAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java",
- "//brave/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdvancedAdapter.java",
+ "//brave/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveCommandLineInitUtilClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveContentSettingsResourcesClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveContentViewClassAdapter.java",
diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java
index 27395f77f983..fcc9f34c5ae8 100644
--- a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java
+++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java
@@ -33,7 +33,7 @@ public static ClassVisitor createAdapter(ClassVisitor chain) {
chain = new BraveBottomControlsMediatorClassAdapter(chain);
chain = new BraveCachedFlagClassAdapter(chain);
chain = new BraveChromeContextMenuPopulatorAdapter(chain);
- chain = new BraveClearBrowsingDataFragmentAdvancedAdapter(chain);
+ chain = new BraveClearBrowsingDataFragmentAdapter(chain);
chain = new BraveCommandLineInitUtilClassAdapter(chain);
chain = new BraveContentSettingsResourcesClassAdapter(chain);
chain = new BraveContentViewClassAdapter(chain);
diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdvancedAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdapter.java
similarity index 54%
rename from build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdvancedAdapter.java
rename to build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdapter.java
index d2672b6079a7..1ab148ef351a 100644
--- a/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdvancedAdapter.java
+++ b/build/android/bytecode/java/org/brave/bytecode/BraveClearBrowsingDataFragmentAdapter.java
@@ -7,14 +7,17 @@
import org.objectweb.asm.ClassVisitor;
-public class BraveClearBrowsingDataFragmentAdvancedAdapter extends BraveClassVisitor {
- static String sFragment =
- "org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced";
+public class BraveClearBrowsingDataFragmentAdapter extends BraveClassVisitor {
+ static String sFragment = "org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment";
static String sBraveFragment =
- "org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragmentAdvanced";
+ "org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragment";
- public BraveClearBrowsingDataFragmentAdvancedAdapter(ClassVisitor visitor) {
+ public BraveClearBrowsingDataFragmentAdapter(ClassVisitor visitor) {
super(visitor);
redirectConstructor(sFragment, sBraveFragment);
+
+ makePublicMethod(sFragment, "onClearBrowsingData");
+
+ addMethodAnnotation(sBraveFragment, "onClearBrowsingData", "Ljava/lang/Override;");
}
}
diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveNotificationPermissionRationaleDialogControllerClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveNotificationPermissionRationaleDialogControllerClassAdapter.java
index 15580dc9e0fc..9457970c9df4 100644
--- a/build/android/bytecode/java/org/brave/bytecode/BraveNotificationPermissionRationaleDialogControllerClassAdapter.java
+++ b/build/android/bytecode/java/org/brave/bytecode/BraveNotificationPermissionRationaleDialogControllerClassAdapter.java
@@ -18,7 +18,5 @@ public BraveNotificationPermissionRationaleDialogControllerClassAdapter(ClassVis
super(visitor);
redirectConstructor(sContoller, sBraveContoller);
- deleteMethod(sBraveContoller, "wrapDialogDismissalCallback");
- makePublicMethod(sContoller, "wrapDialogDismissalCallback");
}
}
diff --git a/build/android/config.gni b/build/android/config.gni
index b681f6121d5c..50b7accb805f 100644
--- a/build/android/config.gni
+++ b/build/android/config.gni
@@ -50,12 +50,12 @@ brave_chrome_java_deps = [
"//brave/third_party/android_deps:com_android_installreferrer_java",
"//brave/third_party/android_deps:com_github_bumptech_glide_java",
"//brave/third_party/android_deps:com_google_android_play_integrity_java",
+ "//brave/third_party/android_deps:com_google_code_gson_gson_java",
"//brave/third_party/android_deps:com_wireguard_android_J__unpack_aar",
"//brave/third_party/android_deps:com_wireguard_android_java",
"//brave/third_party/android_deps:google_play_services_safetynet_java",
"//brave/third_party/zxing:zxing_java",
"//third_party/android_deps:com_android_support_support_annotations_java",
- "//third_party/android_deps:com_google_code_gson_gson_java",
"//third_party/android_deps:google_play_services_vision_common_java",
"//third_party/android_deps:google_play_services_vision_java",
"//third_party/android_deps:org_jetbrains_kotlinx_kotlinx_coroutines_android_java",
diff --git a/build/commands/lib/config.js b/build/commands/lib/config.js
index db606d5df069..b3024b8294d7 100644
--- a/build/commands/lib/config.js
+++ b/build/commands/lib/config.js
@@ -686,7 +686,6 @@ Config.prototype.buildArgs = function () {
// in the future to see if this is no longer needed
// https://github.com/brave/brave-browser/issues/29934
args.ios_partition_alloc_enabled = false
- args.use_partition_alloc = false
args.ios_provider_target = "//brave/ios/browser/providers:brave_providers"
diff --git a/build/commands/lib/util.js b/build/commands/lib/util.js
index 96e0049f2407..36d65d7a273f 100644
--- a/build/commands/lib/util.js
+++ b/build/commands/lib/util.js
@@ -36,6 +36,8 @@ async function applyPatches(printPatchFailuresInJson) {
const devtoolsFrontendPatchesPath = path.join(patchesPath, 'third_party', 'devtools-frontend', 'src')
const ffmpegPatchesPath = path.join(patchesPath, 'third_party', 'ffmpeg')
const tflitePatchesPath = path.join(patchesPath, 'third_party', 'tflite', 'src')
+ const searchEngineDataPatchesPath =
+ path.join(patchesPath, 'third_party', 'search_engines_data', 'resources')
const chromiumRepoPath = config.srcDir
const v8RepoPath = path.join(chromiumRepoPath, 'v8')
@@ -43,6 +45,8 @@ async function applyPatches(printPatchFailuresInJson) {
const devtoolsFrontendRepoPath = path.join(chromiumRepoPath, 'third_party', 'devtools-frontend', 'src')
const ffmpegRepoPath = path.join(chromiumRepoPath, 'third_party', 'ffmpeg')
const tfliteRepoPath = path.join(chromiumRepoPath, 'third_party', 'tflite', 'src')
+ const searchEngineDataRepoPath = path.join(
+ chromiumRepoPath, 'third_party', 'search_engines_data', 'resources')
const chromiumPatcher = new GitPatcher(patchesPath, chromiumRepoPath)
const v8Patcher = new GitPatcher(v8PatchesPath, v8RepoPath)
@@ -50,6 +54,8 @@ async function applyPatches(printPatchFailuresInJson) {
const devtoolsFrontendPatcher = new GitPatcher(devtoolsFrontendPatchesPath, devtoolsFrontendRepoPath)
const ffmpegPatcher = new GitPatcher(ffmpegPatchesPath, ffmpegRepoPath)
const tflitePatcher = new GitPatcher(tflitePatchesPath, tfliteRepoPath)
+ const searchEngineDataPatcher =
+ new GitPatcher(searchEngineDataPatchesPath, searchEngineDataRepoPath)
const chromiumPatchStatus = await chromiumPatcher.applyPatches()
const v8PatchStatus = await v8Patcher.applyPatches()
@@ -57,6 +63,8 @@ async function applyPatches(printPatchFailuresInJson) {
const devtoolsFrontendPatchStatus = await devtoolsFrontendPatcher.applyPatches()
const ffmpegPatchStatus = await ffmpegPatcher.applyPatches()
const tflitePatchStatus = await tflitePatcher.applyPatches()
+ const searchEngineDataPatchStatus =
+ await searchEngineDataPatcher.applyPatches()
// Log status for all patches
// Differentiate entries for logging
@@ -65,7 +73,11 @@ async function applyPatches(printPatchFailuresInJson) {
s => s.path = path.join('third_party', 'catapult', s.path))
devtoolsFrontendPatchStatus.forEach(
s => s.path = path.join('third_party', 'devtools-frontend', 'src', s.path))
- const allPatchStatus = [...chromiumPatchStatus, ...v8PatchStatus, ...catapultPatchStatus, ...devtoolsFrontendPatchStatus, ...ffmpegPatchStatus, ...tflitePatchStatus]
+ const allPatchStatus = [
+ ...chromiumPatchStatus, ...v8PatchStatus, ...catapultPatchStatus,
+ ...devtoolsFrontendPatchStatus, ...ffmpegPatchStatus, ...tflitePatchStatus,
+ ...searchEngineDataPatchStatus
+ ];
if (printPatchFailuresInJson) {
Log.printFailedPatchesInJsonFormat(allPatchStatus, config.braveCoreDir)
} else {
diff --git a/build/commands/scripts/updatePatches.js b/build/commands/scripts/updatePatches.js
index 2c65d67f771e..8b084c0fcf04 100644
--- a/build/commands/scripts/updatePatches.js
+++ b/build/commands/scripts/updatePatches.js
@@ -31,12 +31,16 @@ module.exports = function RunCommand (options) {
const devtoolsFrontendDir = path.join(config.srcDir, 'third_party', 'devtools-frontend', 'src')
const ffmpegDir = path.join(config.srcDir, 'third_party', 'ffmpeg')
const tfliteDir = path.join(config.srcDir, 'third_party', 'tflite', 'src')
+ const searchEngineDataDir = path.join(
+ config.srcDir, 'third_party', 'search_engines_data', 'resources')
const patchDir = path.join(config.braveCoreDir, 'patches')
const v8PatchDir = path.join(patchDir, 'v8')
const catapultPatchDir = path.join(patchDir, 'third_party', 'catapult')
const devtoolsFrontendPatchDir = path.join(patchDir, 'third_party', 'devtools-frontend', 'src')
const ffmpegPatchDir = path.join(patchDir, 'third_party', 'ffmpeg')
const tflitePatchDir = path.join(patchDir, 'third_party', 'tflite', 'src')
+ const searchEngineDataPatchDir =
+ path.join(patchDir, 'third_party', 'search_engines_data', 'resources')
Promise.all([
// chromium
@@ -50,7 +54,9 @@ module.exports = function RunCommand (options) {
// third_party/ffmpeg
updatePatches(ffmpegDir, ffmpegPatchDir),
// third_party/tflite/src
- updatePatches(tfliteDir, tflitePatchDir)
+ updatePatches(tfliteDir, tflitePatchDir),
+ // third_party/search_engines_data
+ updatePatches(searchEngineDataDir, searchEngineDataPatchDir),
])
.then(() => {
console.log('Done.')
diff --git a/build/dotfile_settings.gni b/build/dotfile_settings.gni
index bcb73f5098d6..14e558b0d63a 100644
--- a/build/dotfile_settings.gni
+++ b/build/dotfile_settings.gni
@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.
-brave_exec_script_whitelist = [
+brave_exec_script_allowlist = [
# //brave/.env parser.
"//brave/build/env_config.gni",
]
diff --git a/chromium_src/android_webview/browser/component_updater/trust_token_key_commitments_component_loader.cc b/chromium_src/android_webview/browser/component_updater/trust_token_key_commitments_component_loader.cc
new file mode 100644
index 000000000000..d662fee153b9
--- /dev/null
+++ b/chromium_src/android_webview/browser/component_updater/trust_token_key_commitments_component_loader.cc
@@ -0,0 +1,20 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "android_webview/browser/component_updater/trust_token_key_commitments_component_loader.h"
+
+#define LoadTrustTokenKeyCommitmentsComponent \
+ LoadTrustTokenKeyCommitmentsComponent_ChromiumImpl
+
+#include "src/android_webview/browser/component_updater/trust_token_key_commitments_component_loader.cc"
+#undef LoadTrustTokenKeyCommitmentsComponent
+
+namespace android_webview {
+
+// We do not support TrustTokens aka PrivateStateTokens aka FeldgePst
+void LoadTrustTokenKeyCommitmentsComponent(
+ ComponentLoaderPolicyVector& policies) {}
+
+} // namespace android_webview
diff --git a/chromium_src/base/debug/alias.h b/chromium_src/base/debug/alias.h
index 09ea56070ac6..d1113384779f 100644
--- a/chromium_src/base/debug/alias.h
+++ b/chromium_src/base/debug/alias.h
@@ -32,7 +32,7 @@ class StackObjectCopy {
//
// Can't use `byte_span_from_ref` because `T` might be an abstract class.
auto original_object_memory = UNSAFE_BUFFERS(
- make_span(reinterpret_cast(original), kSize));
+ span(reinterpret_cast(original), kSize));
span(buffer_).copy_from(std::move(original_object_memory));
} else {
ranges::fill(buffer_, 0);
diff --git a/chromium_src/base/trace_event/builtin_categories.h b/chromium_src/base/trace_event/builtin_categories.h
index 7634c4511476..7c8e883627b6 100644
--- a/chromium_src/base/trace_event/builtin_categories.h
+++ b/chromium_src/base/trace_event/builtin_categories.h
@@ -15,11 +15,12 @@
//
// Note: There is no #undef for this macros because it is used in exported
// macros of the chromium builtin_categories.h.
-#define BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES(X) \
- X("brave") \
- X("brave.adblock") \
- X("brave.ads")
+#define BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES \
+ perfetto::Category("brave"), perfetto::Category("brave.adblock"), \
+ perfetto::Category("brave.ads"),
#include "src/base/trace_event/builtin_categories.h" // IWYU pragma: export
+#undef BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES
+
#endif // BRAVE_CHROMIUM_SRC_BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_
diff --git a/chromium_src/base/types/zip.h b/chromium_src/base/types/zip.h
deleted file mode 100644
index 6cce72b85976..000000000000
--- a/chromium_src/base/types/zip.h
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright (c) 2024 The Brave Authors. All rights reserved.
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at https://mozilla.org/MPL/2.0/.
-
-// Copyright 2024 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BRAVE_CHROMIUM_SRC_BASE_TYPES_ZIP_H_
-#define BRAVE_CHROMIUM_SRC_BASE_TYPES_ZIP_H_
-
-#include
-#include
-#include
-#include
-
-#include "base/check.h"
-#include "base/compiler_specific.h"
-
-namespace base {
-
-namespace internal {
-
-template
-class Zipper {
- public:
- constexpr explicit Zipper(Ranges&... ranges LIFETIME_BOUND) noexcept
- : ranges_(ranges...) {}
-
- // A sentinel used by the iterator to constrain the comparison to make sure it
- // has the proper end of each range.
- struct ZipEnd {};
-
- class iterator {
- public:
- using value_type = std::tuple<
- std::remove_cv_t()))>...>;
- using reference = value_type;
- using element_type = value_type;
- using difference_type = std::ptrdiff_t;
- using pointer = void;
- // TODO(https://crbug.com/377940847): This could be improved going forward
- // to select a better iterator category, based on the common denominator of
- // the union of iterators, for instance output iterators, etc.
- using iterator_category = std::input_iterator_tag;
- using iterator_concept = std::input_iterator_tag;
-
- constexpr iterator& operator++() noexcept LIFETIME_BOUND {
- advance(std::index_sequence_for{});
- return *this;
- }
-
- constexpr auto operator*() const noexcept LIFETIME_BOUND {
- return deref(std::index_sequence_for{});
- }
-
- // Determines if the iterator has reached the end, so a for-range loop bails
- // out.
- constexpr bool operator!=(ZipEnd) const noexcept LIFETIME_BOUND {
- return has_more(std::index_sequence_for{});
- }
-
- private:
- friend class Zipper;
-
- constexpr explicit iterator(
- std::tuple()))...> begin
- LIFETIME_BOUND,
- std::tuple()))...> end
- LIFETIME_BOUND) noexcept
- : begin_(begin), end_(end) {}
-
- // Checks if any range has reached the end.
- template
- constexpr bool has_more(std::index_sequence) const {
- return (... && (std::get(begin_) != std::get(end_)));
- }
-
- template
- constexpr void advance(std::index_sequence) LIFETIME_BOUND {
- CHECK(operator!=(ZipEnd()));
- // SAFETY: The increment is safe as it has been just CHECKed so it is
- // guaranteed to be inside [begin_, end_).
- UNSAFE_BUFFERS((++std::get(begin_), ...));
- }
-
- template
- constexpr value_type deref(std::index_sequence) const
- LIFETIME_BOUND {
- return {*std::get(begin_)...};
- }
-
- std::tuple()))...> begin_;
- std::tuple()))...> end_;
- };
-
- constexpr iterator begin() noexcept LIFETIME_BOUND {
- return begin_impl(std::index_sequence_for{});
- }
-
- constexpr ZipEnd end() noexcept { return ZipEnd(); }
-
- private:
- template
- constexpr iterator begin_impl(std::index_sequence) LIFETIME_BOUND {
- return iterator(std::make_tuple(std::begin(std::get(ranges_))...),
- std::make_tuple(std::end(std::get(ranges_))...));
- }
-
- std::tuple ranges_;
-};
-
-} // namespace internal
-
-// Zipping utility that allows iterating over multiple ranges in lockstep.
-//
-// Example:
-//
-// std::vector a = {1, 2, 3};
-// std::vector b = {4.5, 5.5, 6.5};
-// std::vector c = {"x", "y", "z"};
-// for (auto [x, y, z] : zip(a, b, c)) {
-// LOG(INFO) << x << " " << y << " " << z;
-// }
-//
-// Zipping will carry on until one of the ranges run out, at which the loop will
-// bail.
-template
-constexpr internal::Zipper zip(Ranges&... ranges LIFETIME_BOUND) {
- return internal::Zipper(ranges...);
-}
-
-} // namespace base
-
-#endif // BRAVE_CHROMIUM_SRC_BASE_TYPES_ZIP_H_
diff --git a/chromium_src/check_chromium_src_config.json5 b/chromium_src/check_chromium_src_config.json5
index 80c78e7c8095..a968ea998a3c 100644
--- a/chromium_src/check_chromium_src_config.json5
+++ b/chromium_src/check_chromium_src_config.json5
@@ -17,7 +17,6 @@
// Please, keep in alphabetical order.
"path_excludes": [
"base/feature_override.h",
- "base/types/zip.h",
"check_chromium_src_config.json5",
"chrome/browser/devtools/url_constants_unittest.cc",
"chrome/browser/history/history_utils_unittest.cc",
diff --git a/chromium_src/chrome/browser/about_flags.cc b/chromium_src/chrome/browser/about_flags.cc
index bf318218988f..c469c47ac6dd 100644
--- a/chromium_src/chrome/browser/about_flags.cc
+++ b/chromium_src/chrome/browser/about_flags.cc
@@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "brave/browser/about_flags.cc"
+
#include "chrome/common/channel_info.h"
-#include "components/autofill/core/browser/autofill_experiments.h"
+#include "components/autofill/core/browser/studies/autofill_experiments.h"
#include "src/chrome/browser/about_flags.cc"
diff --git a/chromium_src/chrome/browser/android/preferences/about_settings_bridge.cc b/chromium_src/chrome/browser/android/preferences/about_settings_bridge.cc
index 69ade9c2e4d9..7683faff4bca 100644
--- a/chromium_src/chrome/browser/android/preferences/about_settings_bridge.cc
+++ b/chromium_src/chrome/browser/android/preferences/about_settings_bridge.cc
@@ -19,7 +19,8 @@ static std::string JNI_AboutSettingsBridge_GetApplicationVersion(JNIEnv* env) {
base::android::BuildInfo::GetInstance();
std::string application(android_build_info->host_package_label());
application.append(" ");
- application.append(android_build_info->package_version_name());
+ application.append(
+ version_info::GetBraveVersionWithoutChromiumMajorVersion());
application.append(", Chromium ");
application.append(version_info::GetBraveChromiumVersionNumber());
diff --git a/chromium_src/chrome/browser/component_updater/trust_token_key_commitments_component_installer.cc b/chromium_src/chrome/browser/component_updater/trust_token_key_commitments_component_installer.cc
new file mode 100644
index 000000000000..769aed2f7d3b
--- /dev/null
+++ b/chromium_src/chrome/browser/component_updater/trust_token_key_commitments_component_installer.cc
@@ -0,0 +1,20 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "chrome/browser/component_updater/trust_token_key_commitments_component_installer.h"
+
+#define RegisterTrustTokenKeyCommitmentsComponentIfTrustTokensEnabled \
+ RegisterTrustTokenKeyCommitmentsComponentIfTrustTokensEnabled_ChromiumImpl
+
+#include "src/chrome/browser/component_updater/trust_token_key_commitments_component_installer.cc"
+#undef RegisterTrustTokenKeyCommitmentsComponentIfTrustTokensEnabled
+
+namespace component_updater {
+
+// We do not support TrustTokens aka PrivateStateTokens aka FeldgePst
+void RegisterTrustTokenKeyCommitmentsComponentIfTrustTokensEnabled(
+ ComponentUpdateService* cus) {}
+
+} // namespace component_updater
diff --git a/chromium_src/chrome/browser/extensions/chrome_component_extension_resource_manager.cc b/chromium_src/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
index 97a894b37e2d..7086f78525e0 100644
--- a/chromium_src/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
+++ b/chromium_src/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
@@ -15,19 +15,16 @@
#endif
#if BUILDFLAG(ENABLE_BRAVE_WEBTORRENT)
-#define BRAVE_WEBTORRENT_RESOURCES \
- AddComponentResourceEntries(kBraveWebtorrentResources, \
- kBraveWebtorrentResourcesSize); \
- AddComponentResourceEntries(kBraveWebtorrentGenerated, \
- kBraveWebtorrentGeneratedSize);
+#define BRAVE_WEBTORRENT_RESOURCES \
+ AddComponentResourceEntries(kBraveWebtorrentResources); \
+ AddComponentResourceEntries(kBraveWebtorrentGenerated);
#else
#define BRAVE_WEBTORRENT_RESOURCES
#endif
-#define BRAVE_CHROME_COMPONENT_EXTENSION_RESOURCE_MANAGER_DATA_DATA \
- AddComponentResourceEntries(kBraveExtension, kBraveExtensionSize); \
- AddComponentResourceEntries(kBraveExtensionGenerated, \
- kBraveExtensionGeneratedSize); \
+#define BRAVE_CHROME_COMPONENT_EXTENSION_RESOURCE_MANAGER_DATA_DATA \
+ AddComponentResourceEntries(kBraveExtension); \
+ AddComponentResourceEntries(kBraveExtensionGenerated); \
BRAVE_WEBTORRENT_RESOURCES
#include "src/chrome/browser/extensions/chrome_component_extension_resource_manager.cc"
diff --git a/chromium_src/chrome/browser/importer/external_process_importer_client.h b/chromium_src/chrome/browser/importer/external_process_importer_client.h
index 20b6eed02c02..375443d3f193 100644
--- a/chromium_src/chrome/browser/importer/external_process_importer_client.h
+++ b/chromium_src/chrome/browser/importer/external_process_importer_client.h
@@ -8,6 +8,7 @@
// To prevent re-defining Start() in timer.h by ours overriding.
#include "base/timer/timer.h"
+#include "components/history/core/browser/history_types.h"
#define BRAVE_EXTERNAL_PROCESS_IMPORTER_CLIENT_H \
friend class BraveExternalProcessImporterClient;
diff --git a/chromium_src/chrome/browser/importer/profile_writer.cc b/chromium_src/chrome/browser/importer/profile_writer.cc
index 868a7783430e..5f46331f354a 100644
--- a/chromium_src/chrome/browser/importer/profile_writer.cc
+++ b/chromium_src/chrome/browser/importer/profile_writer.cc
@@ -3,11 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
+#include "src/chrome/browser/importer/profile_writer.cc"
+
#include "base/uuid.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
-#include "components/autofill/core/browser/personal_data_manager.h"
-
-#include "src/chrome/browser/importer/profile_writer.cc"
+#include "components/autofill/core/browser/data_manager/personal_data_manager.h"
void ProfileWriter::AddCreditCard(const std::u16string& name_on_card,
const std::u16string& expiration_month,
diff --git a/chromium_src/chrome/browser/media/router/media_router_feature.cc b/chromium_src/chrome/browser/media/router/media_router_feature.cc
index 2d233f57fc35..50929c209558 100644
--- a/chromium_src/chrome/browser/media/router/media_router_feature.cc
+++ b/chromium_src/chrome/browser/media/router/media_router_feature.cc
@@ -9,10 +9,7 @@
#include "content/public/browser/browser_context.h"
#define MediaRouterEnabled MediaRouterEnabled_ChromiumImpl
-#define GlobalMediaControlsCastStartStopEnabled \
- GlobalMediaControlsCastStartStopEnabled_ChromiumImpl
#include "src/chrome/browser/media/router/media_router_feature.cc"
-#undef GlobalMediaControlsCastStartStopEnabled
#undef MediaRouterEnabled
namespace media_router {
@@ -37,14 +34,4 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
#endif
}
-#if !BUILDFLAG(IS_ANDROID)
-// This override forces GlobalMediaControlsCastStartStopEnabled to use our
-// version of MediaRouterEnabled, rather than the original. The implementation
-// of this function must be kept in sync with the original implementation.
-bool GlobalMediaControlsCastStartStopEnabled(content::BrowserContext* context) {
- return base::FeatureList::IsEnabled(kGlobalMediaControlsCastStartStop) &&
- MediaRouterEnabled(context);
-}
-#endif
-
} // namespace media_router
diff --git a/chromium_src/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc b/chromium_src/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
index 9fe0f54daa82..995357cf154d 100644
--- a/chromium_src/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
+++ b/chromium_src/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
@@ -5,6 +5,7 @@
#include "components/performance_manager/public/metrics/page_resource_monitor.h"
+#if !BUILDFLAG(IS_ANDROID)
namespace performance_manager::metrics {
namespace {
class StubGraphOwnedDefaultImpl : public GraphOwnedDefaultImpl {};
@@ -15,5 +16,8 @@ class StubGraphOwnedDefaultImpl : public GraphOwnedDefaultImpl {};
// nothing in Brave, but the collection is CPU-intensive. Disable it to save
// CPU during startup.
#define PageResourceMonitor StubGraphOwnedDefaultImpl
+#endif // !BUILDFLAG(IS_ANDROID)
#include "src/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc"
+#if !BUILDFLAG(IS_ANDROID)
#undef PageResourceMonitor
+#endif // !BUILDFLAG(IS_ANDROID)
diff --git a/chromium_src/chrome/browser/permissions/chrome_permissions_client.cc b/chromium_src/chrome/browser/permissions/chrome_permissions_client.cc
index 73a2748c902d..9330b3cb00c0 100644
--- a/chromium_src/chrome/browser/permissions/chrome_permissions_client.cc
+++ b/chromium_src/chrome/browser/permissions/chrome_permissions_client.cc
@@ -52,7 +52,7 @@ ChromePermissionsClient::MaybeCreateMessageUI(
ContentSettingsType type,
base::WeakPtr prompt) {
std::vector>
- requests = prompt->delegate()->Requests();
+ requests = prompt->delegate_public()->Requests();
if (requests.size() > 0) {
brave_wallet::mojom::CoinType coin_type =
brave_wallet::mojom::CoinType::ETH;
diff --git a/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.cc b/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.cc
index 0c7887fe9363..456cb55b6a13 100644
--- a/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.cc
+++ b/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.cc
@@ -40,4 +40,10 @@ bool ExtensionTelemetryServiceFactory::ServiceIsNULLWhileTesting() const {
return true;
}
+std::unique_ptr
+ExtensionTelemetryServiceFactory::BuildServiceInstanceForBrowserContext(
+ content::BrowserContext* context) const {
+ return nullptr;
+}
+
} // namespace safe_browsing
diff --git a/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.h b/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.h
index 2487b8fbc973..a0f7b01f5294 100644
--- a/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.h
+++ b/chromium_src/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.h
@@ -27,6 +27,9 @@ class ExtensionTelemetryServiceFactory : public ProfileKeyedServiceFactory {
ExtensionTelemetryServiceFactory& operator=(
const ExtensionTelemetryServiceFactory&) = delete;
+ std::unique_ptr BuildServiceInstanceForBrowserContext(
+ content::BrowserContext* context) const override;
+
private:
friend class base::NoDestructor;
diff --git a/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc b/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc
index 1aecb07862dc..48910b996923 100644
--- a/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc
+++ b/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc
@@ -44,8 +44,7 @@ TEST(AccountConsistencyDisabledTest, NewProfile) {
/*managed_prefs=*/base::MakeRefCounted(),
/*supervised_user_prefs=*/base::MakeRefCounted(),
/*extension_prefs=*/base::MakeRefCounted(),
- /*standalone_browser_prefs=*/
- base::MakeRefCounted(), std::move(user_prefs),
+ /*user_prefs=*/std::move(user_prefs),
/*recommended_prefs=*/base::MakeRefCounted(),
base::MakeRefCounted(),
std::make_unique());
diff --git a/chromium_src/chrome/browser/signin/android/signin_manager_android.cc b/chromium_src/chrome/browser/signin/android/signin_manager_android.cc
index 2573e6dae173..1ab306d30ccc 100644
--- a/chromium_src/chrome/browser/signin/android/signin_manager_android.cc
+++ b/chromium_src/chrome/browser/signin/android/signin_manager_android.cc
@@ -7,6 +7,9 @@
#include "base/android/callback_android.h"
#include "base/android/jni_string.h"
+#include "components/signin/public/identity_manager/identity_manager.h"
+
+// Must come after all headers that specialize FromJniType() / ToJniType().
#include "brave/build/android/jni_headers/BraveSigninManager_jni.h"
#include "chrome/android/chrome_jni_headers/SigninManagerImpl_jni.h"
diff --git a/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc
index 98bce8b8eb29..bb96545c15b3 100644
--- a/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -10,8 +10,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/autofill/payments/webauthn_dialog_controller_impl.h"
#include "chrome/browser/ui/page_info/page_info_dialog.h"
-#include "components/autofill/core/browser/browser_autofill_manager.h"
-#include "components/autofill/core/browser/form_data_importer.h"
+#include "components/autofill/core/browser/form_import/form_data_importer.h"
+#include "components/autofill/core/browser/foundations/browser_autofill_manager.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
@@ -22,6 +22,7 @@
namespace autofill {
namespace {
+
bool IsPrivateProfile(content::WebContents* web_contents) {
if (!web_contents) {
return false;
@@ -57,22 +58,15 @@ class BraveChromeAutofillClient : public ChromeAutofillClient {
enabled = enabled && GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows);
return enabled;
}
-};
-
-class BraveBrowserAutofillManager : public BrowserAutofillManager {
- public:
- using BrowserAutofillManager::BrowserAutofillManager;
bool IsAutofillEnabled() const override {
- auto enabled = BrowserAutofillManager::IsAutofillEnabled();
- if (client().GetProfileType() !=
- profile_metrics::BrowserProfileType::kIncognito &&
- client().GetProfileType() !=
+ auto enabled = ChromeAutofillClient::IsAutofillEnabled();
+ if (GetProfileType() != profile_metrics::BrowserProfileType::kIncognito &&
+ GetProfileType() !=
profile_metrics::BrowserProfileType::kOtherOffTheRecordProfile) {
return enabled;
}
- enabled = enabled &&
- client().GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows);
+ enabled = enabled && GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows);
return enabled;
}
};
@@ -81,7 +75,22 @@ class BraveBrowserAutofillManager : public BrowserAutofillManager {
#define WrapUnique WrapUnique(new autofill::BraveChromeAutofillClient(web_contents))); \
if (0) std::unique_ptr dummy(
-#define BrowserAutofillManager BraveBrowserAutofillManager
#include "src/chrome/browser/ui/autofill/chrome_autofill_client.cc"
-#undef BrowserAutofillManager
#undef WrapUnique
+
+namespace autofill {
+
+AutofillOptimizationGuide*
+ChromeAutofillClient::GetAutofillOptimizationGuide_Unused() const {
+ return nullptr;
+}
+
+bool ChromeAutofillClient::IsAutofillEnabled_Unused() const {
+ return false;
+}
+
+bool ChromeAutofillClient::IsAutocompleteEnabled_Unused() const {
+ return false;
+}
+
+} // namespace autofill
diff --git a/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.h b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.h
new file mode 100644
index 000000000000..9a418f50b913
--- /dev/null
+++ b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
+#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
+
+#include "components/autofill/content/browser/content_autofill_client.h"
+
+// Note, the _Unused methods below can retain "final" because the base class
+// override for components/autofill/content/browser/content_autofill_client.h
+// declares them specifically for this purpose.
+
+#define GetAutofillOptimizationGuide \
+ GetAutofillOptimizationGuide() const override; \
+ AutofillOptimizationGuide* GetAutofillOptimizationGuide_Unused
+
+#define IsAutofillEnabled \
+ IsAutofillEnabled() const override; \
+ bool IsAutofillEnabled_Unused
+
+#define IsAutocompleteEnabled \
+ IsAutocompleteEnabled() const override; \
+ bool IsAutocompleteEnabled_Unused
+
+#include "src/chrome/browser/ui/autofill/chrome_autofill_client.h" // IWYU pragma: export
+#undef IsAutocompleteEnabled
+#undef IsAutofillEnabled
+#undef GetAutofillOptimizationGuide
+
+#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
diff --git a/chromium_src/chrome/browser/ui/browser_navigator.cc b/chromium_src/chrome/browser/ui/browser_navigator.cc
index ad05da5f47a5..28be3bed2933 100644
--- a/chromium_src/chrome/browser/ui/browser_navigator.cc
+++ b/chromium_src/chrome/browser/ui/browser_navigator.cc
@@ -31,7 +31,7 @@ bool IsURLAllowedInIncognitoBraveImpl(const GURL& url) {
}
if (host == kRewardsPageHost || host == chrome::kChromeUISyncInternalsHost ||
- host == chrome::kChromeUISyncHost || host == kAdblockHost ||
+ host == chrome::kBraveUISyncHost || host == kAdblockHost ||
host == kWelcomeHost) {
return false;
}
diff --git a/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.cc b/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.cc
new file mode 100644
index 000000000000..f60042920315
--- /dev/null
+++ b/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.cc
@@ -0,0 +1,21 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h"
+
+#include "components/saved_tab_groups/internal/tab_group_sync_service_impl.h"
+#include "components/saved_tab_groups/public/tab_group_sync_service.h"
+
+#define OnTabSelected OnTabSelected_Unused
+#include "src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.cc" // IWYU pragma: export
+#undef OnTabSelected
+
+namespace tab_groups {
+
+void TabGroupSyncServiceProxy::OnTabSelected(
+ const std::optional& group_id,
+ const LocalTabID& tab_id) {}
+
+} // namespace tab_groups
diff --git a/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h b/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h
new file mode 100644
index 000000000000..8c93e7a9f9af
--- /dev/null
+++ b/chromium_src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h
@@ -0,0 +1,20 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_TAB_GROUP_SYNC_SERVICE_PROXY_H_
+#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_TAB_GROUP_SYNC_SERVICE_PROXY_H_
+
+#include "components/saved_tab_groups/public/tab_group_sync_service.h"
+
+#define OnTabSelected \
+ OnTabSelected_Unused(const std::optional& group_id, \
+ const LocalTabID& tab_id); \
+ void OnTabSelected
+
+#include "src/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h" // IWYU pragma: export
+
+#undef OnTabSelected
+
+#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_TAB_GROUP_SYNC_SERVICE_PROXY_H_
diff --git a/chromium_src/chrome/browser/ui/tabs/tab_strip_model.cc b/chromium_src/chrome/browser/ui/tabs/tab_strip_model.cc
index 1d64c4cc796b..238a2bd6e777 100644
--- a/chromium_src/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chromium_src/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
#define TabDragController TabDragControllerChromium
#include "src/chrome/browser/ui/tabs/tab_strip_model.cc" // IWYU pragma: export
diff --git a/chromium_src/chrome/browser/ui/tabs/tab_strip_model.h b/chromium_src/chrome/browser/ui/tabs/tab_strip_model.h
index 9f027f4ef0c3..b6a590cca6e4 100644
--- a/chromium_src/chrome/browser/ui/tabs/tab_strip_model.h
+++ b/chromium_src/chrome/browser/ui/tabs/tab_strip_model.h
@@ -6,15 +6,16 @@
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
-#define SelectRelativeTab virtual SelectRelativeTab
-#define TAB_STRIP_MODEL_H_ friend class BraveTabStripModel;
+#define SelectRelativeTab(...) \
+ virtual SelectRelativeTab(__VA_ARGS__); \
+ friend class BraveTabStripModel
+
#define IsReadLaterSupportedForAny virtual IsReadLaterSupportedForAny
#define TabDragController TabDragControllerChromium
#include "src/chrome/browser/ui/tabs/tab_strip_model.h" // IWYU pragma: export
#undef IsReadLaterSupportedForAny
#undef SelectRelativeTab
-#undef TAB_STRIP_MODEL_H_
#undef TabDragController
#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
diff --git a/chromium_src/chrome/browser/ui/ui_features.cc b/chromium_src/chrome/browser/ui/ui_features.cc
index 7ce9d15b8198..2d4a8569e666 100644
--- a/chromium_src/chrome/browser/ui/ui_features.cc
+++ b/chromium_src/chrome/browser/ui/ui_features.cc
@@ -13,11 +13,11 @@ namespace features {
OVERRIDE_FEATURE_DEFAULT_STATES({{
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
{kFewerUpdateConfirmations, base::FEATURE_DISABLED_BY_DEFAULT},
-#endif
-#if !BUILDFLAG(IS_ANDROID)
- {kHaTSWebUI, base::FEATURE_DISABLED_BY_DEFAULT},
#endif
{kTabHoverCardImages, base::FEATURE_DISABLED_BY_DEFAULT},
+#if !defined(ANDROID)
+ {kToolbarPinning, base::FEATURE_DISABLED_BY_DEFAULT},
+#endif
}});
} // namespace features
diff --git a/chromium_src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chromium_src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 60164e9db66d..3a7fa009cfb3 100644
--- a/chromium_src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chromium_src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -61,9 +61,9 @@ void LayoutBookmarkBarInstructionsView(views::View* bookmark_bar_view,
} // namespace
-#define BRAVE_LAYOUT \
- LayoutBookmarkBarInstructionsView(this, bookmark_model_, browser(), \
- button_height, x, max_x, y);
+#define BRAVE_LAYOUT \
+ LayoutBookmarkBarInstructionsView(this, bookmark_service_->bookmark_model(), \
+ browser(), button_height, x, max_x, y);
#define BookmarkContextMenu BraveBookmarkContextMenu
#include "src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc"
#undef BookmarkContextMenu
diff --git a/chromium_src/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc b/chromium_src/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
index e8b3795731a0..7a078687093f 100644
--- a/chromium_src/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
+++ b/chromium_src/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
@@ -7,7 +7,8 @@
// Set our radius value directly as kOmniboxExpandedRadius is mapped to
// more general token ShapeSysTokens::kMedium.
-#define kOmniboxExpandedRadius kOmniboxExpandedRadius); (corner_radius = 4
+#define kOmniboxExpandedRadius kOmniboxExpandedRadius) ? 4 : 4; \
+ DCHECK_EQ(corner_radius, 4
#include "src/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc"
diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
similarity index 69%
rename from chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.cc
rename to chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
index b2d62d721e76..45a1b3c1e96d 100644
--- a/chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
@@ -1,9 +1,9 @@
/* Copyright (c) 2022 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
-#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
+#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
#include "brave/browser/ui/views/frame/brave_browser_view.h"
#include "brave/browser/ui/views/frame/vertical_tab_strip_widget_delegate_view.h"
@@ -15,12 +15,6 @@
#define TabDragController TabDragControllerChromium
-// Wraps function calls so that they can work with a child NativeWindow as well.
-#define non_client_view() \
- non_client_view() \
- ? source->GetWidget()->non_client_view()->frame_view() \
- : source->GetWidget()->GetTopLevelWidget()->non_client_view()
-
// Remove drag threshold when it's vertical tab strip
#define GetHorizontalDragThreshold() \
GetHorizontalDragThreshold() - \
@@ -31,9 +25,8 @@
? attached_context_->GetHorizontalDragThreshold() \
: 0)
-#include "src/chrome/browser/ui/views/tabs/tab_drag_controller.cc"
+#include "src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc"
-#undef non_client_view
#undef GetHorizontalDragThreshold
#undef GetBrowserViewForNativeWindow
#undef TabDragController
diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h
similarity index 58%
rename from chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.h
rename to chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h
index e96159179069..bea553cdad1b 100644
--- a/chromium_src/chrome/browser/ui/views/tabs/tab_drag_controller.h
+++ b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h
@@ -1,10 +1,10 @@
/* Copyright (c) 2022 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
-#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
-#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
+#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_DRAGGING_TAB_DRAG_CONTROLLER_H_
+#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_DRAGGING_TAB_DRAG_CONTROLLER_H_
// In order to replace TabDragController with ours easily, rename upstream's
// implementation. Ours is in brave/browser/ui/views/tabs/tab_drag_controller.h
@@ -14,29 +14,28 @@ using TabDragControllerBrave = TabDragController;
#define TabDragController TabDragControllerChromium
-#define GetAttachedDragPoint \
- Unused_GetAttachedDragPoint() { return {}; } \
+#define GetAttachedDragPoint \
+ Unused_GetAttachedDragPoint() { \
+ return {}; \
+ } \
virtual gfx::Point GetAttachedDragPoint
#define InitDragData \
Unused_MoveUattached() {} \
friend TabDragControllerBrave; \
virtual void InitDragData
-#define GetAttachedBrowserWidget \
- GetAttachedBrowserWidget_Unused() { return {}; } \
+#define GetAttachedBrowserWidget \
+ GetAttachedBrowserWidget_Unused() { \
+ return {}; \
+ } \
virtual views::Widget* GetAttachedBrowserWidget
#define GetLocalProcessWindow virtual GetLocalProcessWindow
#define DetachAndAttachToNewContext virtual DetachAndAttachToNewContext
-#define CalculateNonMaximizedDraggedBrowserBounds \
- virtual CalculateNonMaximizedDraggedBrowserBounds
-#define CalculateDraggedBrowserBounds virtual CalculateDraggedBrowserBounds
#define ContinueDragging virtual ContinueDragging
-#include "src/chrome/browser/ui/views/tabs/tab_drag_controller.h" // IWYU pragma: export
+#include "src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h" // IWYU pragma: export
#undef ContinueDragging
-#undef CalculateDraggedBrowserBounds
-#undef CalculateNonMaximizedDraggedBrowserBounds
#undef DetachAndAttachToNewContext
#undef GetLocalProcessWindow
#undef GetAttachedBrowserWidget
@@ -46,4 +45,4 @@ using TabDragControllerBrave = TabDragController;
#include "brave/browser/ui/views/tabs/tab_drag_controller.h"
-#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
+#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_TABS_DRAGGING_TAB_DRAG_CONTROLLER_H_
diff --git a/chromium_src/chrome/browser/ui/webui/crashes_ui.cc b/chromium_src/chrome/browser/ui/webui/crashes/crashes_ui.cc
similarity index 88%
rename from chromium_src/chrome/browser/ui/webui/crashes_ui.cc
rename to chromium_src/chrome/browser/ui/webui/crashes/crashes_ui.cc
index 223f67840969..8c944ab9098c 100644
--- a/chromium_src/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chromium_src/chrome/browser/ui/webui/crashes/crashes_ui.cc
@@ -7,5 +7,5 @@
#include "components/version_info/version_info.h"
#define GetVersionNumber GetBraveVersionNumberForDisplay
-#include "src/chrome/browser/ui/webui/crashes_ui.cc"
+#include "src/chrome/browser/ui/webui/crashes/crashes_ui.cc"
#undef GetVersionNumber
diff --git a/chromium_src/chrome/browser/ui/webui/password_manager/password_manager_ui.cc b/chromium_src/chrome/browser/ui/webui/password_manager/password_manager_ui.cc
index e26210759795..752b4e614e59 100644
--- a/chromium_src/chrome/browser/ui/webui/password_manager/password_manager_ui.cc
+++ b/chromium_src/chrome/browser/ui/webui/password_manager/password_manager_ui.cc
@@ -6,8 +6,8 @@
#include "brave/browser/ui/webui/navigation_bar_data_provider.h"
#include "brave/grit/brave_unscaled_resources.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "ui/webui/webui_util.h"
namespace {
diff --git a/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.cc b/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.cc
index 240f5466d5cf..8ac526b0d4f2 100644
--- a/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.cc
+++ b/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.cc
@@ -7,7 +7,7 @@
#include "brave/components/search_engines/brave_prepopulated_engines.h"
#include "components/omnibox/browser/autocomplete_input.h"
-#include "content/public/browser/web_contents.h"
+#include "content/public/browser/page_navigator.h"
#include "net/base/url_util.h"
namespace {
@@ -26,14 +26,6 @@ content::OpenURLParams MaybeOverrideURLParams(content::OpenURLParams params,
} // namespace
-// We tweak a few AutocompleteInput settings because unlike Chromium we only
-// want keyword search results.
-#define set_prefer_keyword(prefer) \
- set_keyword_mode_entry_method( \
- metrics::OmniboxEventProto::KEYBOARD_SHORTCUT); \
- autocomplete_input.set_prefer_keyword(true)
-#define set_allow_exact_keyword_match(allow) set_allow_exact_keyword_match(true)
-
// Unfortunately, plumbing through the source doesn't seem trivial - it looks
// like it should be possible with the {source} part but it seems like it only
// works with Google Search. Additionally, the {source} param treats the NTP
@@ -50,5 +42,3 @@ content::OpenURLParams MaybeOverrideURLParams(content::OpenURLParams params,
#include "src/chrome/browser/ui/webui/searchbox/realbox_handler.cc"
#undef OpenURL
-#undef set_prefer_keyword
-#undef set_allow_exact_keyword_match
diff --git a/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.h b/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.h
index 2fe13cda8614..c4433833df82 100644
--- a/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.h
+++ b/chromium_src/chrome/browser/ui/webui/searchbox/realbox_handler.h
@@ -6,13 +6,14 @@
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SEARCHBOX_REALBOX_HANDLER_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SEARCHBOX_REALBOX_HANDLER_H_
-#define GetMatchWithUrl(...) \
- GetMatchWithUrl(__VA_ARGS__); \
- \
+#include "ui/webui/resources/cr_components/searchbox/searchbox.mojom.h"
+
+#define UpdateSelection(...) \
+ UpdateSelection(__VA_ARGS__); \
friend class BraveRealboxHandlerTest
#include "src/chrome/browser/ui/webui/searchbox/realbox_handler.h" // IWYU pragma: export
-#undef GetMatchWithUrl
+#undef UpdateSelection
#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SEARCHBOX_REALBOX_HANDLER_H_
diff --git a/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc b/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
index 86c5101c8f05..0811c5306051 100644
--- a/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
+++ b/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
@@ -3,7 +3,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
+#include "chrome/browser/ui/webui/searchbox/searchbox_handler.h"
+
#include "brave/components/vector_icons/vector_icons.h"
+#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/vector_icons.h"
namespace {
@@ -21,6 +24,16 @@ constexpr char kLeoWindowTabNewIconResourceName[] =
} \
if (icon.name == omnibox::kSwitchIcon
+// We tweak a few AutocompleteInput settings because unlike Chromium we only
+// want keyword search results.
+#define set_prefer_keyword(prefer) \
+ set_keyword_mode_entry_method( \
+ metrics::OmniboxEventProto::KEYBOARD_SHORTCUT); \
+ autocomplete_input.set_prefer_keyword(true)
+#define set_allow_exact_keyword_match(allow) set_allow_exact_keyword_match(true)
+
#include "src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc"
+#undef set_prefer_keyword
+#undef set_allow_exact_keyword_match
#undef kSwitchIcon
diff --git a/chromium_src/chrome/browser/ui/webui/settings/safety_check_handler.cc b/chromium_src/chrome/browser/ui/webui/settings/safety_check_handler.cc
deleted file mode 100644
index 871cffb187ef..000000000000
--- a/chromium_src/chrome/browser/ui/webui/settings/safety_check_handler.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2020 The Brave Authors. All rights reserved.
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "brave/grit/brave_generated_resources.h"
-#include "chrome/grit/generated_resources.h"
-
-#undef IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_ENABLED_STANDARD_AVAILABLE_ENHANCED // NOLINT
-// NOLINTNEXTLINE
-#define IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_ENABLED_STANDARD_AVAILABLE_ENHANCED \
- IDS_SETTINGS_BRAVE_SAFETY_CHECK_SAFE_BROWSING_ENABLED_STANDARD_AVAILABLE_ENHANCED // NOLINT
-
-#include "src/chrome/browser/ui/webui/settings/safety_check_handler.cc"
-#undef IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_ENABLED_STANDARD_AVAILABLE_ENHANCED // NOLINT
diff --git a/chromium_src/chrome/common/importer/firefox_importer_utils.cc b/chromium_src/chrome/common/importer/firefox_importer_utils.cc
new file mode 100644
index 000000000000..9d4d9e4c6613
--- /dev/null
+++ b/chromium_src/chrome/common/importer/firefox_importer_utils.cc
@@ -0,0 +1,19 @@
+/* Copyright (c) 2024 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "base/files/file_path.h"
+#include "brave/grit/brave_generated_resources.h"
+#include "build/build_config.h"
+
+#if BUILDFLAG(IS_ANDROID)
+// We don't use firefox importer on Android, so just return an empty path to
+// avoid linker error.
+base::FilePath GetProfilesINI() {
+ return base::FilePath();
+}
+#endif // !BUILDFLAG(IS_ANDROID)
+
+// Comment to keep clang format from moving this include in between headers.
+#include "src/chrome/common/importer/firefox_importer_utils.cc"
diff --git a/chromium_src/chrome/common/url_constants.h b/chromium_src/chrome/common/url_constants.h
index 29a1664f7cef..72b7127c6985 100644
--- a/chromium_src/chrome/common/url_constants.h
+++ b/chromium_src/chrome/common/url_constants.h
@@ -42,8 +42,8 @@ inline constexpr char kBrowserSettingsSearchEngineURL[] =
"chrome://settings/search";
// "Learn more" URL for Battery Saver Mode.
-inline constexpr char kBatterySaverModeLearnMoreUrl[] =
- "https://support.brave.com/hc/en-us/articles/13380606172557";
+inline constexpr char16_t kBatterySaverModeLearnMoreUrl[] =
+ u"https://support.brave.com/hc/en-us/articles/13380606172557";
// The URL for providing help when the Bluetooth adapter is off.
inline constexpr char kBluetoothAdapterOffHelpURL[] =
@@ -245,8 +245,8 @@ inline constexpr char kGoogleTwoFactorIntersitialURL[] =
inline constexpr char kGooglePasswordManagerURL[] = "https://support.brave.com";
// The URL for the "Learn more" link for the High Efficiency Mode.
-inline constexpr char kMemorySaverModeLearnMoreUrl[] =
- "https://support.brave.com/hc/en-us/articles/13383683902733";
+inline constexpr char16_t kMemorySaverModeLearnMoreUrl[] =
+ u"https://support.brave.com/hc/en-us/articles/13383683902733";
// The URL in the help text for the High Efficiency Mode tab discarding
// exceptions add dialog.
@@ -331,7 +331,7 @@ inline constexpr char kAddressesAndPaymentMethodsLearnMoreURL[] =
"https://support.brave.com";
// Help URL for Autofill Prediction Improvements.
-inline constexpr char16_t kAutofillPredictionImprovementsLearnMoreURL[] =
+inline constexpr char16_t kAutofillAiLearnMoreURL[] =
u"https://support.brave.com";
// "Learn more" URL for the performance intervention notification setting.
@@ -339,7 +339,8 @@ inline constexpr char16_t kPerformanceInterventionLearnMoreUrl[] =
u"https://support.brave.com";
// "Learn more" URL for the preloading section in Performance settings.
-inline constexpr char kPreloadingLearnMoreUrl[] = "https://support.brave.com";
+inline constexpr char16_t kPreloadingLearnMoreUrl[] =
+ u"https://support.brave.com";
// "Learn more" URL for the Privacy section under Options.
inline constexpr char kPrivacyLearnMoreURL[] =
@@ -410,6 +411,11 @@ inline constexpr char kSyncGoogleDashboardURL[] = "https://support.brave.com/";
// The URL for the "Learn more" page for sync setup on the personal stuff page.
inline constexpr char16_t kSyncLearnMoreURL[] = u"https://support.brave.com/";
+// The URL for the "Learn more" page for signing in to chrome with expanded
+// section on "Sign in and turn on sync" in the Computer/Desktop tab.
+inline constexpr char kSigninOnDesktopLearnMoreURL[] =
+ "https://support.brave.com/";
+
// The URL for the "Learn more" page for AI settings for managed users.
inline constexpr char16_t kAiSettingsLearnMorePageManagedUrl[] =
u"https://support.brave.com/";
@@ -491,14 +497,29 @@ inline constexpr char16_t kWhoIsMyAdministratorHelpURL[] =
inline constexpr char16_t kCwsEnhancedSafeBrowsingLearnMoreURL[] =
u"https://support.brave.com/";
-// The URL path to online privacy policy.
+// The URL path to Google's Privacy Policy page.
+inline constexpr char kPrivacyPolicyURL[] = "https://support.brave.com/";
+
+// The URL path to Google's Privacy Policy page for users in China.
+inline constexpr char kPrivacyPolicyURLChina[] = "https://support.brave.com/";
+
+// The URL path to Google's Embedded Privacy Policy page.
inline constexpr char kPrivacyPolicyOnlineURLPath[] =
"https://support.brave.com/";
-// The URL path to online privacy policy dark mode.
+// The URL path to Google's Embedded Privacy Policy page - Dark Mode.
inline constexpr char kPrivacyPolicyOnlineDarkModeURLPath[] =
"https://support.brave.com/";
+// The URL path to Google's Embedded Privacy Policy page for users in China.
+inline constexpr char kPrivacyPolicyEmbeddedURLPathChina[] =
+ "https://support.brave.com/";
+
+// The URL path to Google's Embedded Privacy Policy page for users in China -
+// Dark Mode.
+inline constexpr char kPrivacyPolicyEmbeddedDarkModeURLPathChina[] =
+ "https://support.brave.com/";
+
#if BUILDFLAG(IS_ANDROID)
// "Learn more" URL for the enhanced playback notification dialog.
inline constexpr char kEnhancedPlaybackNotificationLearnMoreURL[] =
diff --git a/chromium_src/chrome/common/webui_url_constants.h b/chromium_src/chrome/common/webui_url_constants.h
index 4f08996f5c2f..f656cce9d2dd 100644
--- a/chromium_src/chrome/common/webui_url_constants.h
+++ b/chromium_src/chrome/common/webui_url_constants.h
@@ -13,6 +13,7 @@
namespace chrome {
inline constexpr char kPerformanceSubPage[] = "system";
+inline constexpr char kBraveUISyncHost[] = "sync";
} // namespace chrome
diff --git a/chromium_src/chrome/elevation_service/elevator.cc b/chromium_src/chrome/elevation_service/elevator.cc
index 6e067a5faac6..bf9d69155133 100644
--- a/chromium_src/chrome/elevation_service/elevator.cc
+++ b/chromium_src/chrome/elevation_service/elevator.cc
@@ -53,8 +53,7 @@ HRESULT Elevator::InstallVPNServices() {
validation_data->cend());
// Note: Validation should always be done using caller impersonation token.
- std::string log_message;
- HRESULT validation_result = ValidateData(process, data, &log_message);
+ HRESULT validation_result = ValidateData(process, data);
if (FAILED(validation_result)) {
return validation_result;
}
diff --git a/chromium_src/chrome/installer/linux/common/brave-browser/chromium-browser.info b/chromium_src/chrome/installer/linux/common/brave-browser/chromium-browser.info
index bce607074643..b74c5d2baaf8 100644
--- a/chromium_src/chrome/installer/linux/common/brave-browser/chromium-browser.info
+++ b/chromium_src/chrome/installer/linux/common/brave-browser/chromium-browser.info
@@ -14,6 +14,9 @@ PROGNAME=brave
# Base directory for package installation.
INSTALLDIR=/opt/brave.com/brave
+# Directory for device policy enrollments.
+ENROLLMENTDIR=/etc/brave/policies/enrollment
+
# Display string for desktop menu/icon.
MENUNAME="Brave Web Browser"
diff --git a/chromium_src/components/autofill/content/browser/content_autofill_client.cc b/chromium_src/components/autofill/content/browser/content_autofill_client.cc
new file mode 100644
index 000000000000..eae935934db6
--- /dev/null
+++ b/chromium_src/components/autofill/content/browser/content_autofill_client.cc
@@ -0,0 +1,25 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "components/autofill/content/browser/content_autofill_client.h"
+
+#include "src/components/autofill/content/browser/content_autofill_client.cc"
+
+namespace autofill {
+
+AutofillOptimizationGuide*
+BraveContentAutofillClientUnused::GetAutofillOptimizationGuide_Unused() const {
+ return nullptr;
+}
+
+bool BraveContentAutofillClientUnused::IsAutofillEnabled_Unused() const {
+ return false;
+}
+
+bool BraveContentAutofillClientUnused::IsAutocompleteEnabled_Unused() const {
+ return false;
+}
+
+} // namespace autofill
diff --git a/chromium_src/components/autofill/content/browser/content_autofill_client.h b/chromium_src/components/autofill/content/browser/content_autofill_client.h
new file mode 100644
index 000000000000..06c613926728
--- /dev/null
+++ b/chromium_src/components/autofill/content/browser/content_autofill_client.h
@@ -0,0 +1,34 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_CLIENT_H_
+#define BRAVE_CHROMIUM_SRC_COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_CLIENT_H_
+
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
+#include "components/autofill/content/common/mojom/autofill_agent.mojom.h"
+#include "components/autofill/core/browser/foundations/autofill_client.h"
+
+namespace autofill {
+
+// This struct is only needed to add _Unused methods. These methods are needed
+// because ChromeAutofillClient which derives from ContentAutofillClient marks
+// several methods as final and we want to override them by re-defining them as
+// _Unused and adding our own normally-named methods. But, since the _Unused
+// methods would still be marked as final they need to be virtual in a base
+// class - which is what we are providing here.
+struct BraveContentAutofillClientUnused {
+ virtual AutofillOptimizationGuide* GetAutofillOptimizationGuide_Unused()
+ const;
+ virtual bool IsAutofillEnabled_Unused() const;
+ virtual bool IsAutocompleteEnabled_Unused() const;
+};
+
+} // namespace autofill
+
+#define AutofillClient BraveContentAutofillClientUnused, public AutofillClient
+#include "src/components/autofill/content/browser/content_autofill_client.h" // IWYU pragma: export
+#undef AutofillClient
+
+#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_CLIENT_H_
diff --git a/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc b/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc
index d25901178856..71479cedbeea 100644
--- a/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc
+++ b/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc
@@ -14,7 +14,7 @@ namespace {
// This replicates the functionality that the removed upstream flag
// kAutofillEnableOfferNotificationForPromoCodes used to have.
-bool BraveIsOfferValid(AutofillOfferData* offer) {
+bool BraveIsOfferValid(const AutofillOfferData* offer) {
if (!offer) {
return false;
}
diff --git a/chromium_src/components/autofill/core/browser/autofill_experiments.cc b/chromium_src/components/autofill/core/browser/studies/autofill_experiments.cc
similarity index 66%
rename from chromium_src/components/autofill/core/browser/autofill_experiments.cc
rename to chromium_src/components/autofill/core/browser/studies/autofill_experiments.cc
index 0c9bb7d8dbcf..2ee86cc1b25b 100644
--- a/chromium_src/components/autofill/core/browser/autofill_experiments.cc
+++ b/chromium_src/components/autofill/core/browser/studies/autofill_experiments.cc
@@ -1,7 +1,7 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
#include
@@ -14,7 +14,7 @@ class SyncService;
namespace autofill {
class LogManager;
-class PersonalDataManager;
+class PaymentsDataManager;
bool IsCreditCardUploadEnabled(
const syncer::SyncService* sync_service,
const PrefService& pref_service,
@@ -23,17 +23,18 @@ bool IsCreditCardUploadEnabled(
LogManager* log_manager) {
return false;
}
-bool IsCreditCardMigrationEnabled(PersonalDataManager* personal_data_manager,
- syncer::SyncService* sync_service,
- const PrefService& pref_service,
- bool is_test_mode,
- LogManager* log_manager) {
+bool IsCreditCardMigrationEnabled(
+ const PaymentsDataManager& payments_data_manager,
+ const syncer::SyncService* sync_service,
+ const PrefService& pref_service,
+ bool is_test_mode,
+ LogManager* log_manager) {
return false;
}
} // namespace autofill
#define IsCreditCardUploadEnabled IsCreditCardUploadEnabled_ChromiumImpl
#define IsCreditCardMigrationEnabled IsCreditCardMigrationEnabled_ChromiumImpl
-#include "src/components/autofill/core/browser/autofill_experiments.cc"
+#include "src/components/autofill/core/browser/studies/autofill_experiments.cc"
#undef IsCreditCardUploadEnabled
#undef IsCreditCardMigrationEnabled
diff --git a/chromium_src/components/autofill/core/browser/autofill_experiments_unittest.cc b/chromium_src/components/autofill/core/browser/studies/autofill_experiments_unittest.cc
similarity index 96%
rename from chromium_src/components/autofill/core/browser/autofill_experiments_unittest.cc
rename to chromium_src/components/autofill/core/browser/studies/autofill_experiments_unittest.cc
index 7d0277033854..fad2ce122a01 100644
--- a/chromium_src/components/autofill/core/browser/autofill_experiments_unittest.cc
+++ b/chromium_src/components/autofill/core/browser/studies/autofill_experiments_unittest.cc
@@ -1,9 +1,9 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
-#include "components/autofill/core/browser/autofill_experiments.h"
+#include "components/autofill/core/browser/studies/autofill_experiments.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/logging/log_manager.h"
diff --git a/chromium_src/components/commerce/core/commerce_feature_list.cc b/chromium_src/components/commerce/core/commerce_feature_list.cc
index 13e13c4a3fee..f777331c7ad2 100644
--- a/chromium_src/components/commerce/core/commerce_feature_list.cc
+++ b/chromium_src/components/commerce/core/commerce_feature_list.cc
@@ -13,7 +13,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
{kCommerceAllowOnDemandBookmarkUpdates, base::FEATURE_DISABLED_BY_DEFAULT},
{kCommerceDeveloper, base::FEATURE_DISABLED_BY_DEFAULT},
{kCommerceMerchantViewer, base::FEATURE_DISABLED_BY_DEFAULT},
- {kCommercePriceTracking, base::FEATURE_DISABLED_BY_DEFAULT},
+ {kPriceAnnotations, base::FEATURE_DISABLED_BY_DEFAULT},
{kShoppingList, base::FEATURE_DISABLED_BY_DEFAULT},
{kShoppingPDPMetrics, base::FEATURE_DISABLED_BY_DEFAULT},
{kRetailCoupons, base::FEATURE_DISABLED_BY_DEFAULT},
diff --git a/chromium_src/components/content_settings/core/browser/content_settings_registry.cc b/chromium_src/components/content_settings/core/browser/content_settings_registry.cc
index f06faa439a16..a7cf038b111e 100644
--- a/chromium_src/components/content_settings/core/browser/content_settings_registry.cc
+++ b/chromium_src/components/content_settings/core/browser/content_settings_registry.cc
@@ -253,6 +253,19 @@ void ContentSettingsRegistry::BraveInit() {
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
+ // Disable WebNFC by default
+ content_settings_info_.erase(ContentSettingsType::NFC);
+ website_settings_registry_->UnRegister(ContentSettingsType::NFC);
+ Register(ContentSettingsType::NFC, "nfc-devices", CONTENT_SETTING_BLOCK,
+ WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_primary_schemes=*/{},
+ /*valid_settings=*/
+ {CONTENT_SETTING_ALLOW, CONTENT_SETTING_ASK, CONTENT_SETTING_BLOCK},
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
+ WebsiteSettingsRegistry::DESKTOP |
+ WebsiteSettingsRegistry::PLATFORM_ANDROID,
+ ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE,
+ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
+
// Disable motion sensors by default (brave/brave-browser#4789)
content_settings_info_.erase(ContentSettingsType::SENSORS);
website_settings_registry_->UnRegister(ContentSettingsType::SENSORS);
diff --git a/chromium_src/components/history_clusters/core/features.cc b/chromium_src/components/history_clusters/core/features.cc
index 5daef70586a0..a2162edbcb4d 100644
--- a/chromium_src/components/history_clusters/core/features.cc
+++ b/chromium_src/components/history_clusters/core/features.cc
@@ -15,11 +15,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
base::FEATURE_DISABLED_BY_DEFAULT},
{kJourneys, base::FEATURE_DISABLED_BY_DEFAULT},
{kJourneysImages, base::FEATURE_DISABLED_BY_DEFAULT},
- {kJourneysNamedNewTabGroups, base::FEATURE_DISABLED_BY_DEFAULT},
- {kJourneysPersistCachesToPrefs, base::FEATURE_DISABLED_BY_DEFAULT},
- {kJourneysZeroStateFiltering, base::FEATURE_DISABLED_BY_DEFAULT},
{kOmniboxAction, base::FEATURE_DISABLED_BY_DEFAULT},
{kOmniboxHistoryClusterProvider, base::FEATURE_DISABLED_BY_DEFAULT},
- {kPersistContextAnnotationsInHistoryDb, base::FEATURE_DISABLED_BY_DEFAULT},
}});
} // namespace history_clusters::internal
diff --git a/chromium_src/components/metrics/metrics_features.cc b/chromium_src/components/metrics/metrics_features.cc
index 6109271e8e51..540bb2a71965 100644
--- a/chromium_src/components/metrics/metrics_features.cc
+++ b/chromium_src/components/metrics/metrics_features.cc
@@ -10,7 +10,6 @@
namespace metrics::features {
OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kMetricsServiceDeltaSnapshotInBg, base::FEATURE_DISABLED_BY_DEFAULT},
{kStructuredMetrics, base::FEATURE_DISABLED_BY_DEFAULT},
}});
diff --git a/chromium_src/components/optimization_guide/core/model_execution/model_execution_features.cc b/chromium_src/components/optimization_guide/core/model_execution/model_execution_features.cc
index 5e9e43830682..2d50c1aa888e 100644
--- a/chromium_src/components/optimization_guide/core/model_execution/model_execution_features.cc
+++ b/chromium_src/components/optimization_guide/core/model_execution/model_execution_features.cc
@@ -3,16 +3,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#define IsOnDeviceModelAdaptationEnabled \
- IsOnDeviceModelAdaptationEnabled_ChromiumImpl
+#define GetOptimizationTargetForCapability \
+ GetOptimizationTargetForCapability_ChromiumImpl
#include "src/components/optimization_guide/core/model_execution/model_execution_features.cc"
-#undef IsOnDeviceModelAdaptationEnabled
+#undef GetOptimizationTargetForCapability
namespace optimization_guide::features::internal {
-bool IsOnDeviceModelAdaptationEnabled(ModelBasedCapabilityKey feature) {
- return false;
+std::optional GetOptimizationTargetForCapability(
+ ModelBasedCapabilityKey feature_key) {
+ return std::nullopt;
}
} // namespace optimization_guide::features::internal
diff --git a/chromium_src/components/page_content_annotations/core/page_content_annotations_features.cc b/chromium_src/components/page_content_annotations/core/page_content_annotations_features.cc
index adba280ee653..ebf9aeb1198b 100644
--- a/chromium_src/components/page_content_annotations/core/page_content_annotations_features.cc
+++ b/chromium_src/components/page_content_annotations/core/page_content_annotations_features.cc
@@ -3,17 +3,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#include "src/components/page_content_annotations/core/page_content_annotations_features.cc"
+#include "components/page_content_annotations/core/page_content_annotations_features.h"
+
+#define ShouldEnablePageContentAnnotations \
+ ShouldEnablePageContentAnnotations_ChromiumImpl
-#include "base/feature_override.h"
+#include "src/components/page_content_annotations/core/page_content_annotations_features.cc"
+#undef ShouldEnablePageContentAnnotations
namespace page_content_annotations::features {
-OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kPageContentAnnotations, base::FEATURE_DISABLED_BY_DEFAULT},
- {kPageVisibilityBatchAnnotations, base::FEATURE_DISABLED_BY_DEFAULT},
- {kPageVisibilityPageContentAnnotations, base::FEATURE_DISABLED_BY_DEFAULT},
- {kRemotePageMetadata, base::FEATURE_DISABLED_BY_DEFAULT},
-}});
+bool ShouldEnablePageContentAnnotations() {
+ return false;
+}
} // namespace page_content_annotations::features
diff --git a/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.cc b/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.cc
index 68f13f918fe6..2093354e6e30 100644
--- a/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.cc
+++ b/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.cc
@@ -59,43 +59,53 @@ void ApplyLifetimeToPermissionRequests(
}
const int selected_lifetime_option =
Java_BravePermissionDialogDelegate_getSelectedLifetimeOption(env, obj);
- DCHECK(!ShouldShowLifetimeOptions(permission_prompt->delegate()) ||
+ DCHECK(!ShouldShowLifetimeOptions(permission_prompt->delegate_public()) ||
selected_lifetime_option != -1);
if (selected_lifetime_option != -1) {
std::vector lifetime_options =
CreatePermissionLifetimeOptions();
SetRequestsLifetime(lifetime_options, selected_lifetime_option,
- permission_prompt->delegate());
+ permission_prompt->delegate_public());
}
}
void ApplyDontAskAgainOption(JNIEnv* env,
const JavaParamRef& obj,
PermissionPromptAndroid* permission_prompt) {
- if (permission_prompt->delegate()->Requests().size() < 1) {
+ if (permission_prompt->delegate_public()->Requests().size() < 1) {
return;
}
const bool dont_ask_again =
Java_BravePermissionDialogDelegate_getDontAskAgain(env, obj);
- PermissionRequest* request = permission_prompt->delegate()->Requests()[0];
+ PermissionRequest* request =
+ permission_prompt->delegate_public()->Requests()[0];
request->set_dont_ask_again(dont_ask_again);
}
} // namespace
+// static
+std::unique_ptr PermissionDialogDelegate::Create(
+ content::WebContents* web_contents,
+ PermissionPromptAndroid_ChromiumImpl* permission_prompt) {
+ // This should never be invoked, created only as a stub.
+ // a method with PermissionPromptAndroid* should be invoked instead.
+ NOTREACHED();
+}
+
void PermissionDialogJavaDelegate::
Java_PermissionDialogController_createDialog_BraveImpl(
JNIEnv* env,
const base::android::JavaRef& j_delegate) {
#if BUILDFLAG(ENABLE_WIDEVINE)
if (HasWidevinePermissionRequest(
- permission_prompt_->delegate()->Requests())) {
+ permission_prompt_->delegate_public()->Requests())) {
Java_BravePermissionDialogDelegate_setIsWidevinePermissionRequest(
env, j_delegate, true);
}
#endif
- if (ShouldShowLifetimeOptions(permission_prompt_->delegate())) {
+ if (ShouldShowLifetimeOptions(permission_prompt_->delegate_public())) {
SetLifetimeOptions(j_delegate);
}
diff --git a/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.h b/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.h
new file mode 100644
index 000000000000..5817cafe63b2
--- /dev/null
+++ b/chromium_src/components/permissions/android/permission_prompt/permission_dialog_delegate.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2025 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_ANDROID_PERMISSION_PROMPT_PERMISSION_DIALOG_DELEGATE_H_
+#define BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_ANDROID_PERMISSION_PROMPT_PERMISSION_DIALOG_DELEGATE_H_
+
+// Forward includes to avoid redefine of Create term
+#include "base/task/cancelable_task_tracker.h"
+#include "content/public/browser/web_contents_observer.h"
+
+namespace permissions {
+class PermissionPromptAndroid_ChromiumImpl;
+} // namespace permissions
+
+// Additional PermissionDialogDelegate::Create stub method to be in accordance
+// with the overridden method at permission_prompt_android.h
+// void CreatePermissionDialogDelegate() {
+// permission_dialog_delegate_ =
+// PermissionDialogDelegate::Create(web_contents_, this);
+// }
+// which after PermissionPromptAndroid_ChromiumImpl override wants us to pass
+// PermissionPromptAndroid_ChromiumImpl* as the second arg.
+
+#define Create \
+ Create(content::WebContents* web_contents, \
+ PermissionPromptAndroid_ChromiumImpl* permission_prompt); \
+ static std::unique_ptr Create
+
+#include "src/components/permissions/android/permission_prompt/permission_dialog_delegate.h" // IWYU pragma: export
+
+#undef Create
+
+#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_ANDROID_PERMISSION_PROMPT_PERMISSION_DIALOG_DELEGATE_H_
diff --git a/chromium_src/components/permissions/android/permission_prompt/permission_prompt_android.h b/chromium_src/components/permissions/android/permission_prompt/permission_prompt_android.h
index df27d9fc525a..d4bbd5aa67cc 100644
--- a/chromium_src/components/permissions/android/permission_prompt/permission_prompt_android.h
+++ b/chromium_src/components/permissions/android/permission_prompt/permission_prompt_android.h
@@ -6,23 +6,26 @@
#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_ANDROID_PERMISSION_PROMPT_PERMISSION_PROMPT_ANDROID_H_
#define BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_ANDROID_PERMISSION_PROMPT_PERMISSION_PROMPT_ANDROID_H_
+#include "components/permissions/android/permission_prompt/permission_dialog_delegate.h"
#include "components/permissions/request_type.h"
#define PermissionPromptAndroid PermissionPromptAndroid_ChromiumImpl
-#define GetIconId virtual GetIconId
-#define ShouldUseRequestingOriginFavicon \
- virtual ShouldUseRequestingOriginFavicon
-#define PermissionCount \
- NotUsed() { return 0; } \
- Delegate* delegate() const { return delegate_; } \
+#define PermissionCount \
+ NotUsed() { \
+ return 0; \
+ } \
+ /* We can't override delegate to make it public, because at */ \
+ /* permission_prompt_android.h delegate is used both */ \
+ /* as the argument name and the method name */ \
+ Delegate* delegate_public() const { \
+ return delegate_; \
+ } \
size_t PermissionCount
#include "src/components/permissions/android/permission_prompt/permission_prompt_android.h" // IWYU pragma: export
#undef PermissionCount
-#undef ShouldUseRequestingOriginFavicon
-#undef GetIconId
#undef PermissionPromptAndroid
namespace permissions {
@@ -39,6 +42,10 @@ class PermissionPromptAndroid : public PermissionPromptAndroid_ChromiumImpl {
int GetIconId() const override;
bool ShouldUseRequestingOriginFavicon() const override;
+
+ void CreatePermissionDialogDelegate() {
+ PermissionDialogDelegate::Create(web_contents(), this);
+ }
};
} // namespace permissions
diff --git a/chromium_src/components/permissions/features.cc b/chromium_src/components/permissions/features.cc
index 18df826018f8..0dac6402249e 100644
--- a/chromium_src/components/permissions/features.cc
+++ b/chromium_src/components/permissions/features.cc
@@ -17,6 +17,8 @@ BASE_FEATURE(kPermissionLifetime,
OVERRIDE_FEATURE_DEFAULT_STATES({{
{kPermissionOnDeviceNotificationPredictions,
base::FEATURE_DISABLED_BY_DEFAULT},
+ {kPermissionPredictionsV2, base::FEATURE_DISABLED_BY_DEFAULT},
+ {kPermissionPredictionsV3, base::FEATURE_DISABLED_BY_DEFAULT},
#if !BUILDFLAG(IS_ANDROID)
{kPermissionsPromptSurvey, base::FEATURE_DISABLED_BY_DEFAULT},
#endif
diff --git a/chromium_src/components/printing/renderer/print_render_frame_helper.h b/chromium_src/components/printing/renderer/print_render_frame_helper.h
index 613e7a8ae52c..afe82df1dc8e 100644
--- a/chromium_src/components/printing/renderer/print_render_frame_helper.h
+++ b/chromium_src/components/printing/renderer/print_render_frame_helper.h
@@ -43,9 +43,9 @@ class PrintRenderFrameHelper : public PrintRenderFrameHelper_ChromiumImpl {
#endif
bool has_selection) override;
void SetIsPrintPreviewExtraction(bool value) override;
-#endif
bool is_print_preview_extraction_ = false;
+#endif
};
} // namespace printing
diff --git a/chromium_src/components/privacy_sandbox/privacy_sandbox_prefs.h b/chromium_src/components/privacy_sandbox/privacy_sandbox_prefs.h
index 570aff6b08b3..9464bd78c23e 100644
--- a/chromium_src/components/privacy_sandbox/privacy_sandbox_prefs.h
+++ b/chromium_src/components/privacy_sandbox/privacy_sandbox_prefs.h
@@ -15,8 +15,6 @@ namespace prefs {
// sure these modes are not enabled.
inline constexpr char kPrivacySandboxApisEnabled[] =
"privacy_sandbox.apis_enabled";
-inline constexpr char kPrivacySandboxApisEnabledV2[] =
- "privacy_sandbox.apis_enabled_v2";
inline constexpr char kPrivacySandboxManuallyControlledV2[] =
"privacy_sandbox.manually_controlled_v2";
diff --git a/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc b/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc
index 5b5044cd966f..b94cea6d177e 100644
--- a/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc
+++ b/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc
@@ -528,8 +528,6 @@ TEST_F(PrivacySandboxSettingsTest, IsTopicsAllowed) {
// enabled.
profile()->GetTestingPrefService()->SetBoolean(
prefs::kPrivacySandboxApisEnabled, true);
- profile()->GetTestingPrefService()->SetBoolean(
- prefs::kPrivacySandboxApisEnabledV2, true);
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
SetupTestState(
@@ -541,8 +539,6 @@ TEST_F(PrivacySandboxSettingsTest, IsTopicsAllowed) {
/*managed_cookie_exceptions=*/{});
profile()->GetTestingPrefService()->SetBoolean(
prefs::kPrivacySandboxApisEnabled, true);
- profile()->GetTestingPrefService()->SetBoolean(
- prefs::kPrivacySandboxApisEnabledV2, true);
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
SetupTestState(
@@ -554,8 +550,6 @@ TEST_F(PrivacySandboxSettingsTest, IsTopicsAllowed) {
/*managed_cookie_exceptions=*/{});
profile()->GetTestingPrefService()->SetBoolean(
prefs::kPrivacySandboxApisEnabled, true);
- profile()->GetTestingPrefService()->SetBoolean(
- prefs::kPrivacySandboxApisEnabledV2, true);
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
SetupTestState(
@@ -567,8 +561,6 @@ TEST_F(PrivacySandboxSettingsTest, IsTopicsAllowed) {
/*managed_cookie_exceptions=*/{});
profile()->GetTestingPrefService()->SetBoolean(
prefs::kPrivacySandboxApisEnabled, true);
- profile()->GetTestingPrefService()->SetBoolean(
- prefs::kPrivacySandboxApisEnabledV2, true);
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
}
diff --git a/chromium_src/components/safe_browsing/core/common/features.cc b/chromium_src/components/safe_browsing/core/common/features.cc
index 66b04aaf0122..6665c1c707ba 100644
--- a/chromium_src/components/safe_browsing/core/common/features.cc
+++ b/chromium_src/components/safe_browsing/core/common/features.cc
@@ -11,10 +11,7 @@
namespace safe_browsing {
OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kExtensionTelemetryDisableOffstoreExtensions,
- base::FEATURE_DISABLED_BY_DEFAULT},
{kExtensionTelemetryForEnterprise, base::FEATURE_DISABLED_BY_DEFAULT},
- {kExtensionTelemetryTabsApiSignal, base::FEATURE_DISABLED_BY_DEFAULT},
{kGooglePlayProtectInApkTelemetry, base::FEATURE_DISABLED_BY_DEFAULT},
}});
diff --git a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc
index 8b2e23977616..70d5d4b6789a 100644
--- a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc
+++ b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc
@@ -16,6 +16,7 @@
#include "brave/components/search_engines/brave_prepopulated_engines.h"
#include "components/google/core/common/google_switches.h"
#include "components/prefs/testing_pref_service.h"
+#include "components/regional_capabilities/regional_capabilities_test_utils.h"
#include "components/search_engines/search_engine_choice/search_engine_choice_service.h"
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h"
@@ -48,9 +49,12 @@ const std::unordered_set kOverriddenEnginesNames = {
class BraveTemplateURLPrepopulateDataTest : public testing::Test {
public:
BraveTemplateURLPrepopulateDataTest()
- : search_engine_choice_service_(
+ : regional_capabilities_service_(
+ regional_capabilities::CreateServiceWithFakeClient(prefs_)),
+ search_engine_choice_service_(
prefs_,
&local_state_,
+ *regional_capabilities_service_,
/*is_profile_eligible_for_dse_guest_propagation=*/false) {}
void SetUp() override {
TemplateURLPrepopulateData::RegisterProfilePrefs(prefs_.registry());
@@ -88,6 +92,8 @@ class BraveTemplateURLPrepopulateDataTest : public testing::Test {
protected:
sync_preferences::TestingPrefServiceSyncable prefs_;
TestingPrefServiceSimple local_state_;
+ std::unique_ptr
+ regional_capabilities_service_;
search_engines::SearchEngineChoiceService search_engine_choice_service_;
std::vector brave_prepopulated_engines_;
};
diff --git a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc
index 0060145136f4..dcfcbbd6fe7d 100644
--- a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc
+++ b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc
@@ -11,6 +11,7 @@
#include "base/strings/utf_string_conversions.h"
#include "brave/components/search_engines/brave_prepopulated_engines.h"
#include "components/country_codes/country_codes.h"
+#include "components/regional_capabilities/regional_capabilities_test_utils.h"
#include "components/search_engines/search_engine_choice/search_engine_choice_service.h"
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h"
@@ -46,9 +47,12 @@ std::unique_ptr CreatePrepopulateTemplateURLData(
class BraveTemplateURLServiceUtilTest : public testing::Test {
public:
BraveTemplateURLServiceUtilTest()
- : search_engine_choice_service_(
+ : regional_capabilities_service_(
+ regional_capabilities::CreateServiceWithFakeClient(prefs_)),
+ search_engine_choice_service_(
prefs_,
&local_state_,
+ *regional_capabilities_service_,
/*is_profile_eligible_for_dse_guest_propagation=*/false) {}
void SetUp() override {
TemplateURLPrepopulateData::RegisterProfilePrefs(prefs_.registry());
@@ -57,6 +61,8 @@ class BraveTemplateURLServiceUtilTest : public testing::Test {
protected:
sync_preferences::TestingPrefServiceSyncable prefs_;
TestingPrefServiceSimple local_state_;
+ std::unique_ptr
+ regional_capabilities_service_;
search_engines::SearchEngineChoiceService search_engine_choice_service_;
};
@@ -94,7 +100,6 @@ WDKeywordsResult InitKeywordResult(
WDKeywordsResult kwResult;
kwResult.metadata.builtin_keyword_data_version =
TemplateURLPrepopulateData::GetDataVersion(prefs);
- kwResult.default_search_provider_id = 2;
kwResult.keywords = local_turls;
return kwResult;
}
@@ -117,9 +122,9 @@ TEST_F(BraveTemplateURLServiceUtilTest, GetSearchProvidersUsingKeywordResult) {
prefs_.SetInteger(kCountryIDAtInstall, 'U' << 8 | 'S');
GetSearchProvidersUsingKeywordResult(
- result, nullptr, &prefs_, &search_engine_choice_service_, &template_urls,
- default_turl.get(), SearchTermsData(), updated_keywords_metadata,
- nullptr);
+ result.GetValue(), nullptr, &prefs_, &search_engine_choice_service_,
+ &template_urls, default_turl.get(), SearchTermsData(),
+ updated_keywords_metadata, nullptr);
// Verify count and order.
TestDefaultOrder(template_urls,
@@ -146,9 +151,9 @@ TEST_F(BraveTemplateURLServiceUtilTest,
// Check Germany.
prefs_.SetInteger(kCountryIDAtInstall, 'D' << 8 | 'E');
GetSearchProvidersUsingKeywordResult(
- result, nullptr, &prefs_, &search_engine_choice_service_, &template_urls,
- default_turl.get(), SearchTermsData(), updated_keywords_metadata,
- nullptr);
+ result.GetValue(), nullptr, &prefs_, &search_engine_choice_service_,
+ &template_urls, default_turl.get(), SearchTermsData(),
+ updated_keywords_metadata, nullptr);
// Verify count and order.
TestDefaultOrder(template_urls,
diff --git a/chromium_src/components/search_engines/search_engine_utils.cc b/chromium_src/components/search_engines/search_engine_utils.cc
index 3724ef648653..9b4a3b8b5960 100644
--- a/chromium_src/components/search_engines/search_engine_utils.cc
+++ b/chromium_src/components/search_engines/search_engine_utils.cc
@@ -12,7 +12,7 @@
#include "src/components/search_engines/search_engine_utils.cc"
#undef GetEngineType
-namespace SearchEngineUtils {
+namespace search_engine_utils {
SearchEngineType GetEngineType(const GURL& url) {
SearchEngineType type = GetEngineType_ChromiumImpl(url);
@@ -34,4 +34,4 @@ SearchEngineType GetEngineType(const GURL& url) {
return type;
}
-} // namespace SearchEngineUtils
+} // namespace search_engine_utils
diff --git a/chromium_src/components/search_engines/util.cc b/chromium_src/components/search_engines/util.cc
index 984bdd692c46..ed79ba6a2fcb 100644
--- a/chromium_src/components/search_engines/util.cc
+++ b/chromium_src/components/search_engines/util.cc
@@ -12,7 +12,7 @@
#include "base/ranges/algorithm.h"
void GetSearchProvidersUsingKeywordResult(
- const WDTypedResult& result,
+ const WDKeywordsResult& result,
KeywordWebDataService* service,
PrefService* prefs,
search_engines::SearchEngineChoiceService* search_engine_choice_service,
diff --git a/chromium_src/components/shared_highlighting/core/common/shared_highlighting_features.cc b/chromium_src/components/shared_highlighting/core/common/shared_highlighting_features.cc
index 50dbce8c3399..f2af1de1cb79 100644
--- a/chromium_src/components/shared_highlighting/core/common/shared_highlighting_features.cc
+++ b/chromium_src/components/shared_highlighting/core/common/shared_highlighting_features.cc
@@ -10,7 +10,6 @@
namespace shared_highlighting {
OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kIOSSharedHighlightingV2, base::FEATURE_DISABLED_BY_DEFAULT},
{kSharedHighlightingManager, base::FEATURE_DISABLED_BY_DEFAULT},
}});
diff --git a/chromium_src/components/sync_device_info/device_info_sync_bridge_unittest.cc b/chromium_src/components/sync_device_info/device_info_sync_bridge_unittest.cc
index 6d1b5007a0e6..9aac292e7225 100644
--- a/chromium_src/components/sync_device_info/device_info_sync_bridge_unittest.cc
+++ b/chromium_src/components/sync_device_info/device_info_sync_bridge_unittest.cc
@@ -167,7 +167,7 @@ TEST_F(DeviceInfoSyncBridgeTest,
const DeviceInfoSpecifics specifics = CreateLocalDeviceSpecifics();
syncer::EntityChangeList entity_change_list;
entity_change_list.push_back(
- EntityChange::CreateDelete(specifics.cache_guid()));
+ EntityChange::CreateDelete(specifics.cache_guid(), syncer::EntityData()));
auto error_on_delete = bridge()->ApplyIncrementalSyncChanges(
bridge()->CreateMetadataChangeList(), std::move(entity_change_list));
EXPECT_FALSE(error_on_delete);
@@ -180,8 +180,8 @@ TEST_F(DeviceInfoSyncBridgeTest,
ASSERT_EQ(1u, bridge()->GetAllDeviceInfo().size());
EntityChangeList changes;
- changes.push_back(
- EntityChange::CreateDelete(CacheGuidForSuffix(kLocalSuffix)));
+ changes.push_back(EntityChange::CreateDelete(CacheGuidForSuffix(kLocalSuffix),
+ syncer::EntityData()));
// An incoming deletion for the local device info should not cause a reupload
EXPECT_CALL(*processor(), Put(CacheGuidForSuffix(kLocalSuffix), _, _))
diff --git a/chromium_src/components/user_education/common/user_education_features.cc b/chromium_src/components/user_education/common/user_education_features.cc
deleted file mode 100644
index 54f005ff1fe8..000000000000
--- a/chromium_src/components/user_education/common/user_education_features.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Copyright (c) 2024 The Brave Authors. All rights reserved.
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-#include "src/components/user_education/common/user_education_features.cc"
-
-#include "base/feature_override.h"
-
-namespace user_education::features {
-
-OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kWhatsNewVersion2, base::FEATURE_DISABLED_BY_DEFAULT},
-}});
-
-} // namespace user_education::features
diff --git a/chromium_src/components/version_info/version_info.h b/chromium_src/components/version_info/version_info_with_user_agent.h
similarity index 77%
rename from chromium_src/components/version_info/version_info.h
rename to chromium_src/components/version_info/version_info_with_user_agent.h
index 28f45a22ee75..72eb52140794 100644
--- a/chromium_src/components/version_info/version_info.h
+++ b/chromium_src/components/version_info/version_info_with_user_agent.h
@@ -1,19 +1,19 @@
-/* Copyright (c) 2023 The Brave Authors. All rights reserved.
+/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_H_
-#define BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_H_
+#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_WITH_USER_AGENT_H_
+#define BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_WITH_USER_AGENT_H_
-#include
+#include
#include "brave/components/version_info/version_info_values.h"
#define GetProductNameAndVersionForUserAgent \
GetProductNameAndVersionForUserAgent_Unused
-#include "src/components/version_info/version_info.h" // IWYU pragma: export
+#include "src/components/version_info/version_info_with_user_agent.h" // IWYU pragma: export
#undef GetProductNameAndVersionForUserAgent
namespace version_info {
@@ -24,4 +24,4 @@ constexpr std::string GetProductNameAndVersionForUserAgent() {
} // namespace version_info
-#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_H_
+#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_VERSION_INFO_VERSION_INFO_WITH_USER_AGENT_H_
diff --git a/chromium_src/components/viz/service/gl/gpu_service_impl.cc b/chromium_src/components/viz/service/gl/gpu_service_impl.cc
index d7c8b74715a3..0968528b234d 100644
--- a/chromium_src/components/viz/service/gl/gpu_service_impl.cc
+++ b/chromium_src/components/viz/service/gl/gpu_service_impl.cc
@@ -30,14 +30,25 @@ void GpuServiceImpl::InitializeWithHost(
gpu::SharedImageManager* shared_image_manager,
gpu::Scheduler* scheduler,
#endif
- base::WaitableEvent* shutdown_event) {
+ base::WaitableEvent* shutdown_event
+#if BUILDFLAG(IS_ANDROID)
+ ,
+ const gpu::SharedContextState::GrContextOptionsProvider*
+ gr_context_options_provider
+#endif
+) {
InitializeWithHost_ChromiumImpl(
std::move(pending_gpu_host), std::move(use_shader_cache_shm_count),
std::move(default_offscreen_surface), std::move(creation_params),
#if BUILDFLAG(IS_ANDROID)
sync_point_manager, shared_image_manager, scheduler,
#endif
- shutdown_event);
+ shutdown_event
+#if BUILDFLAG(IS_ANDROID)
+ ,
+ gr_context_options_provider
+#endif
+ );
#if BUILDFLAG(IS_WIN)
if (gpu_host_) {
std::string result;
diff --git a/chromium_src/components/viz/service/gl/gpu_service_impl.h b/chromium_src/components/viz/service/gl/gpu_service_impl.h
index 9b866210a4bd..830dcb604d79 100644
--- a/chromium_src/components/viz/service/gl/gpu_service_impl.h
+++ b/chromium_src/components/viz/service/gl/gpu_service_impl.h
@@ -21,7 +21,9 @@
gpu::SyncPointManager* sync_point_manager = nullptr, \
gpu::SharedImageManager* shared_image_manager = nullptr, \
gpu::Scheduler* scheduler = nullptr, \
- base::WaitableEvent* shutdown_event = nullptr); \
+ base::WaitableEvent* shutdown_event = nullptr, \
+ const gpu::SharedContextState::GrContextOptionsProvider* \
+ gr_context_options_provider = nullptr); \
void InitializeWithHost
#else
#define InitializeWithHost \
diff --git a/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc b/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc
deleted file mode 100644
index 88714dd9bbda..000000000000
--- a/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Copyright (c) 2022 The Brave Authors. All rights reserved.
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-#include "src/content/browser/aggregation_service/aggregation_service_features.cc"
-
-#include "base/feature_override.h"
-
-namespace content {
-
-OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kPrivacySandboxAggregationService, base::FEATURE_DISABLED_BY_DEFAULT},
-}});
-
-} // namespace content
diff --git a/chromium_src/content/browser/aggregation_service/aggregation_service_impl.cc b/chromium_src/content/browser/aggregation_service/aggregation_service_impl.cc
new file mode 100644
index 000000000000..610ed977e472
--- /dev/null
+++ b/chromium_src/content/browser/aggregation_service/aggregation_service_impl.cc
@@ -0,0 +1,137 @@
+/* Copyright (c) 2024 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "content/browser/aggregation_service/aggregation_service_impl.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include "base/files/file_path.h"
+#include "base/functional/callback.h"
+#include "base/memory/ptr_util.h"
+#include "base/task/task_traits.h"
+#include "base/time/time.h"
+#include "base/values.h"
+#include "content/browser/aggregation_service/aggregatable_report.h"
+#include "content/browser/aggregation_service/aggregatable_report_assembler.h"
+#include "content/browser/aggregation_service/aggregatable_report_scheduler.h"
+#include "content/browser/aggregation_service/aggregatable_report_sender.h"
+#include "content/browser/aggregation_service/aggregation_service_observer.h"
+#include "content/browser/aggregation_service/aggregation_service_storage.h"
+#include "content/browser/aggregation_service/aggregation_service_storage_sql.h"
+#include "content/browser/aggregation_service/public_key.h"
+#include "content/browser/storage_partition_impl.h"
+#include "content/public/browser/storage_partition.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+
+namespace content {
+
+AggregationServiceImpl::AggregationServiceImpl(
+ bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ StoragePartitionImpl* storage_partition) {}
+
+AggregationServiceImpl::~AggregationServiceImpl() = default;
+
+// static
+std::unique_ptr
+AggregationServiceImpl::CreateForTesting(
+ bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ const base::Clock* clock,
+ std::unique_ptr scheduler,
+ std::unique_ptr assembler,
+ std::unique_ptr sender) {
+ return base::WrapUnique(new AggregationServiceImpl(
+ run_in_memory, user_data_directory, clock, std::move(scheduler),
+ std::move(assembler), std::move(sender)));
+}
+
+AggregationServiceImpl::AggregationServiceImpl(
+ bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ const base::Clock* clock,
+ std::unique_ptr scheduler,
+ std::unique_ptr assembler,
+ std::unique_ptr sender) {}
+
+void AggregationServiceImpl::AssembleReport(
+ AggregatableReportRequest report_request,
+ AssemblyCallback callback) {}
+
+void AggregationServiceImpl::SendReport(
+ const GURL& url,
+ const AggregatableReport& report,
+ std::optional delay_type,
+ SendCallback callback) {
+ std::move(callback).Run(AggregatableReportSender::RequestStatus::kOk);
+}
+
+void AggregationServiceImpl::SendReport(
+ const GURL& url,
+ const base::Value& contents,
+ std::optional delay_type,
+ SendCallback callback) {
+ std::move(callback).Run(AggregatableReportSender::RequestStatus::kOk);
+}
+
+const base::SequenceBound&
+AggregationServiceImpl::GetStorage() {
+ return storage_;
+}
+
+void AggregationServiceImpl::ClearData(
+ base::Time delete_begin,
+ base::Time delete_end,
+ StoragePartition::StorageKeyMatcherFunction filter,
+ base::OnceClosure done) {
+ std::move(done).Run();
+}
+
+void AggregationServiceImpl::ScheduleReport(
+ AggregatableReportRequest report_request) {}
+
+void AggregationServiceImpl::AssembleAndSendReport(
+ AggregatableReportRequest report_request) {}
+
+void AggregationServiceImpl::SetPublicKeysForTesting(
+ const GURL& url,
+ const PublicKeyset& keyset) {}
+
+void AggregationServiceImpl::GetPendingReportRequestsForWebUI(
+ base::OnceCallback<
+ void(std::vector)> callback) {
+ std::move(callback).Run({});
+}
+
+void AggregationServiceImpl::SendReportsForWebUI(
+ const std::vector& ids,
+ base::OnceClosure reports_sent_callback) {
+ std::move(reports_sent_callback).Run();
+}
+
+void AggregationServiceImpl::GetPendingReportReportingOrigins(
+ base::OnceCallback)> callback) {
+ std::move(callback).Run({});
+}
+
+void AggregationServiceImpl::AddObserver(AggregationServiceObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AggregationServiceImpl::RemoveObserver(
+ AggregationServiceObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+// For tests to compile.
+void AggregationServiceImpl::OnScheduledReportTimeReached(
+ std::vector requests_and_ids) {}
+
+} // namespace content
diff --git a/chromium_src/content/browser/aggregation_service/aggregation_service_impl.h b/chromium_src/content/browser/aggregation_service/aggregation_service_impl.h
new file mode 100644
index 000000000000..7fb5e26475cc
--- /dev/null
+++ b/chromium_src/content/browser/aggregation_service/aggregation_service_impl.h
@@ -0,0 +1,129 @@
+/* Copyright (c) 2024 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_AGGREGATION_SERVICE_AGGREGATION_SERVICE_IMPL_H_
+#define BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_AGGREGATION_SERVICE_AGGREGATION_SERVICE_IMPL_H_
+
+#include
+#include
+#include
+#include
+
+#include "base/functional/callback_forward.h"
+#include "base/observer_list.h"
+#include "base/threading/sequence_bound.h"
+#include "content/browser/aggregation_service/aggregatable_report_assembler.h"
+#include "content/browser/aggregation_service/aggregatable_report_scheduler.h"
+#include "content/browser/aggregation_service/aggregatable_report_sender.h"
+#include "content/browser/aggregation_service/aggregation_service.h"
+#include "content/browser/aggregation_service/aggregation_service_observer.h"
+#include "content/browser/aggregation_service/aggregation_service_storage.h"
+#include "content/browser/aggregation_service/aggregation_service_storage_context.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/storage_partition.h"
+
+class GURL;
+
+namespace base {
+class Clock;
+class FilePath;
+} // namespace base
+
+namespace url {
+class Origin;
+} // namespace url
+
+namespace content {
+
+struct PublicKeyset;
+class AggregatableReport;
+class AggregatableReportRequest;
+class AggregationServiceStorage;
+class AggregatableReportScheduler;
+class StoragePartitionImpl;
+
+// UI thread class that manages the lifetime of the underlying storage. Owned by
+// the StoragePartitionImpl. Lifetime is bound to lifetime of the
+// StoragePartitionImpl.
+class CONTENT_EXPORT AggregationServiceImpl
+ : public AggregationService,
+ public AggregationServiceStorageContext {
+ public:
+ static std::unique_ptr CreateForTesting(
+ bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ const base::Clock* clock,
+ std::unique_ptr scheduler,
+ std::unique_ptr assembler,
+ std::unique_ptr sender);
+
+ AggregationServiceImpl(bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ StoragePartitionImpl* storage_partition);
+ AggregationServiceImpl(const AggregationServiceImpl& other) = delete;
+ AggregationServiceImpl& operator=(const AggregationServiceImpl& other) =
+ delete;
+ AggregationServiceImpl(AggregationServiceImpl&& other) = delete;
+ AggregationServiceImpl& operator=(AggregationServiceImpl&& other) = delete;
+ ~AggregationServiceImpl() override;
+
+ // AggregationService:
+ void AssembleReport(AggregatableReportRequest report_request,
+ AssemblyCallback callback) override;
+ void SendReport(
+ const GURL& url,
+ const AggregatableReport& report,
+ std::optional delay_type,
+ SendCallback callback) override;
+ void SendReport(
+ const GURL& url,
+ const base::Value& contents,
+ std::optional delay_type,
+ SendCallback callback) override;
+ void ClearData(base::Time delete_begin,
+ base::Time delete_end,
+ StoragePartition::StorageKeyMatcherFunction filter,
+ base::OnceClosure done) override;
+ void ScheduleReport(AggregatableReportRequest report_request) override;
+ void AssembleAndSendReport(AggregatableReportRequest report_request) override;
+ void GetPendingReportRequestsForWebUI(
+ base::OnceCallback<
+ void(std::vector)> callback)
+ override;
+ void SendReportsForWebUI(
+ const std::vector& ids,
+ base::OnceClosure reports_sent_callback) override;
+ void GetPendingReportReportingOrigins(
+ base::OnceCallback)> callback) override;
+ void AddObserver(AggregationServiceObserver* observer) override;
+ void RemoveObserver(AggregationServiceObserver* observer) override;
+
+ // AggregationServiceStorageContext:
+ const base::SequenceBound& GetStorage() override;
+
+ // Sets the public keys for `url` in storage to allow testing without network.
+ void SetPublicKeysForTesting(const GURL& url, const PublicKeyset& keyset);
+
+ private:
+ // Allows access to `OnScheduledReportTimeReached()`.
+ friend class AggregationServiceImplTest;
+
+ AggregationServiceImpl(bool run_in_memory,
+ const base::FilePath& user_data_directory,
+ const base::Clock* clock,
+ std::unique_ptr scheduler,
+ std::unique_ptr assembler,
+ std::unique_ptr sender);
+
+ void OnScheduledReportTimeReached(
+ std::vector requests_and_ids);
+
+ base::SequenceBound storage_;
+ base::ObserverList observers_;
+};
+
+} // namespace content
+
+#endif // BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_AGGREGATION_SERVICE_AGGREGATION_SERVICE_IMPL_H_
diff --git a/chromium_src/content/browser/browsing_data/browsing_data_filter_builder_impl.cc b/chromium_src/content/browser/browsing_data/browsing_data_filter_builder_impl.cc
index f60caad4d3bd..c9a218cb7b59 100644
--- a/chromium_src/content/browser/browsing_data/browsing_data_filter_builder_impl.cc
+++ b/chromium_src/content/browser/browsing_data/browsing_data_filter_builder_impl.cc
@@ -3,13 +3,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#define BRAVE_MATCHES_STORAGE_KEY \
- /* Add StorageKey matching mode to cleanup ONLY third-party data. */ \
- if (match_mode == OriginMatchingMode::kThirdPartiesOnly && \
- storage_key.IsThirdPartyContext() && \
- storage_key.MatchesOriginForTrustedStorageDeletion(origin)) { \
- return is_delete_list; \
- }
+#define BRAVE_MATCHES_STORAGE_KEY \
+ /* Add StorageKey matching mode to cleanup ONLY third-party data. */ \
+ case BrowsingDataFilterBuilder::OriginMatchingMode::kThirdPartiesOnly: \
+ if (storage_key.IsThirdPartyContext() && \
+ storage_key.MatchesOriginForTrustedStorageDeletion(origin)) { \
+ return is_delete_list; \
+ } \
+ break;
#define BRAVE_MATCHES_STORAGE_KEY_SWITCH \
case OriginMatchingMode::kThirdPartiesOnly: { \
diff --git a/chromium_src/content/browser/renderer_host/render_frame_host_impl.cc b/chromium_src/content/browser/renderer_host/render_frame_host_impl.cc
index 6e059166f0a4..163fce816f5a 100644
--- a/chromium_src/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/chromium_src/content/browser/renderer_host/render_frame_host_impl.cc
@@ -20,11 +20,18 @@
GetBrowserContext(), \
main_frame_for_storage_partitioning->GetLastCommittedOrigin()))
+#define BRAVE_RENDER_FRAME_HOST_IMPL_CREATE_NEW_WINDOW \
+ params->no_javascript_access = no_javascript_access;
+
+#define BindTrustTokenQueryAnswerer BindTrustTokenQueryAnswerer_ChromiumImpl
+
#include "src/content/browser/renderer_host/render_frame_host_impl.cc"
-#undef BRAVE_RENDER_FRAME_HOST_IMPL_COMPUTE_ISOLATION_INFO_INTERNAL
+#undef BindTrustTokenQueryAnswerer
+#undef BRAVE_RENDER_FRAME_HOST_IMPL_CREATE_NEW_WINDOW
#undef BRAVE_RENDER_FRAME_HOST_IMPL_COMPUTE_NONCE
#undef BRAVE_RENDER_FRAME_HOST_IMPL_IS_THIRD_PARTY_STORAGE_PARTITIONING_ENABLED_CHECK_IF_CAN_BE_DISABLED
+#undef BRAVE_RENDER_FRAME_HOST_IMPL_COMPUTE_ISOLATION_INFO_INTERNAL
namespace content {
@@ -67,4 +74,12 @@ RenderFrameHostImpl::GetEphemeralStorageToken() const {
return main_rfh->ephemeral_storage_token_;
}
+void RenderFrameHostImpl::BindTrustTokenQueryAnswerer(
+ mojo::PendingReceiver receiver) {
+ mojo::ReportBadMessage(
+ "Attempted to get a TrustTokenQueryAnswerer with Private State Tokens "
+ "disabled.");
+ return;
+}
+
} // namespace content
diff --git a/chromium_src/content/browser/renderer_host/render_frame_host_impl.h b/chromium_src/content/browser/renderer_host/render_frame_host_impl.h
index d85465070cc2..bca7f534d348 100644
--- a/chromium_src/content/browser/renderer_host/render_frame_host_impl.h
+++ b/chromium_src/content/browser/renderer_host/render_frame_host_impl.h
@@ -22,8 +22,13 @@
void SetEphemeralStorageToken(const url::Origin& top_frame_origin); \
std::optional GetEphemeralStorageToken() const
+#define BindTrustTokenQueryAnswerer(...) \
+ BindTrustTokenQueryAnswerer(__VA_ARGS__); \
+ void BindTrustTokenQueryAnswerer_ChromiumImpl(__VA_ARGS__)
+
#include "src/content/browser/renderer_host/render_frame_host_impl.h" // IWYU pragma: export
+#undef BindTrustTokenQueryAnswerer
#undef embedding_token_
#undef CopyImageAt
diff --git a/chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.cc b/chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.cc
similarity index 79%
rename from chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.cc
rename to chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.cc
index 256ed83e8ded..82553a85d795 100644
--- a/chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.cc
+++ b/chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.cc
@@ -3,10 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#include "chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.h"
+#include "content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h"
#define RedirectHeuristicTabHelper RedirectHeuristicTabHelper_ChromiumImpl
-#include "src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.cc"
+#include "src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.cc"
#undef RedirectHeuristicTabHelper
WEB_CONTENTS_USER_DATA_KEY_IMPL(RedirectHeuristicTabHelper);
diff --git a/chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.h b/chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h
similarity index 71%
rename from chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.h
rename to chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h
index ed3855daaaba..7a3d9c540525 100644
--- a/chromium_src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.h
+++ b/chromium_src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h
@@ -3,23 +3,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
-#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
+#ifndef BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
+#define BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
#define RedirectHeuristicTabHelper RedirectHeuristicTabHelper_ChromiumImpl
#define MaybeRecordRedirectHeuristic virtual MaybeRecordRedirectHeuristic
-#include "src/chrome/browser/tpcd/heuristics/redirect_heuristic_tab_helper.h" // IWYU pragma: export
+#include "src/content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h" // IWYU pragma: export
#undef MaybeRecordRedirectHeuristic
#undef RedirectHeuristicTabHelper
-// Disable RedirectHeuristicTabHelper functionality since we disable kDIPS, so
+// Disable RedirectHeuristicTabHelper functionality since we disable kBtm, so
// the upstream code would not work (and crash because it doesn't check that
// dips_service_ can be a null).
class RedirectHeuristicTabHelper
: public content::WebContentsUserData {
public:
- static std::set AllSitesFollowingFirstParty(
+ CONTENT_EXPORT static std::set AllSitesFollowingFirstParty(
content::WebContents* web_contents,
const GURL& first_party_url) {
return {};
@@ -32,4 +32,4 @@ class RedirectHeuristicTabHelper
WEB_CONTENTS_USER_DATA_KEY_DECL();
};
-#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
+#endif // BRAVE_CHROMIUM_SRC_CONTENT_BROWSER_TPCD_HEURISTICS_REDIRECT_HEURISTIC_TAB_HELPER_H_
diff --git a/chromium_src/content/browser/webui/web_ui_url_loader_factory.cc b/chromium_src/content/browser/webui/web_ui_url_loader_factory.cc
index e08301a18b91..0fead438d7ed 100644
--- a/chromium_src/content/browser/webui/web_ui_url_loader_factory.cc
+++ b/chromium_src/content/browser/webui/web_ui_url_loader_factory.cc
@@ -7,6 +7,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/timer/elapsed_timer.h"
+#include "base/types/optional_util.h"
#include "content/browser/loader/keep_alive_url_loader_service.h"
#include "content/browser/service_worker/service_worker_single_script_update_checker.h"
#include "content/browser/service_worker/service_worker_updated_script_loader.h"
@@ -15,7 +16,6 @@
#include "net/http/http_byte_range.h"
#include "services/network/public/cpp/parsed_headers.h"
#include "services/network/public/mojom/url_loader.mojom.h"
-#include "services/network/public/mojom/url_response_head.mojom.h"
namespace content {
namespace {
@@ -31,40 +31,27 @@ void RangeDataAvailable(
base::ElapsedTimer url_request_elapsed_timer,
URLDataSource::RangeDataResult result);
-network::mojom::URLResponseHeadPtr UseContentLengthFromHeaders(
- network::mojom::URLResponseHeadPtr headers) {
- if (auto content_length = headers->headers->GetContentLength();
- content_length != -1) {
- headers->content_length = content_length;
- }
- return headers;
-}
-
} // namespace
} // namespace content
-#define OnReceiveResponse(headers, ...) \
- OnReceiveResponse(UseContentLengthFromHeaders(headers), __VA_ARGS__)
-
-#define GotDataCallback \
- GotDataCallback unused_callback; \
- if (range.has_value() && \
- source->source()->SupportsRangeRequests(request.url)) { \
- URLDataSource::GotRangeDataCallback callback = base::BindOnce( \
- RangeDataAvailable, request.url, std::move(resource_response), \
- replacements, replace_in_js, base::RetainedRef(source), \
- std::move(client_remote), range, \
- std::move(url_request_elapsed_timer)); \
- source->source()->StartRangeDataRequest(request.url, wc_getter, *range, \
- std::move(callback)); \
- return; \
- } \
+#define GotDataCallback \
+ GotDataCallback unused_callback; \
+ if (range_or_error.has_value() && \
+ source->source()->SupportsRangeRequests(request.url)) { \
+ URLDataSource::GotRangeDataCallback callback = base::BindOnce( \
+ RangeDataAvailable, request.url, std::move(resource_response), \
+ replacements, replace_in_js, base::RetainedRef(source), \
+ std::move(client_remote), base::OptionalFromExpected(range_or_error), \
+ std::move(url_request_elapsed_timer)); \
+ source->source()->StartRangeDataRequest( \
+ request.url, wc_getter, range_or_error.value(), std::move(callback)); \
+ return; \
+ } \
URLDataSource::GotDataCallback
#include "src/content/browser/webui/web_ui_url_loader_factory.cc"
#undef GotDataCallback
-#undef OnReceiveResponse
namespace content {
namespace {
diff --git a/chromium_src/content/common/features.cc b/chromium_src/content/common/features.cc
index 772da8131279..62943cb03d2f 100644
--- a/chromium_src/content/common/features.cc
+++ b/chromium_src/content/common/features.cc
@@ -13,8 +13,6 @@ namespace features {
OVERRIDE_FEATURE_DEFAULT_STATES({{
// This feature should not be enabled when kFencedFrames is disabled.
{kPrivacySandboxAdsAPIsM1Override, base::FEATURE_DISABLED_BY_DEFAULT},
- {kResourceTimingForCancelledNavigationInFrame,
- base::FEATURE_DISABLED_BY_DEFAULT},
}});
} // namespace features
diff --git a/chromium_src/content/common/web_ui_loading_util.cc b/chromium_src/content/common/web_ui_loading_util.cc
new file mode 100644
index 000000000000..a318c31d8335
--- /dev/null
+++ b/chromium_src/content/common/web_ui_loading_util.cc
@@ -0,0 +1,30 @@
+/* Copyright (c) 2024 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "content/common/web_ui_loading_util.h"
+
+#include "services/network/public/mojom/url_loader.mojom.h"
+#include "services/network/public/mojom/url_response_head.mojom.h"
+
+namespace content::webui {
+namespace {
+
+network::mojom::URLResponseHeadPtr UseContentLengthFromHeaders(
+ network::mojom::URLResponseHeadPtr headers) {
+ if (auto content_length = headers->headers->GetContentLength();
+ content_length != -1) {
+ headers->content_length = content_length;
+ }
+ return headers;
+}
+
+} // namespace
+} // namespace content::webui
+
+#define OnReceiveResponse(headers, ...) \
+ OnReceiveResponse(UseContentLengthFromHeaders(headers), __VA_ARGS__)
+
+#include "src/content/common/web_ui_loading_util.cc"
+#undef OnReceiveResponse
diff --git a/chromium_src/content/public/common/content_features.cc b/chromium_src/content/public/common/content_features.cc
index 922bcbb25384..c57fa2de7f96 100644
--- a/chromium_src/content/public/common/content_features.cc
+++ b/chromium_src/content/public/common/content_features.cc
@@ -20,17 +20,13 @@ BASE_FEATURE(kIdleDetection,
OVERRIDE_FEATURE_DEFAULT_STATES({{
{kCookieDeprecationFacilitatedTesting, base::FEATURE_DISABLED_BY_DEFAULT},
{kDigitalGoodsApi, base::FEATURE_DISABLED_BY_DEFAULT},
- {kDIPS, base::FEATURE_DISABLED_BY_DEFAULT},
+ {kBtm, base::FEATURE_DISABLED_BY_DEFAULT},
{kFedCm, base::FEATURE_DISABLED_BY_DEFAULT},
- {kNotificationTriggers, base::FEATURE_DISABLED_BY_DEFAULT},
{kPrivacySandboxAdsAPIsOverride, base::FEATURE_DISABLED_BY_DEFAULT},
{kServiceWorkerAutoPreload, base::FEATURE_DISABLED_BY_DEFAULT},
{kWebIdentityDigitalCredentials, base::FEATURE_DISABLED_BY_DEFAULT},
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
{kPwaNavigationCapturing, base::FEATURE_DISABLED_BY_DEFAULT},
-#endif
-#if BUILDFLAG(IS_ANDROID)
- {kWebNfc, base::FEATURE_DISABLED_BY_DEFAULT},
#endif
{kWebOTP, base::FEATURE_DISABLED_BY_DEFAULT},
}});
diff --git a/chromium_src/extensions/browser/api/web_request/extension_web_request_event_router.cc b/chromium_src/extensions/browser/api/web_request/extension_web_request_event_router.cc
index 1769b0541e57..e2f35ec635bc 100644
--- a/chromium_src/extensions/browser/api/web_request/extension_web_request_event_router.cc
+++ b/chromium_src/extensions/browser/api/web_request/extension_web_request_event_router.cc
@@ -3,11 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
-#define BRAVE_EXTENSION_WEB_REQUEST_EVENT_ROUTER_ON_AUTH_REQUIRED \
- if (browser_context) { \
- ClearSignaled(browser_context, request->id, kOnBeforeSendHeaders); \
- ClearSignaled(browser_context, request->id, kOnSendHeaders); \
- ClearSignaled(browser_context, request->id, kOnHeadersReceived); \
+#define BRAVE_EXTENSION_WEB_REQUEST_EVENT_ROUTER_ON_AUTH_REQUIRED \
+ if (browser_context) { \
+ ClearSignaled(browser_context, request->id, \
+ EventTypes::kOnBeforeSendHeaders); \
+ ClearSignaled(browser_context, request->id, EventTypes::kOnSendHeaders); \
+ ClearSignaled(browser_context, request->id, \
+ EventTypes::kOnHeadersReceived); \
}
#include "src/extensions/browser/api/web_request/extension_web_request_event_router.cc"
diff --git a/chromium_src/ios/chrome/browser/metrics/model/google_groups_manager_factory.mm b/chromium_src/ios/chrome/browser/metrics/model/google_groups_manager_factory.mm
index ec0e85f4314b..47e249c9be1d 100644
--- a/chromium_src/ios/chrome/browser/metrics/model/google_groups_manager_factory.mm
+++ b/chromium_src/ios/chrome/browser/metrics/model/google_groups_manager_factory.mm
@@ -24,9 +24,9 @@
}
GoogleGroupsManagerFactory::GoogleGroupsManagerFactory()
- : BrowserStateKeyedServiceFactory(
- "GoogleGroupsManager",
- BrowserStateDependencyManager::GetInstance()) {}
+ : ProfileKeyedServiceFactoryIOS("GoogleGroupsManager",
+ ServiceCreation::kCreateWithProfile,
+ TestingCreation::kNoServiceForTests) {}
std::unique_ptr
GoogleGroupsManagerFactory::BuildServiceInstanceFor(
@@ -34,14 +34,5 @@
return nullptr;
}
-bool GoogleGroupsManagerFactory::ServiceIsCreatedWithBrowserState()
- const {
- return true;
-}
-
-bool GoogleGroupsManagerFactory::ServiceIsNULLWhileTesting() const {
- return true;
-}
-
void GoogleGroupsManagerFactory::RegisterBrowserStatePrefs(
user_prefs::PrefRegistrySyncable* registry) {}
diff --git a/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.cc b/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.cc
index 9cf2e6b7b3b8..8bc038e71d9f 100644
--- a/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.cc
+++ b/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.cc
@@ -31,8 +31,6 @@ int IOSChromeNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
net::CompletionOnceCallback callback,
GURL* new_url) {
- const auto result = IOSChromeNetworkDelegate_ChromiumImpl::OnBeforeURLRequest(
- request, std::move(callback), new_url);
::AddBraveServicesKeyHeader(request);
- return result;
+ return net::OK;
}
diff --git a/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.h b/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.h
index 40e3524fa6b9..f0410e64490f 100644
--- a/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.h
+++ b/chromium_src/ios/chrome/browser/net/model/ios_chrome_network_delegate.h
@@ -12,6 +12,7 @@ using IOSChromeNetworkDelegate_BraveImpl = IOSChromeNetworkDelegate;
#define IOSChromeNetworkDelegate IOSChromeNetworkDelegate_ChromiumImpl
#define BRAVE_IOS_CHROME_NETWORK_DELEGATE_H \
friend IOSChromeNetworkDelegate_BraveImpl;
+
#include "src/ios/chrome/browser/net/model/ios_chrome_network_delegate.h" // IWYU pragma: export
#undef IOSChromeNetworkDelegate
#undef BRAVE_IOS_CHROME_NETWORK_DELEGATE_H
diff --git a/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm b/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm
index aedfd60ecfc9..f3b0807b9530 100644
--- a/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm
+++ b/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm
@@ -91,9 +91,8 @@ void BraveRegisterLocalStatePrefs(PrefRegistrySimple* registry) {
#undef BRAVE_REGISTER_LOCAL_STATE_PREFS
#undef BRAVE_REGISTER_BROWSER_STATE_PREFS
-void MigrateObsoleteProfilePrefs(const base::FilePath& state_path,
- PrefService* prefs) {
- MigrateObsoleteProfilePrefs_ChromiumImpl(state_path, prefs);
+void MigrateObsoleteProfilePrefs(PrefService* prefs) {
+ MigrateObsoleteProfilePrefs_ChromiumImpl(prefs);
brave_ads::MigrateObsoleteProfilePrefs(prefs);
brave_wallet::MigrateObsoleteProfilePrefs(prefs);
diff --git a/chromium_src/ios/chrome/browser/signin/model/about_signin_internals_factory.cc b/chromium_src/ios/chrome/browser/signin/model/about_signin_internals_factory.cc
index 10b8e31fb793..e41d954c18e3 100644
--- a/chromium_src/ios/chrome/browser/signin/model/about_signin_internals_factory.cc
+++ b/chromium_src/ios/chrome/browser/signin/model/about_signin_internals_factory.cc
@@ -6,7 +6,6 @@
#include "ios/chrome/browser/signin/model/about_signin_internals_factory.h"
#include "base/no_destructor.h"
-#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/signin/core/browser/about_signin_internals.h"
#include "ios/chrome/browser/shared/model/profile/profile_ios.h"
@@ -14,17 +13,15 @@
namespace ios {
AboutSigninInternalsFactory::AboutSigninInternalsFactory()
- : BrowserStateKeyedServiceFactory(
- "AboutSigninInternals",
- BrowserStateDependencyManager::GetInstance()) {}
+ : ProfileKeyedServiceFactoryIOS("AboutSigninInternals") {}
-AboutSigninInternalsFactory::~AboutSigninInternalsFactory() {}
+AboutSigninInternalsFactory::~AboutSigninInternalsFactory() = default;
// static
AboutSigninInternals* AboutSigninInternalsFactory::GetForProfile(
ProfileIOS* profile) {
- return static_cast