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/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..575703643973 100644
--- a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java
+++ b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java
@@ -45,7 +45,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 +64,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 +74,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 +128,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 +158,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 +183,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 +268,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 +320,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
new SpanApplier.SpanInfo(
"",
"",
- new NoUnderlineClickableSpan(
+ new ChromeClickableSpan(
requireContext(),
R.color.brave_link,
result -> {
@@ -413,6 +425,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);
@@ -661,10 +674,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/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/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/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 b3fb2ba2f930..3bf4d54e1123 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;
@@ -955,109 +945,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/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/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/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 e9ef106a20d8..2b7904e865b7 100644
--- a/browser/ui/BUILD.gn
+++ b/browser/ui/BUILD.gn
@@ -623,6 +623,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",
]
@@ -853,7 +854,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..b0e48e60d6bc 100644
--- a/browser/ui/android/strings/android_chrome_strings.grd
+++ b/browser/ui/android/strings/android_chrome_strings.grd
@@ -274,6 +274,9 @@ CHAR_LIMIT guidelines:
USB
+
+ Collaboration
+
@@ -416,12 +419,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 +464,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
@@ -1017,14 +1022,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.
@@ -1605,14 +1613,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
@@ -2553,6 +2553,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
@@ -2938,11 +2941,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 +3299,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 +3436,7 @@ To change this setting, BEGIN_LINKdelete the Brave da
Pages
- Video
+ Videos
Audio
@@ -3658,9 +3667,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 +3701,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.
@@ -3857,8 +3860,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
@@ -3992,9 +3995,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Manage interests
-
- Manage reactions
-
Manage
@@ -4234,6 +4234,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.
@@ -4404,6 +4407,9 @@ To change this setting, BEGIN_LINKdelete the Brave da
Switch out of Private
+
+ Open with…
+
@@ -4899,9 +4905,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 +4975,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 +5107,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
%1$s3 downloads deleted
-
- Restored %1$sYouTube
-
-
- %1$s3 downloads restored
-
@@ -5777,22 +5774,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?
@@ -6204,6 +6185,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
@@ -6310,6 +6294,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 +6386,6 @@ To change this setting, BEGIN_LINKdelete the Brave da
Select from the dropdown list
-
-
- Price drop spotted
-
Bottom sheet
@@ -6633,6 +6632,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 +6900,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
diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd
index 4aa05c52769c..2ffab07e4bcd 100644
--- a/browser/ui/android/strings/android_chrome_strings_override.grd
+++ b/browser/ui/android/strings/android_chrome_strings_override.grd
@@ -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_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_javascript_tab_modal_dialog_view_views.cc b/browser/ui/views/brave_javascript_tab_modal_dialog_view_views.cc
index 1362dd3f956c..c3a4b52764b3 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
@@ -133,8 +133,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 31c0c59bc010..07db0c898a8e 100644
--- a/browser/ui/views/frame/brave_browser_view.cc
+++ b/browser/ui/views/frame/brave_browser_view.cc
@@ -396,8 +396,9 @@ tabs::TabHandle BraveBrowserView::GetActiveTabHandle() {
CHECK(base::FeatureList::IsEnabled(tabs::features::kBraveSplitView));
auto* model = browser()->tab_strip_model();
- return model->GetTabHandleAt(
- model->GetIndexOfWebContents(GetActiveWebContents()));
+ return model
+ ->GetTabAtIndex(model->GetIndexOfWebContents(GetActiveWebContents()))
+ ->GetHandle();
}
bool BraveBrowserView::IsActiveWebContentsTiled(const TabTile& tile) {
@@ -421,7 +422,10 @@ void BraveBrowserView::UpdateSplitViewSizeDelta(
auto* split_view_browser_data = SplitViewBrowserData::FromBrowser(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);
@@ -534,7 +538,8 @@ void BraveBrowserView::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(nullptr);
@@ -583,7 +588,7 @@ void BraveBrowserView::UpdateSecondaryDevtoolsLayoutAndVisibility(
void BraveBrowserView::UpdateSearchTabsButtonState() {
if (auto* tab_search_container =
- tab_strip_region_view()->tab_search_container()) {
+ tab_strip_region_view()->GetTabSearchContainer()) {
if (auto* button = tab_search_container->tab_search_button()) {
auto is_tab_search_visible =
GetProfile()->GetPrefs()->GetBoolean(kTabsSearchShow);
@@ -1128,12 +1133,12 @@ void BraveBrowserView::OnActiveTabChanged(content::WebContents* old_contents,
// split view only when it's needed.
auto* browser_data = SplitViewBrowserData::FromBrowser(browser_.get());
auto* tab_strip_model = browser_->tab_strip_model();
- if (auto tile =
- browser_data->GetTile(tab_strip_model->GetTabHandleAt(index))) {
+ if (auto tile = browser_data->GetTile(
+ tab_strip_model->GetTabAtIndex(index)->GetHandle())) {
auto* main_web_contents = tab_strip_model->GetWebContentsAt(
- tab_strip_model->GetIndexOfTab(tile->first));
+ tab_strip_model->GetIndexOfTab(tile->first.Get()));
auto* secondary_web_contents = tab_strip_model->GetWebContentsAt(
- tab_strip_model->GetIndexOfTab(tile->second));
+ tab_strip_model->GetIndexOfTab(tile->second.Get()));
if (main_web_contents != new_contents) {
std::swap(main_web_contents, secondary_web_contents);
}
@@ -1155,7 +1160,9 @@ void BraveBrowserView::OnActiveTabChanged(content::WebContents* old_contents,
secondary_contents_web_view_->SetFastResize(true);
if (!SplitViewBrowserData::FromBrowser(browser_.get())
- ->GetTile(browser_->tab_strip_model()->GetTabHandleAt(index))) {
+ ->GetTile(browser_->tab_strip_model()
+ ->GetTabAtIndex(index)
+ ->GetHandle())) {
// This will help reduce flickering when switching to non tiled tab.
UpdateSecondaryContentsWebViewVisibility();
}
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..0ebda45f8701 100644
--- a/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc
+++ b/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc
@@ -36,12 +36,12 @@ 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();
+ browser_view->tab_strip_region_view()->GetTabSearchContainer();
if (!tab_search_container) {
return;
}
button = browser_view->tab_strip_region_view()
- ->tab_search_container()
+ ->GetTabSearchContainer()
->tab_search_button();
ASSERT_NE(nullptr, button);
EXPECT_TRUE(button->GetVisible());
diff --git a/browser/ui/views/frame/split_view_browsertest.cc b/browser/ui/views/frame/split_view_browsertest.cc
index 36a57e5e7231..9138ab2ad14f 100644
--- a/browser/ui/views/frame/split_view_browsertest.cc
+++ b/browser/ui/views/frame/split_view_browsertest.cc
@@ -60,8 +60,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_view().GetVisible());
@@ -73,13 +75,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_view().GetVisible());
@@ -91,8 +95,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_view().GetVisible());
@@ -111,8 +117,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_view().GetVisible());
@@ -130,33 +138,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_view().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/frame/vertical_tab_strip_region_view.cc b/browser/ui/views/frame/vertical_tab_strip_region_view.cc
index aa3461fbf51a..96ac19fc3e3d 100644
--- a/browser/ui/views/frame/vertical_tab_strip_region_view.cc
+++ b/browser/ui/views/frame/vertical_tab_strip_region_view.cc
@@ -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);
@@ -1225,7 +1230,7 @@ void VerticalTabStripRegionView::UpdateOriginalTabSearchButtonVisibility() {
const bool use_search_button =
browser_->profile()->GetPrefs()->GetBoolean(kTabsSearchShow);
if (auto* tab_search_container =
- original_region_view_->tab_search_container()) {
+ original_region_view_->GetTabSearchContainer()) {
if (auto* tab_search_button = tab_search_container->tab_search_button()) {
tab_search_button->SetVisible(!is_vertical_tabs && use_search_button);
}
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/tabs/brave_tab.cc b/browser/ui/views/tabs/brave_tab.cc
index 309682b52b29..80aa51fb5f17 100644
--- a/browser/ui/views/tabs/brave_tab.cc
+++ b/browser/ui/views/tabs/brave_tab.cc
@@ -51,7 +51,7 @@ std::u16string BraveTab::GetTooltipText(const gfx::Point& p) const {
return Tab::GetTooltipText(data_.title,
GetAlertStateToShow(data_.alert_state));
}
- return Tab::GetTooltipText(p);
+ return Tab::GetCachedTooltipText();
}
int BraveTab::GetWidthOfLargestSelectableRegion() const {
@@ -208,6 +208,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_container.cc b/browser/ui/views/tabs/brave_tab_container.cc
index 23fde5ec9a4e..e9f367c296dc 100644
--- a/browser/ui/views/tabs/brave_tab_container.cc
+++ b/browser/ui/views/tabs/brave_tab_container.cc
@@ -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() &&
@@ -436,7 +437,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);
}
}
@@ -777,8 +778,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_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..106626551b72 100644
--- a/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/browser/ui/views/tabs/tab_drag_controller.cc
@@ -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(
diff --git a/browser/ui/views/tabs/tab_drag_controller.h b/browser/ui/views/tabs/tab_drag_controller.h
index e8b5f4d616c3..7f346aaaea77 100644
--- a/browser/ui/views/tabs/tab_drag_controller.h
+++ b/browser/ui/views/tabs/tab_drag_controller.h
@@ -40,9 +40,7 @@ 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,
diff --git a/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc b/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc
index 09c8aeb518af..e2bb8ab475e2 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());
@@ -717,7 +717,7 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, OriginalTabSearchButton) {
ASSERT_TRUE(region_view);
auto* tab_search_container =
- region_view->original_region_view_->tab_search_container();
+ region_view->original_region_view_->GetTabSearchContainer();
if (!tab_search_container) {
return;
}
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/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/searchbox/brave_realbox_handler_browsertest.cc b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
index 6ca49e39a0f6..fb6247c6c9f7 100644
--- a/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
+++ b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc
@@ -50,7 +50,7 @@ class BraveRealboxHandlerTest : public InProcessBrowserTest {
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..e8bfc3c817cc 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -28,6 +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_SCOPED_ALLOW_BLOCKING_H=",
"BRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES(X)=",
]
}
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/commands/lib/config.js b/build/commands/lib/config.js
index db606d5df069..f2b8361d0f81 100644
--- a/build/commands/lib/config.js
+++ b/build/commands/lib/config.js
@@ -686,7 +686,7 @@ 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.use_partition_alloc = true
args.ios_provider_target = "//brave/ios/browser/providers:brave_providers"
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/threading/thread_restrictions.h b/chromium_src/base/threading/thread_restrictions.h
index 676333600d59..06ab6b60715e 100644
--- a/chromium_src/base/threading/thread_restrictions.h
+++ b/chromium_src/base/threading/thread_restrictions.h
@@ -7,16 +7,22 @@
#define BRAVE_CHROMIUM_SRC_BASE_THREADING_THREAD_RESTRICTIONS_H_
class BraveBrowsingDataRemoverDelegate;
+class ProfileIOS;
namespace brave {
class ProcessLauncher;
+ProfileIOS* CreateMainProfileIOS();
}
#define BRAVE_SCOPED_ALLOW_BASE_SYNC_PRIMITIVES_H \
friend class ::BraveBrowsingDataRemoverDelegate; \
friend class brave::ProcessLauncher;
+#define BRAVE_SCOPED_ALLOW_BLOCKING_H \
+ friend ProfileIOS* brave::CreateMainProfileIOS();
+
#include "src/base/threading/thread_restrictions.h" // IWYU pragma: export
+#undef BRAVE_SCOPED_ALLOW_BLOCKING_H
#undef BRAVE_SCOPED_ALLOW_BASE_SYNC_PRIMITIVES_H
#endif // BRAVE_CHROMIUM_SRC_BASE_THREADING_THREAD_RESTRICTIONS_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/app_controller_mac.mm b/chromium_src/chrome/browser/app_controller_mac.mm
index 59030ec65688..e22d1f572395 100644
--- a/chromium_src/chrome/browser/app_controller_mac.mm
+++ b/chromium_src/chrome/browser/app_controller_mac.mm
@@ -7,4 +7,22 @@
#import "brave/browser/brave_app_controller_mac.h"
+// Work around a bug in macOS 14. The application name shown in the menu bar
+// should be the CFBundleName, but a bug in the menu rewrite causes the
+// CFBundleDisplayName to be swapped in. What's happening here is that the
+// NSMenuBarDisplayManager registers for a notification that the app name
+// changed, and then, when the notification comes in, it calls a Process
+// Manager API that returns the CFBundleDisplayName which is not appropriate
+// for this use. Work around this by unregistering the NSMenuBarDisplayManager
+// for the notification. See https://crbug.com/1487224 and FB13192263.
+#define BRAVE_APP_CONTROLLER_MAC_MAIN_MENU_CREATED \
+ if (id sharedMenuBarDisplayManager = [NSClassFromString( \
+ @"NSMenuBarDisplayManager") performSelector:@selector(shared)]) { \
+ [NSWorkspace.sharedWorkspace.notificationCenter \
+ removeObserver:sharedMenuBarDisplayManager \
+ name:@"NSWorkspaceApplicationNameDidChangeNotification" \
+ object:nil]; \
+ }
+
#include "src/chrome/browser/app_controller_mac.mm"
+#undef BRAVE_APP_CONTROLLER_MAC_MAIN_MENU_CREATED
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/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/k_anonymity_service/k_anonymity_trust_token_getter.cc b/chromium_src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.cc
new file mode 100644
index 000000000000..de11f16f1418
--- /dev/null
+++ b/chromium_src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.cc
@@ -0,0 +1,17 @@
+/* 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/k_anonymity_service/k_anonymity_trust_token_getter.h"
+
+#define TryGetTrustTokenAndKey TryGetTrustTokenAndKey_ChromiumImpl
+#include "src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.cc"
+#undef TryGetTrustTokenAndKey
+
+// We do not support TrustTokens aka PrivateStateTokens aka FeldgePst
+void KAnonymityTrustTokenGetter::TryGetTrustTokenAndKey(
+ TryGetTrustTokenAndKeyCallback callback) {
+ std::move(callback).Run(std::nullopt);
+ return;
+}
diff --git a/chromium_src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.h b/chromium_src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.h
new file mode 100644
index 000000000000..b38e99b015cc
--- /dev/null
+++ b/chromium_src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.h
@@ -0,0 +1,16 @@
+/* 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_K_ANONYMITY_SERVICE_K_ANONYMITY_TRUST_TOKEN_GETTER_H_
+#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_K_ANONYMITY_SERVICE_K_ANONYMITY_TRUST_TOKEN_GETTER_H_
+
+#define TryGetTrustTokenAndKey(...) \
+ TryGetTrustTokenAndKey(__VA_ARGS__); \
+ void TryGetTrustTokenAndKey_ChromiumImpl(__VA_ARGS__)
+
+#include "src/chrome/browser/k_anonymity_service/k_anonymity_trust_token_getter.h" // IWYU pragma: export
+
+#undef TryGetTrustTokenAndKey
+#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_K_ANONYMITY_SERVICE_K_ANONYMITY_TRUST_TOKEN_GETTER_H_
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/password_manager/android/login_db_deprecation_runner_factory.cc b/chromium_src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.cc
new file mode 100644
index 000000000000..a8ab6f00b084
--- /dev/null
+++ b/chromium_src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.cc
@@ -0,0 +1,42 @@
+/* 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 "chrome/browser/password_manager/android/login_db_deprecation_runner_factory.h"
+
+#define BuildServiceInstanceForBrowserContext \
+ BuildServiceInstanceForBrowserContext_ChromiumImpl
+#define GetForProfile GetForProfile_ChromiumImpl
+
+#include "src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.cc"
+
+#undef GetForProfile
+#undef BuildServiceInstanceForBrowserContext
+
+std::unique_ptr
+LoginDbDeprecationRunnerFactory::BuildServiceInstanceForBrowserContext(
+ content::BrowserContext* context) const {
+#if BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
+ // We intend to use LoginDatabase as the backend for password manager, so
+ // normally we should get here.
+ return nullptr;
+#else
+ // Explicitly call Chromium's implementation in `else` block to avoid error:
+ // code will never be executed [-Werror,-Wunreachable-code].
+ return BuildServiceInstanceForBrowserContext_ChromiumImpl(context);
+#endif
+}
+
+password_manager::LoginDbDeprecationRunner*
+LoginDbDeprecationRunnerFactory::GetForProfile(Profile* profile) {
+#if BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
+ // We intend to use LoginDatabase as the backend for password manager, so
+ // normally we should get here.
+ return nullptr;
+#else
+ // Explicitly call Chromium's implementation in `else` block to avoid not used
+ // error.
+ return GetForProfile_ChromiumImpl(profile);
+#endif
+}
diff --git a/chromium_src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.h b/chromium_src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.h
new file mode 100644
index 000000000000..ad2e417e2c5f
--- /dev/null
+++ b/chromium_src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.h
@@ -0,0 +1,24 @@
+/* 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_CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_LOGIN_DB_DEPRECATION_RUNNER_FACTORY_H_
+#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_LOGIN_DB_DEPRECATION_RUNNER_FACTORY_H_
+
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+#define BuildServiceInstanceForBrowserContext \
+ BuildServiceInstanceForBrowserContext_ChromiumImpl( \
+ content::BrowserContext* context) const; \
+ std::unique_ptr BuildServiceInstanceForBrowserContext
+#define GetForProfile \
+ GetForProfile_ChromiumImpl(Profile* profile); \
+ static password_manager::LoginDbDeprecationRunner* GetForProfile
+
+#include "src/chrome/browser/password_manager/android/login_db_deprecation_runner_factory.h" // IWYU pragma: export
+
+#undef GetForProfile
+#undef BuildServiceInstanceForBrowserContext
+
+#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_LOGIN_DB_DEPRECATION_RUNNER_FACTORY_H_
diff --git a/chromium_src/chrome/browser/password_manager/profile_password_store_factory.cc b/chromium_src/chrome/browser/password_manager/profile_password_store_factory.cc
new file mode 100644
index 000000000000..2cd9b75cae95
--- /dev/null
+++ b/chromium_src/chrome/browser/password_manager/profile_password_store_factory.cc
@@ -0,0 +1,12 @@
+/* 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/password_manager/android/password_manager_util_bridge.h"
+
+#define IsInternalBackendPresent() \
+ IsInternalBackendPresent() || \
+ LoginDbDeprecationRunnerFactory::GetForProfile(profile) == nullptr
+#include "src/chrome/browser/password_manager/profile_password_store_factory.cc"
+#undef IsInternalBackendPresent
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/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..1e56bf89b0e9 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"
@@ -57,22 +57,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 +74,5 @@ 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
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/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/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/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/searchbox_handler.cc b/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
index 86c5101c8f05..b45b87ace8e8 100644
--- a/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
+++ b/chromium_src/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
@@ -3,24 +3,19 @@
// 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 "brave/components/vector_icons/vector_icons.h"
-#include "components/omnibox/browser/vector_icons.h"
+#include "chrome/browser/ui/webui/searchbox/searchbox_handler.h"
-namespace {
-constexpr char kLeoWindowTabNewIconResourceName[] =
- "//resources/brave-icons/window-tab-new.svg";
-} // namespace
+#include "components/omnibox/browser/autocomplete_input.h"
-// This patches |ActionVectorIconToResourceName| to include the additional
-// omnibox icons we add in Brave. Unfortunately, the method is used inside the
-// file, so we can't just override the method. There is only one usage of
-// kSwitchIcon in the file, so we add additional statements from it.
-#define kSwitchIcon kSwitchIcon.name) {} \
- if (icon.name == kLeoWindowTabNewIcon.name) { \
- return 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 kSwitchIcon
+#undef set_prefer_keyword
+#undef set_allow_exact_keyword_match
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..bc53cc8b4b57 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[] =
@@ -491,14 +492,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/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/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/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_service_util_unittest.cc b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc
index 0060145136f4..1a317c20efdf 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
@@ -94,7 +94,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 +116,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 +145,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/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/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..d96dd6e4fb6a 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,13 +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/. */
-#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
@@ -19,7 +19,7 @@
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..28c30ee8acbf 100644
--- a/chromium_src/content/public/common/content_features.cc
+++ b/chromium_src/content/public/common/content_features.cc
@@ -22,15 +22,11 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
{kDigitalGoodsApi, base::FEATURE_DISABLED_BY_DEFAULT},
{kDIPS, 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/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(
- GetInstance()->GetServiceForBrowserState(profile, true));
+ return GetInstance()->GetServiceForProfileAs(
+ profile, /*create=*/true);
}
// static
diff --git a/chromium_src/net/cookies/cookie_monster.cc b/chromium_src/net/cookies/cookie_monster.cc
index bac513227101..b8e5c31fc985 100644
--- a/chromium_src/net/cookies/cookie_monster.cc
+++ b/chromium_src/net/cookies/cookie_monster.cc
@@ -104,10 +104,12 @@ void CookieMonster::SetCanonicalCookieAsync(
if (options.should_use_ephemeral_storage()) {
if (!options.top_frame_origin()) {
// Shouldn't happen, but don't do anything in this case.
- MaybeRunCookieCallback(
- std::move(callback),
- CookieAccessResult(CookieInclusionStatus(
- CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)));
+ net::CookieInclusionStatus cookie_inclusion_status;
+ cookie_inclusion_status.AddExclusionReason(
+ net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR);
+
+ MaybeRunCookieCallback(std::move(callback),
+ CookieAccessResult(cookie_inclusion_status));
return;
}
ChromiumCookieMonster* ephemeral_monster =
diff --git a/chromium_src/net/http/transport_security_state.cc b/chromium_src/net/http/transport_security_state.cc
index 1997601fc492..03d688273330 100644
--- a/chromium_src/net/http/transport_security_state.cc
+++ b/chromium_src/net/http/transport_security_state.cc
@@ -140,11 +140,12 @@ GetHostBoundPartitionHashForHSTS(std::string_view host) {
SSLUpgradeDecision TransportSecurityState::GetSSLUpgradeDecision(
const NetworkAnonymizationKey& network_anonymization_key,
const std::string& host,
+ bool is_top_level_nav,
const NetLogWithSource& net_log) {
auto auto_reset_partition_hash = enabled_sts_hosts_.SetScopedPartitionHash(
GetPartitionHashForHSTS(network_anonymization_key));
- return TransportSecurityState_ChromiumImpl::GetSSLUpgradeDecision(host,
- net_log);
+ return TransportSecurityState_ChromiumImpl::GetSSLUpgradeDecision(
+ host, is_top_level_nav, net_log);
}
// Use NetworkAnonymizationKey to create PartitionHash for accessing/storing
diff --git a/chromium_src/net/http/transport_security_state.h b/chromium_src/net/http/transport_security_state.h
index af4b4143d7d9..ed00b92e5687 100644
--- a/chromium_src/net/http/transport_security_state.h
+++ b/chromium_src/net/http/transport_security_state.h
@@ -37,6 +37,7 @@ class NET_EXPORT TransportSecurityState
SSLUpgradeDecision GetSSLUpgradeDecision(
const NetworkAnonymizationKey& network_anonymization_key,
const std::string& host,
+ bool is_top_level_nav,
const NetLogWithSource& net_log = NetLogWithSource());
bool ShouldSSLErrorsBeFatal(
const NetworkAnonymizationKey& network_anonymization_key,
diff --git a/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc b/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc
index 54747f5b0bf0..e6da4e5632b4 100644
--- a/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc
+++ b/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc
@@ -552,9 +552,9 @@ bool ParseCertificatesFile(std::string_view certs_input,
Pinsets* pinsets,
base::Time* timestamp) {
constexpr std::string_view brave_certs = R"brave_certs(
-# Last updated: Wed Jan 8 21:19:00 UTC 2025
+# Last updated: Thu Jan 16 20:31:13 2025
PinsListTimestamp
-1736371140
+1737059473
# =====BEGIN BRAVE ROOTS ASC=====
#From https://www.amazontrust.com/repository/
diff --git a/chromium_src/net/url_request/url_request_http_job.cc b/chromium_src/net/url_request/url_request_http_job.cc
index 1138def89cc6..5dba29090cb6 100644
--- a/chromium_src/net/url_request/url_request_http_job.cc
+++ b/chromium_src/net/url_request/url_request_http_job.cc
@@ -7,9 +7,9 @@
#include "net/http/transport_security_state.h"
-#define GetSSLUpgradeDecision(host, net_log) \
+#define GetSSLUpgradeDecision(host, is_top_level_nav, net_log) \
GetSSLUpgradeDecision(request->isolation_info().network_anonymization_key(), \
- host, net_log)
+ host, is_top_level_nav, net_log)
#define ShouldSSLErrorsBeFatal(host) \
ShouldSSLErrorsBeFatal( \
request_->isolation_info().network_anonymization_key(), host)
diff --git a/chromium_src/services/network/public/cpp/features.cc b/chromium_src/services/network/public/cpp/features.cc
deleted file mode 100644
index 04c97425c2b6..000000000000
--- a/chromium_src/services/network/public/cpp/features.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Copyright (c) 2021 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 "src/services/network/public/cpp/features.cc"
-
-#include "base/feature_override.h"
-
-namespace network::features {
-
-OVERRIDE_FEATURE_DEFAULT_STATES({{
- {kFledgePst, base::FEATURE_DISABLED_BY_DEFAULT},
- {kPrivateStateTokens, base::FEATURE_DISABLED_BY_DEFAULT},
-}});
-
-} // namespace network::features
diff --git a/chromium_src/third_party/blink/common/features.cc b/chromium_src/third_party/blink/common/features.cc
index 5dde61bd0e51..42293a8a03e1 100644
--- a/chromium_src/third_party/blink/common/features.cc
+++ b/chromium_src/third_party/blink/common/features.cc
@@ -16,7 +16,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
{kReducedReferrerGranularity, base::FEATURE_ENABLED_BY_DEFAULT},
{kUACHOverrideBlank, base::FEATURE_ENABLED_BY_DEFAULT},
- {kAdAuctionReportingWithMacroApi, base::FEATURE_DISABLED_BY_DEFAULT},
{kAdInterestGroupAPI, base::FEATURE_DISABLED_BY_DEFAULT},
{kAllowURNsInIframes, base::FEATURE_DISABLED_BY_DEFAULT},
{kAttributionReportingInBrowserMigration,
@@ -41,8 +40,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
{kReduceCookieIPCs, base::FEATURE_DISABLED_BY_DEFAULT},
{kReduceUserAgentMinorVersion, base::FEATURE_ENABLED_BY_DEFAULT},
{kSharedStorageAPI, base::FEATURE_DISABLED_BY_DEFAULT},
- {kSharedStorageAPIM118, base::FEATURE_DISABLED_BY_DEFAULT},
- {kSharedStorageAPIM125, base::FEATURE_DISABLED_BY_DEFAULT},
{kSpeculationRulesPrefetchFuture, base::FEATURE_DISABLED_BY_DEFAULT},
{kTextFragmentAnchor, base::FEATURE_DISABLED_BY_DEFAULT},
}});
diff --git a/chromium_src/third_party/blink/common/origin_trials/origin_trials.cc b/chromium_src/third_party/blink/common/origin_trials/origin_trials.cc
index 6ee8f73e235f..0bac304d8c98 100644
--- a/chromium_src/third_party/blink/common/origin_trials/origin_trials.cc
+++ b/chromium_src/third_party/blink/common/origin_trials/origin_trials.cc
@@ -31,7 +31,6 @@ bool IsTrialDisabledInBrave(std::string_view trial_name) {
"Parakeet",
"SignedExchangeSubresourcePrefetch",
"SubresourceWebBundles",
- "TrustTokens",
};
if (base::Contains(kBraveDisabledTrialNames, trial_name)) {
@@ -51,7 +50,6 @@ bool IsTrialDisabledInBrave(blink::mojom::OriginTrialFeature feature) {
blink::mojom::OriginTrialFeature::kAdInterestGroupAPI,
blink::mojom::OriginTrialFeature::kDigitalGoods,
blink::mojom::OriginTrialFeature::kParakeet,
- blink::mojom::OriginTrialFeature::kPrivateStateTokens,
};
return base::Contains(kBraveDisabledTrialFeatures, feature);
diff --git a/chromium_src/third_party/blink/renderer/core/html/media/html_video_element.cc b/chromium_src/third_party/blink/renderer/core/html/media/html_video_element.cc
index 0e5172b9587a..9cdd003d5031 100644
--- a/chromium_src/third_party/blink/renderer/core/html/media/html_video_element.cc
+++ b/chromium_src/third_party/blink/renderer/core/html/media/html_video_element.cc
@@ -14,7 +14,7 @@ void HTMLVideoElement::RequestFullscreen() {
GetDocument().GetFrame(),
mojom::blink::UserActivationNotificationType::kInteraction,
/*need_browser_verification*/ false);
- webkitEnterFullscreen();
+ EnterFullscreen();
}
} // namespace blink
diff --git a/chromium_src/third_party/blink/renderer/modules/geolocation/geolocation.cc b/chromium_src/third_party/blink/renderer/modules/geolocation/geolocation.cc
index dcbbb14b5804..ca0642d3dd47 100644
--- a/chromium_src/third_party/blink/renderer/modules/geolocation/geolocation.cc
+++ b/chromium_src/third_party/blink/renderer/modules/geolocation/geolocation.cc
@@ -43,12 +43,13 @@ bool SetEnableHighAccuracy(LocalFrame* frame, bool enable_high_accuracy) {
// client layer. Instead of touching |WebContents|, |Geolocation|,
// |GeolocationContext| interfaces, it would be more simple to pass via
// separated mojo interface.
-#define SetHighAccuracy(is_high_accuracy) \
- SetHighAccuracy(SetEnableHighAccuracy(GetFrame(), is_high_accuracy));
+#define SetHighAccuracyHint(is_high_accuracy) \
+ SetHighAccuracyHint(SetEnableHighAccuracy(GetFrame(), is_high_accuracy));
#else
-#define SetHighAccuracy(is_high_accuracy) SetHighAccuracy(is_high_accuracy)
+#define SetHighAccuracyHint(is_high_accuracy) \
+ SetHighAccuracyHint(is_high_accuracy)
#endif
#include "src/third_party/blink/renderer/modules/geolocation/geolocation.cc"
-#undef SetHighAccuracy
+#undef SetHighAccuracyHint
diff --git a/chromium_src/third_party/blink/renderer/modules/webaudio/audio_buffer.cc b/chromium_src/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
index 1ecf356e1be3..82a0c44651af 100644
--- a/chromium_src/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
+++ b/chromium_src/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
@@ -15,21 +15,19 @@
#define BRAVE_AUDIOBUFFER_GETCHANNELDATA \
{ \
- NotShared array = getChannelData(channel_index); \
- DOMFloat32Array* destination_array = array.Get(); \
- size_t len = destination_array->length(); \
- if (len > 0) { \
+ NotShared destination = getChannelData(channel_index); \
+ base::span dst = destination->AsSpan(); \
+ if (!dst.empty()) { \
if (ExecutionContext* context = ExecutionContext::From(script_state)) { \
- float* destination = destination_array->Data(); \
- brave::BraveSessionCache::From(*context).FarbleAudioChannel( \
- destination, len); \
+ brave::BraveSessionCache::From(*context).FarbleAudioChannel(dst); \
} \
} \
}
-#define BRAVE_AUDIOBUFFER_COPYFROMCHANNEL \
- if (ExecutionContext* context = ExecutionContext::From(script_state)) { \
- brave::BraveSessionCache::From(*context).FarbleAudioChannel(dst, count); \
+#define BRAVE_AUDIOBUFFER_COPYFROMCHANNEL \
+ if (ExecutionContext* context = ExecutionContext::From(script_state)) { \
+ brave::BraveSessionCache::From(*context).FarbleAudioChannel( \
+ dst.first(count)); \
}
#include "src/third_party/blink/renderer/modules/webaudio/audio_buffer.cc"
diff --git a/chromium_src/third_party/blink/renderer/modules/webaudio/audio_context.h b/chromium_src/third_party/blink/renderer/modules/webaudio/audio_context.h
new file mode 100644
index 000000000000..c105c8a70742
--- /dev/null
+++ b/chromium_src/third_party/blink/renderer/modules/webaudio/audio_context.h
@@ -0,0 +1,22 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_CONTEXT_H_
+#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_CONTEXT_H_
+
+#include "media/mojo/mojom/media_player.mojom-blink.h"
+
+// A stub to `RequestFullscreen` which is being inserted as a mojom extension to
+// `MediaPlayer`. See: chromium_src/media/mojo/mojom/media_player.mojom. This
+// extension doesn't seem to be applicable to `AudioContext`.
+#define RequestEnterPictureInPicture \
+ RequestFullscreen() override {} \
+ void RequestEnterPictureInPicture
+
+#include "src/third_party/blink/renderer/modules/webaudio/audio_context.h" // IWYU pragma: export
+
+#undef RequestEnterPictureInPicture
+
+#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_CONTEXT_H_
diff --git a/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
index e4d30f7747e0..f7d65be39b82 100644
--- a/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
+++ b/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -104,11 +104,12 @@ WebGLRenderingContextBase::getSupportedExtensions() {
// If fingerprinting is disallowed and they're asking for information about any
// extension other than WebGLDebugRendererInfo, don't give it to them.
-ScriptValue WebGLRenderingContextBase::getExtension(ScriptState* script_state,
- const String& name) {
- if (!AllowFingerprintingForHost(Host()))
+ScriptObject WebGLRenderingContextBase::getExtension(ScriptState* script_state,
+ const String& name) {
+ if (!AllowFingerprintingForHost(Host())) {
if (name != WebGLDebugRendererInfo::ExtensionName())
- return ScriptValue::CreateNull(script_state->GetIsolate());
+ return ScriptObject::CreateNull(script_state->GetIsolate());
+ }
return getExtension_ChromiumImpl(script_state, name);
}
diff --git a/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
index bd60be4e6e5f..4c5cac9bcd73 100644
--- a/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
+++ b/chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
@@ -8,7 +8,7 @@
#define getExtension \
getExtension_ChromiumImpl(ScriptState*, const String& name); \
- ScriptValue getExtension
+ ScriptObject getExtension
#define getSupportedExtensions \
getSupportedExtensions_ChromiumImpl(); \
diff --git a/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.cc b/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.cc
index a5df18ba9c1b..9413cf01612d 100644
--- a/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.cc
+++ b/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.cc
@@ -30,6 +30,7 @@ PLATFORM_EXPORT void IDLMemberInstaller::BraveInstallAttributes<
v8::Local prototype_template,
v8::Local interface_template,
v8::Local signature,
+ const char* interface_name,
base::span configs) {
const bool connection_attribute_enabled = base::FeatureList::IsEnabled(
blink::features::kNavigatorConnectionAttribute);
@@ -38,7 +39,7 @@ PLATFORM_EXPORT void IDLMemberInstaller::BraveInstallAttributes<
continue;
}
InstallAttribute(isolate, world, instance_template, prototype_template,
- interface_template, signature, config);
+ interface_template, signature, interface_name, config);
}
}
@@ -52,6 +53,7 @@ PLATFORM_EXPORT void IDLMemberInstaller::BraveInstallAttributes<
v8::Local prototype_object,
v8::Local interface_object,
v8::Local signature,
+ const char* interface_name,
base::span configs) {
const bool connection_attribute_enabled = base::FeatureList::IsEnabled(
blink::features::kNavigatorConnectionAttribute);
@@ -61,7 +63,7 @@ PLATFORM_EXPORT void IDLMemberInstaller::BraveInstallAttributes<
continue;
}
InstallAttribute(isolate, context, world, instance_object, prototype_object,
- interface_object, signature, config);
+ interface_object, signature, interface_name, config);
}
}
diff --git a/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.h b/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.h
index f5323264c2f8..7ffb6491d095 100644
--- a/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.h
+++ b/chromium_src/third_party/blink/renderer/platform/bindings/idl_member_installer.h
@@ -8,22 +8,22 @@
struct BraveNavigatorAttributeInstallerTrait;
-#define BRAVE_IDL_MEMBER_INSTALLER_H_ \
- template \
- static void BraveInstallAttributes( \
- v8::Isolate* isolate, const DOMWrapperWorld& world, \
- v8::Local instance_template, \
- v8::Local prototype_template, \
- v8::Local interface_template, \
- v8::Local signature, \
- base::span configs); \
- template \
- static void BraveInstallAttributes( \
- v8::Isolate* isolate, const DOMWrapperWorld& world, \
- v8::Local instance_object, \
- v8::Local prototype_object, \
- v8::Local interface_object, \
- v8::Local signature, \
+#define BRAVE_IDL_MEMBER_INSTALLER_H_ \
+ template \
+ static void BraveInstallAttributes( \
+ v8::Isolate* isolate, const DOMWrapperWorld& world, \
+ v8::Local instance_template, \
+ v8::Local prototype_template, \
+ v8::Local interface_template, \
+ v8::Local signature, const char* interface_name, \
+ base::span configs); \
+ template \
+ static void BraveInstallAttributes( \
+ v8::Isolate* isolate, const DOMWrapperWorld& world, \
+ v8::Local instance_object, \
+ v8::Local prototype_object, \
+ v8::Local interface_object, \
+ v8::Local signature, const char* interface_name, \
base::span configs);
#include "src/third_party/blink/renderer/platform/bindings/idl_member_installer.h" // IWYU pragma: export
diff --git a/chromium_src/ui/views/controls/button/md_text_button.cc b/chromium_src/ui/views/controls/button/md_text_button.cc
index 9bda1437281d..1e08fed89fe0 100644
--- a/chromium_src/ui/views/controls/button/md_text_button.cc
+++ b/chromium_src/ui/views/controls/button/md_text_button.cc
@@ -253,9 +253,9 @@ MdTextButton::~MdTextButton() = default;
SkPath MdTextButton::GetHighlightPath() const {
SkPath path;
- float radius = GetCornerRadiusValue();
- path.addRRect(
- SkRRect::MakeRectXY(RectToSkRect(GetLocalBounds()), radius, radius));
+ gfx::RoundedCornersF radii = GetCornerRadii();
+ path.addRRect(SkRRect::MakeRectXY(RectToSkRect(GetLocalBounds()),
+ radii.upper_left(), radii.lower_right()));
return path;
}
@@ -304,8 +304,7 @@ void MdTextButton::UpdateBackgroundColor() {
SetBackground(
CreateBackgroundFromPainter(Painter::CreateRoundRectWith1PxBorderPainter(
- colors.background_color, colors.stroke_color,
- GetCornerRadiusValue())));
+ colors.background_color, colors.stroke_color, GetCornerRadii())));
}
void MdTextButton::UpdateColors() {
diff --git a/chromium_src/chrome/browser/ui/webui/webui_util.cc b/chromium_src/ui/webui/webui_util.cc
similarity index 90%
rename from chromium_src/chrome/browser/ui/webui/webui_util.cc
rename to chromium_src/ui/webui/webui_util.cc
index 0952d5855ac9..51cd0a72968e 100644
--- a/chromium_src/chrome/browser/ui/webui/webui_util.cc
+++ b/chromium_src/ui/webui/webui_util.cc
@@ -1,15 +1,16 @@
/* 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/. */
+ * You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+#include "ui/webui/webui_util.h"
-#include "chrome/browser/ui/webui/webui_util.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "content/public/common/url_constants.h"
#define SetupWebUIDataSource SetupWebUIDataSource_ChromiumImpl
-#include "src/chrome/browser/ui/webui/webui_util.cc"
+#include "src/ui/webui/webui_util.cc"
#undef SetupWebUIDataSource
namespace webui {
diff --git a/common/importer/chrome_importer_utils.cc b/common/importer/chrome_importer_utils.cc
index b52b35eefe5b..11096ce116ea 100644
--- a/common/importer/chrome_importer_utils.cc
+++ b/common/importer/chrome_importer_utils.cc
@@ -117,7 +117,7 @@ bool HasPaymentMethods(const base::FilePath& payments_path) {
if (!copy_payments_file.copy_success())
return false;
- sql::Database db;
+ sql::Database db(sql::Database::Tag("Payments"));
if (!db.Open(copy_payments_file.copied_file_path())) {
return false;
}
diff --git a/common/importer/sources.gni b/common/importer/sources.gni
new file mode 100644
index 000000000000..5581e80f67ff
--- /dev/null
+++ b/common/importer/sources.gni
@@ -0,0 +1,10 @@
+# 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/.
+
+brave_common_importer_deps = []
+
+if (is_android) {
+ brave_common_importer_deps += [ "//brave/app:brave_generated_resources_grit" ]
+}
diff --git a/components/ai_chat/core/browser/DEPS b/components/ai_chat/core/browser/DEPS
index 39a4b631030f..bdb704bc29c3 100644
--- a/components/ai_chat/core/browser/DEPS
+++ b/components/ai_chat/core/browser/DEPS
@@ -5,6 +5,7 @@ include_rules = [
"+cc/task/text",
"+crypto",
"+components/os_crypt/async",
+ "+components/os_crypt/sync",
"+services/data_decoder/public",
"+services/network/public",
"+services/network/test",
diff --git a/components/ai_chat/core/browser/ai_chat_database.cc b/components/ai_chat/core/browser/ai_chat_database.cc
index 6a4d2602f941..2216146662b3 100644
--- a/components/ai_chat/core/browser/ai_chat_database.cc
+++ b/components/ai_chat/core/browser/ai_chat_database.cc
@@ -55,7 +55,8 @@ namespace ai_chat {
AIChatDatabase::AIChatDatabase(const base::FilePath& db_file_path,
os_crypt_async::Encryptor encryptor)
: db_file_path_(db_file_path),
- db_({.page_size = 4096, .cache_size = 1000}),
+ db_({.page_size = 4096, .cache_size = 1000},
+ sql::Database::Tag("AIChatDatabase")),
encryptor_(std::move(encryptor)) {}
AIChatDatabase::~AIChatDatabase() = default;
diff --git a/components/arc_strings.grdp b/components/arc_strings.grdp
index 9676519fc82c..019c0f0518fc 100644
--- a/components/arc_strings.grdp
+++ b/components/arc_strings.grdp
@@ -207,4 +207,18 @@
Send a report
+
+
+
+ ArcVm preload progress update
+
+
+ Installation of VPN background services has started, this may take a few minutes.
+
+
+ VPN Background Services installation complete. If you do not see VPN apps, please log out and log back in.
+
+
+ VPN background services installation failed.
+
diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp
index 6be01f70a419..a875dd4a73c0 100644
--- a/components/autofill_payments_strings.grdp
+++ b/components/autofill_payments_strings.grdp
@@ -139,15 +139,9 @@
Save card to Brave sync chain?
-
+
Save card securely?
-
- Save card?
-
-
- Autofill card next time?
-
Save security code?
@@ -184,9 +178,6 @@
To pay faster next time, save your card and billing address in your Brave sync chain
-
- To pay faster next time, save your card, name, and billing address in your Brave sync chain
-
This card's CVC will be encrypted and saved in your Brave sync chain for faster checkout
@@ -194,15 +185,9 @@
To pay faster next time, save your card, encrypted security code, and billing address in your Brave sync chain
-
+
Pay faster when your card is saved. Card details are encrypted in your Brave sync chain.
-
- Save this card to use online with Google Pay for purchases across your devices
-
-
- Autofill your card for future purchases when you save it to use with Google Pay
-
@@ -352,6 +337,18 @@
This card is not eligible for virtual card number.
+
+ Something went wrong
+
+
+ Card not available
+
+
+ This card is not available right now. Please try again later.
+
+
+ This card is not available. Please contact your card provider.
+
Close
@@ -429,10 +426,10 @@
Didn't receive your code? BEGIN_LINKGet new codeEND_LINK
- Expiration Date
+ Expiration date
- Something Went Wrong
+ Something went wrong
@@ -559,7 +556,7 @@
- Always Verify When Using Autofill
+ Always verify when using autofill
When turned off, you may be asked occasionally to verify for security purposes
@@ -758,9 +755,32 @@
+
+
+
+ Card details
+
+
+ Click card details below to copy and paste if the card wasn't filled. $1Learn more
+
+
+ Learn more
+
+
+ Card number:
+
+
+
+ Verifying...
+
+
+ Connecting to your card provider...
+
+
+
-
+
Virtual card
@@ -844,7 +864,7 @@
Virtual card
-
+
Turning on virtual card
@@ -853,8 +873,8 @@
-
- $1Visa **** 1234, virtual card
+
+ %1$sVisa **** 1234, virtual card
Virtual card enrollment
@@ -904,6 +924,12 @@
Merchant doesn't accept this virtual card
+
+ You can autofill this card because your $1PayPay account is linked to Google Pay.
+
+
+ Now you can autofill your $1PayPay cards because your $1PayPay account is linked to Google Pay.
+
Cards not accepted by this merchant are disabled
@@ -984,6 +1010,14 @@
Card number:
+
+
+ Pay over time options
+
+
+ Available for purchases over $1$35
+
+
$15% cashback on travel (terms apply)
diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp
index 9d833dd8d189..fa1ce033a977 100644
--- a/components/autofill_strings.grdp
+++ b/components/autofill_strings.grdp
@@ -3,20 +3,13 @@
-
- Clear Form
+
+ Clear form
-
-
- Undo autofill
-
-
-
-
- Undo Autofill
-
-
+
+ Undo autofill
+
Automatic payment methods filling is disabled because this form does not use a secure connection.
@@ -240,12 +233,6 @@
You can now use addresses from your Brave sync chain
-
- Right click to autofill saved info, like your name or address, on any form
-
-
- Right click to autofill saved info, like your name or address, on any form
-
@@ -319,49 +306,31 @@
Use and save Addresses from your Brave sync chain
-
-
-
- Addresses and more
-
-
- Phone numbers, email addresses, shipping addresses, and plus addresses
-
-
- Payment methods
-
-
- Saved payment methods table
-
-
- Save and fill addresses
-
-
- Save and fill payment methods
-
-
- Delete address
-
-
-
- Enter $1ZIP code
-
-
-
-
-
- Addresses and More
-
-
- Payment Methods
-
-
- Save and Fill Addresses
-
-
- Save and Fill Payment Methods
-
-
+
+ Addresses and more
+
+
+ Phone numbers, email addresses, shipping addresses, and plus addresses
+
+
+ Payment methods
+
+
+ Saved payment methods table
+
+
+ Save and fill addresses
+
+
+ Save and fill payment methods
+
+
+ Delete address
+
+
+
+ Enter $1ZIP code
+
@@ -379,18 +348,9 @@
-
-
-
- Payment methods, offers, and addresses using Google Pay
-
-
-
-
- Payment Methods, Offers, and Addresses Using Google Pay
-
-
-
+
+ Payment methods, offers, and addresses using Google Pay
+
@@ -481,32 +441,32 @@
-
- Save Address?
+
+ Save address?
-
- Save Address in Account?
+
+ Save address in account?
Save…
-
- Update Address?
+
+ Update address?
Update…
-
- Save Address
+
+ Save address
-
- Save in Account
+
+ Save in account
-
- Update Address
+
+ Update address
-
- Save Address in Account
+
+ Save address in account
In your Brave sync chain, $1janedoe@google.com
@@ -592,6 +552,12 @@
No passwords found
+
+ Address saved to this device
+
+
+ To save and use this address on all your devices, verify it's you
+
@@ -602,4 +568,7 @@
Named location
+
+ Phonetic name
+
diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_strings.grdp
index 4504b72e5c11..3cecf38b2b6d 100644
--- a/components/bookmark_bar_strings.grdp
+++ b/components/bookmark_bar_strings.grdp
@@ -1,21 +1,16 @@
-
+
Bookmarks
-
+
Bookmarks
-
-
- Desktop Bookmarks
-
-
diff --git a/components/bookmark_bar_strings_override.grdp b/components/bookmark_bar_strings_override.grdp
index b3c7ce7d6e92..059ff9103b04 100644
--- a/components/bookmark_bar_strings_override.grdp
+++ b/components/bookmark_bar_strings_override.grdp
@@ -1,17 +1,15 @@
-
+
Bookmarks
-
+
Bookmarks
-
-
diff --git a/components/bookmark_component_strings.grdp b/components/bookmark_component_strings.grdp
index 66744fc658a5..380fed0b19d0 100644
--- a/components/bookmark_component_strings.grdp
+++ b/components/bookmark_component_strings.grdp
@@ -29,11 +29,6 @@
URL
-
-
- Add Bookmark
-
-
Bookmark this tab
diff --git a/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor.cc b/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor.cc
index 15354c8b9842..9b6411d1635e 100644
--- a/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor.cc
+++ b/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor.cc
@@ -17,6 +17,7 @@
#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_constants.h"
#include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h"
#include "components/schema_org/common/metadata.mojom.h"
diff --git a/components/brave_ads/core/internal/database/database.cc b/components/brave_ads/core/internal/database/database.cc
index 771ce83cbbae..0ec9824d412b 100644
--- a/components/brave_ads/core/internal/database/database.cc
+++ b/components/brave_ads/core/internal/database/database.cc
@@ -29,7 +29,9 @@
namespace brave_ads {
-Database::Database(base::FilePath path) : db_path_(std::move(path)) {
+Database::Database(base::FilePath path)
+ : db_path_(std::move(path)),
+ db_(sql::Database::Tag("AdsInternalDatabase")) {
DETACH_FROM_SEQUENCE(sequence_checker_);
db_.set_error_callback(base::BindRepeating(&Database::ErrorCallback,
diff --git a/components/brave_federated/data_stores/data_store.cc b/components/brave_federated/data_stores/data_store.cc
index ce749923a12a..273bbedb5231 100644
--- a/components/brave_federated/data_stores/data_store.cc
+++ b/components/brave_federated/data_stores/data_store.cc
@@ -60,7 +60,8 @@ namespace brave_federated {
DataStore::DataStore(const DataStoreTask data_store_task,
const base::FilePath& db_file_path)
: database_(
- {.exclusive_locking = true, .page_size = 4096, .cache_size = 500}),
+ {.exclusive_locking = true, .page_size = 4096, .cache_size = 500},
+ sql::Database::Tag(data_store_task.name)),
db_file_path_(db_file_path),
data_store_task_(data_store_task) {}
@@ -68,7 +69,6 @@ DataStore::~DataStore() = default;
bool DataStore::InitializeDatabase() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- database_.set_histogram_tag(data_store_task_.name);
// To recover from corruption.
database_.set_error_callback(
@@ -81,7 +81,7 @@ bool DataStore::InitializeDatabase() {
int DataStore::GetNextTrainingInstanceId() {
sql::Statement statement(database_.GetUniqueStatement(
base::StringPrintf("SELECT MAX(training_instance_id) FROM %s",
- data_store_task_.name.c_str())));
+ data_store_task_.name.value)));
if (statement.Step()) {
return statement.ColumnInt(0) + 1;
@@ -98,7 +98,7 @@ void DataStore::SaveCovariate(
"feature_name, feature_type, "
"feature_value, created_at) "
"VALUES (?,?,?,?,?)",
- data_store_task_.name.c_str())));
+ data_store_task_.name.value)));
BindCovariateToStatement(covariate, training_instance_id, created_at,
&statement);
@@ -127,7 +127,7 @@ TrainingData DataStore::LoadTrainingData() {
sql::Statement statement(database_.GetUniqueStatement(
base::StringPrintf("SELECT id, training_instance_id, feature_name, "
"feature_type, feature_value FROM %s",
- data_store_task_.name.c_str())));
+ data_store_task_.name.value)));
training_instances.clear();
while (statement.Step()) {
@@ -146,8 +146,8 @@ TrainingData DataStore::LoadTrainingData() {
bool DataStore::DeleteTrainingData() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!database_.Execute(base::StringPrintf("DELETE FROM %s",
- data_store_task_.name.c_str()))) {
+ if (!database_.Execute(
+ base::StringPrintf("DELETE FROM %s", data_store_task_.name.value))) {
return false;
}
@@ -162,7 +162,7 @@ void DataStore::PurgeTrainingDataAfterExpirationDate() {
database_.GetUniqueStatement(base::StringPrintf(
" DELETE FROM %s WHERE created_at < ? OR id NOT IN "
"(SELECT id FROM %s ORDER BY id DESC LIMIT ?)",
- data_store_task_.name.c_str(), data_store_task_.name.c_str())));
+ data_store_task_.name.value, data_store_task_.name.value)));
base::Time expiration_threshold =
base::Time::Now() - data_store_task_.max_retention_days;
delete_statement.BindDouble(0,
@@ -172,7 +172,7 @@ void DataStore::PurgeTrainingDataAfterExpirationDate() {
}
bool DataStore::MaybeCreateTable() {
- if (database_.DoesTableExist(data_store_task_.name)) {
+ if (database_.DoesTableExist(data_store_task_.name.value)) {
return true;
}
@@ -183,7 +183,7 @@ bool DataStore::MaybeCreateTable() {
"training_instance_id INTEGER NOT NULL, feature_name INTEGER "
"NOT NULL, feature_type INTEGER NOT NULL, "
"feature_value TEXT NOT NULL, created_at DOUBLE NOT NULL)",
- data_store_task_.name.c_str())) &&
+ data_store_task_.name.value)) &&
transaction.Commit();
}
diff --git a/components/brave_federated/data_stores/data_store.h b/components/brave_federated/data_stores/data_store.h
index 8515089ea754..685ae56318fa 100644
--- a/components/brave_federated/data_stores/data_store.h
+++ b/components/brave_federated/data_stores/data_store.h
@@ -21,7 +21,7 @@ using TrainingData = base::flat_map>;
struct DataStoreTask {
int id = 0;
- const std::string name;
+ sql::Database::Tag name;
int max_number_of_records = 0;
base::TimeDelta max_retention_days;
};
diff --git a/components/brave_federated/data_stores/data_store_unittest.cc b/components/brave_federated/data_stores/data_store_unittest.cc
index fc52c4b528b3..a7a8ca5d8467 100644
--- a/components/brave_federated/data_stores/data_store_unittest.cc
+++ b/components/brave_federated/data_stores/data_store_unittest.cc
@@ -61,7 +61,7 @@ void DataStoreTest::SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
base::FilePath db_path(
temp_dir_.GetPath().Append(FILE_PATH_LITERAL("test_data_store")));
- DataStoreTask data_store_task({0, "test_federated_task",
+ DataStoreTask data_store_task({0, sql::Database::Tag("test_federated_task"),
/* max_number_of_records */ 50,
base::Days(30)});
data_store_ =
diff --git a/components/brave_rewards/browser/DEPS b/components/brave_rewards/browser/DEPS
index fc707195dc13..0e61a122d368 100644
--- a/components/brave_rewards/browser/DEPS
+++ b/components/brave_rewards/browser/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+brave/grit/brave_generated_resources.h",
+ "+components/os_crypt/sync",
"+content/public/browser",
"+content/public/common",
"+content/public/test",
diff --git a/components/brave_rewards/core/rewards_database.cc b/components/brave_rewards/core/rewards_database.cc
index e5505732ec40..9c7a29bfd530 100644
--- a/components/brave_rewards/core/rewards_database.cc
+++ b/components/brave_rewards/core/rewards_database.cc
@@ -95,7 +95,8 @@ mojom::DBRecordPtr CreateRecord(
} // namespace
-RewardsDatabase::RewardsDatabase(const base::FilePath& path) : db_path_(path) {
+RewardsDatabase::RewardsDatabase(const base::FilePath& path)
+ : db_path_(path), db_(sql::Database::Tag("RewardsDatabase")) {
DETACH_FROM_SEQUENCE(sequence_checker_);
}
diff --git a/components/brave_sync/BUILD.gn b/components/brave_sync/BUILD.gn
index 09a7c3193ac7..ae6d3d591880 100644
--- a/components/brave_sync/BUILD.gn
+++ b/components/brave_sync/BUILD.gn
@@ -60,12 +60,6 @@ static_library("network_time_helper") {
"//base",
"//components/network_time",
]
-
- if (is_ios) {
- deps += [ "//ios/web/public" ]
- } else {
- deps += [ "//content/public/browser" ]
- }
}
source_set("p3a") {
diff --git a/components/brave_sync/DEPS b/components/brave_sync/DEPS
index a26aa8d1f49e..aea764eccd4f 100644
--- a/components/brave_sync/DEPS
+++ b/components/brave_sync/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+brave/third_party/bip39wally-core-native",
+ "+components/os_crypt/sync",
"+content/public/browser",
"+third_party/boringssl",
"+ios/web/public",
diff --git a/components/brave_sync/network_time_helper.cc b/components/brave_sync/network_time_helper.cc
index 24c202b18964..20ef0aa8396d 100644
--- a/components/brave_sync/network_time_helper.cc
+++ b/components/brave_sync/network_time_helper.cc
@@ -9,22 +9,9 @@
#include "base/no_destructor.h"
#include "base/sequence_checker.h"
+#include "base/task/single_thread_task_runner.h"
#include "components/network_time/network_time_tracker.h"
-#if defined(OS_IOS)
-#include "ios/web/public/thread/web_task_traits.h"
-#include "ios/web/public/thread/web_thread.h"
-#else
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#endif // defined(OS_IOS)
-
-#if defined(OS_IOS)
-using web::GetUIThreadTaskRunner;
-#else
-using content::GetUIThreadTaskRunner;
-#endif // defined(OS_IOS)
-
namespace brave_sync {
// static
@@ -37,9 +24,11 @@ NetworkTimeHelper::NetworkTimeHelper() = default;
NetworkTimeHelper::~NetworkTimeHelper() = default;
void NetworkTimeHelper::SetNetworkTimeTracker(
- network_time::NetworkTimeTracker* tracker) {
+ network_time::NetworkTimeTracker* tracker,
+ const scoped_refptr& ui_task_runner) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
network_time_tracker_ = tracker;
+ ui_task_runner_ = ui_task_runner;
}
void NetworkTimeHelper::GetNetworkTime(GetNetworkTimeCallback cb) {
@@ -47,7 +36,7 @@ void NetworkTimeHelper::GetNetworkTime(GetNetworkTimeCallback cb) {
std::move(cb).Run(network_time_for_test_);
return;
}
- GetUIThreadTaskRunner({})->PostTask(
+ ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&NetworkTimeHelper::GetNetworkTimeOnUIThread,
weak_ptr_factory_.GetWeakPtr(), std::move(cb)));
}
diff --git a/components/brave_sync/network_time_helper.h b/components/brave_sync/network_time_helper.h
index a17805643068..e82cbf02df55 100644
--- a/components/brave_sync/network_time_helper.h
+++ b/components/brave_sync/network_time_helper.h
@@ -8,12 +8,14 @@
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
+#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
namespace base {
template
class NoDestructor;
+class SingleThreadTaskRunner;
} // namespace base
namespace network_time {
@@ -33,7 +35,9 @@ class NetworkTimeHelper {
NetworkTimeHelper& operator=(const NetworkTimeHelper&) = delete;
virtual ~NetworkTimeHelper();
- void SetNetworkTimeTracker(network_time::NetworkTimeTracker* tracker);
+ void SetNetworkTimeTracker(
+ network_time::NetworkTimeTracker* tracker,
+ const scoped_refptr& ui_task_runner);
void GetNetworkTime(GetNetworkTimeCallback cb);
@@ -44,6 +48,7 @@ class NetworkTimeHelper {
void GetNetworkTimeOnUIThread(GetNetworkTimeCallback cb);
+ scoped_refptr ui_task_runner_;
base::Time network_time_for_test_;
SEQUENCE_CHECKER(sequence_checker_);
diff --git a/components/brave_wallet/browser/internal/hd_key.cc b/components/brave_wallet/browser/internal/hd_key.cc
index b6b15f3305ef..e231dea888e7 100644
--- a/components/brave_wallet/browser/internal/hd_key.cc
+++ b/components/brave_wallet/browser/internal/hd_key.cc
@@ -85,7 +85,7 @@ std::unique_ptr HDKey::GenerateFromSeed(base::span seed) {
DCHECK(out_len == kSHA512Length);
std::unique_ptr hdkey = std::make_unique();
- auto hmac_span = base::make_span(hmac);
+ auto hmac_span = base::span(hmac);
hdkey->SetPrivateKey(hmac_span.first());
hdkey->SetChainCode(hmac_span.last());
return hdkey;
@@ -281,7 +281,7 @@ std::unique_ptr HDKey::DeriveChild(const DerivationIndex& index) {
}
DCHECK(out_len == kSHA512Length);
- auto hmac_span = base::make_span(hmac);
+ auto hmac_span = base::span(hmac);
std::unique_ptr hdkey = std::make_unique();
hdkey->SetChainCode(hmac_span.last());
diff --git a/components/brave_wallet/browser/internal/hd_key_unittest.cc b/components/brave_wallet/browser/internal/hd_key_unittest.cc
index 2ef38c6237e0..73f260708576 100644
--- a/components/brave_wallet/browser/internal/hd_key_unittest.cc
+++ b/components/brave_wallet/browser/internal/hd_key_unittest.cc
@@ -73,7 +73,7 @@ std::vector ParsePath(std::string_view path) {
}
std::vector result;
- for (auto entry : base::span(entries).subspan(1)) {
+ for (auto entry : base::span(entries).subspan(1u)) {
bool is_hardened = entry.length() > 1 && entry.back() == '\'';
if (is_hardened) {
entry.remove_suffix(1);
diff --git a/components/brave_wallet/browser/internal/orchard_storage/orchard_storage.cc b/components/brave_wallet/browser/internal/orchard_storage/orchard_storage.cc
index d8e6f3258757..69a3c904a3ce 100644
--- a/components/brave_wallet/browser/internal/orchard_storage/orchard_storage.cc
+++ b/components/brave_wallet/browser/internal/orchard_storage/orchard_storage.cc
@@ -79,7 +79,8 @@ OrchardStorage::AccountMeta& OrchardStorage::AccountMeta::operator=(
const AccountMeta&) = default;
OrchardStorage::OrchardStorage(const base::FilePath& path_to_database)
- : db_file_path_(path_to_database) {}
+ : db_file_path_(path_to_database),
+ database_(sql::Database::Tag("OrchardStorageDatabase")) {}
OrchardStorage::~OrchardStorage() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/components/brave_wallet/browser/rlp_encode.cc b/components/brave_wallet/browser/rlp_encode.cc
index 5fe9ffc7aa93..73b8474597d2 100644
--- a/components/brave_wallet/browser/rlp_encode.cc
+++ b/components/brave_wallet/browser/rlp_encode.cc
@@ -35,7 +35,7 @@ std::vector RLPEncodeLength(size_t length, uint8_t offset) {
result[0] =
base::CheckAdd(length_encoded.size(), offset, kSingleByteLengthLimit)
.ValueOrDie();
- base::span(result).subspan(1).copy_from(length_encoded);
+ base::span(result).subspan(1u).copy_from(length_encoded);
return result;
}
diff --git a/components/brave_wallet/browser/zcash/rust/lib.rs b/components/brave_wallet/browser/zcash/rust/lib.rs
index 5c92c3aae9cf..a0534d259fea 100644
--- a/components/brave_wallet/browser/zcash/rust/lib.rs
+++ b/components/brave_wallet/browser/zcash/rust/lib.rs
@@ -4,81 +4,59 @@
// You can obtain one at https://mozilla.org/MPL/2.0/.
use std::{
- cell::RefCell, cmp::{Ord, Ordering},
- collections::BTreeSet, convert::TryFrom, error, fmt, io::Cursor, marker::PhantomData,
- ops::{Add, Bound, RangeBounds, Sub}, rc::Rc, vec};
+ collections::BTreeSet, convert::TryFrom, error, fmt, io::Cursor, marker::PhantomData, vec,
+};
use orchard::{
- builder:: {
- BuildError as OrchardBuildError, InProgress, Unauthorized, Unproven
- }, bundle::{commitments, Bundle},
- keys::{FullViewingKey as OrchardFVK,
- PreparedIncomingViewingKey,
- Scope as OrchardScope, SpendingKey},
- note:: {
- ExtractedNoteCommitment, Nullifier, RandomSeed, Rho
- }, note_encryption:: {
- CompactAction, OrchardDomain
- }, keys::SpendAuthorizingKey,
+ builder::{BuildError as OrchardBuildError, InProgress, Unauthorized, Unproven},
+ bundle::Bundle,
+ keys::SpendAuthorizingKey,
+ keys::{
+ FullViewingKey as OrchardFVK, PreparedIncomingViewingKey, Scope as OrchardScope,
+ SpendingKey,
+ },
+ note::{ExtractedNoteCommitment, Nullifier, RandomSeed, Rho},
+ note_encryption::{CompactAction, OrchardDomain},
tree::{MerkleHashOrchard, MerklePath},
value::NoteValue,
zip32::{
- ChildIndex as OrchardChildIndex,
- Error as Zip32Error,
- ExtendedSpendingKey as OrchardExtendedSpendingKey},
- Anchor
+ ChildIndex as OrchardChildIndex, Error as Zip32Error,
+ ExtendedSpendingKey as OrchardExtendedSpendingKey,
+ },
+ Anchor,
};
use zcash_note_encryption::EphemeralKeyBytes;
-use zcash_protocol::consensus::BlockHeight;
use zcash_primitives::{
merkle_tree::{read_commitment_tree, HashSer},
- transaction::components::amount::Amount};
+ transaction::components::amount::Amount,
+};
+use zcash_protocol::consensus::BlockHeight;
-use incrementalmerkletree::{
- frontier::{self, Frontier},
- Address,
- Position,
- Retention};
+use incrementalmerkletree::{Address, Position, Retention};
use rand::{rngs::OsRng, CryptoRng, Error as OtherError, RngCore};
use brave_wallet::impl_error;
use std::sync::Arc;
-use zcash_note_encryption::{
- batch, Domain, ShieldedOutput, COMPACT_NOTE_SIZE,
-};
+use zcash_note_encryption::{batch, Domain, ShieldedOutput, COMPACT_NOTE_SIZE};
use shardtree::{
- error::ShardTreeError,
store::{Checkpoint, ShardStore, TreeState},
- LocatedPrunableTree, LocatedTree, PrunableTree, RetentionFlags,
- ShardTree,
+ LocatedPrunableTree, LocatedTree, PrunableTree, RetentionFlags, ShardTree,
};
-use zcash_client_backend::serialization::shardtree::{read_shard, write_shard};
use cxx::UniquePtr;
+use zcash_client_backend::serialization::shardtree::{read_shard, write_shard};
use pasta_curves::{group::ff::Field, pallas};
use crate::ffi::{
- CxxOrchardShardTreeDelegate,
- CxxOrchardShardAddress,
- CxxOrchardShardTreeCap,
- CxxOrchardCheckpoint,
- CxxOrchardCheckpointBundle,
- CxxOrchardCheckpointRetention,
- CxxOrchardShard,
- CxxOrchardCompactAction,
- CxxOrchardOutput,
- CxxOrchardSpend,
- CxxOrchardShardTreeLeaf,
- CxxOrchardShardTreeLeafs,
- CxxOrchardShardTreeState
+ CxxOrchardCheckpoint, CxxOrchardCheckpointBundle, CxxOrchardCompactAction, CxxOrchardOutput,
+ CxxOrchardShard, CxxOrchardShardAddress, CxxOrchardShardTreeCap, CxxOrchardShardTreeDelegate,
+ CxxOrchardShardTreeLeafs, CxxOrchardShardTreeState, CxxOrchardSpend,
};
-use shardtree::error::QueryError;
-
// The rest of the wallet code should be updated to use this version of unwrap
// and then this code can be removed
#[macro_export]
@@ -115,8 +93,6 @@ macro_rules! impl_result {
};
}
-use paste::item;
-
macro_rules! impl_result_option_wrapper {
($t: ty, $rt: ident, $l: ident) => {
paste::item! {
@@ -198,7 +174,6 @@ impl RngCore for MockRng {
}
}
-
#[allow(unused)]
#[allow(unsafe_op_in_unsafe_fn)]
#[cxx::bridge(namespace = brave_wallet::orchard)]
@@ -213,11 +188,11 @@ mod ffi {
addr: [u8; 43],
memo: [u8; 512],
// Whether to use memo field in the transacition
- use_memo: bool
+ use_memo: bool,
}
struct CxxMerkleHash {
- hash: [u8; 32]
+ hash: [u8; 32],
}
// Merkle path for the leaf in the merkle tree.
@@ -226,7 +201,7 @@ mod ffi {
struct CxxMerklePath {
position: u32,
auth_path: Vec,
- root: CxxMerkleHash
+ root: CxxMerkleHash,
}
// Represents spending for a single Orchard note.
@@ -240,25 +215,25 @@ mod ffi {
rho: [u8; 32],
r: [u8; 32],
// Witness merkle path
- merkle_path: CxxMerklePath
+ merkle_path: CxxMerklePath,
}
- // Represents compact Orchard action which is a piece of transaction data stored in the blockchain.
- // Parts of this action are used for different purposes.
- // cmx is used to construct commitment tree, nullifier is used to construct nullifier set.
- // ephemeral_key add enc_cipher_text check whether this action is related to the account.
- // https://github.com/zcash/orchard/blob/5c451beb05a10337a57a7fdf279c1dd6a533b805/src/note_encryption.rs#L271
+ // Represents compact Orchard action which is a piece of transaction data stored
+ // in the blockchain. Parts of this action are used for different purposes.
+ // cmx is used to construct commitment tree, nullifier is used to construct
+ // nullifier set. ephemeral_key add enc_cipher_text check whether this
+ // action is related to the account. https://github.com/zcash/orchard/blob/5c451beb05a10337a57a7fdf279c1dd6a533b805/src/note_encryption.rs#L271
struct CxxOrchardCompactAction {
- nullifier: [u8; 32], // kOrchardNullifierSize
- ephemeral_key: [u8; 32], // kOrchardEphemeralKeySize
- cmx: [u8; 32], // kOrchardCmxSize
- enc_cipher_text : [u8; 52], // kOrchardCipherTextSize
+ nullifier: [u8; 32], // kOrchardNullifierSize
+ ephemeral_key: [u8; 32], // kOrchardEphemeralKeySize
+ cmx: [u8; 32], // kOrchardCmxSize
+ enc_cipher_text: [u8; 52], // kOrchardCipherTextSize
block_id: u32,
- is_block_last_action: bool
+ is_block_last_action: bool,
}
- // Represents information about tree state at the end of the block prior to the scan range.
- // Used in batch decoding to allow inserting leafs to the tree.
+ // Represents information about tree state at the end of the block prior to the
+ // scan range. Used in batch decoding to allow inserting leafs to the tree.
// https://github.com/zcash/incrementalmerkletree/blob/382d915c068a5691e900e129e58b3da215cba6f2/incrementalmerkletree/src/frontier.rs#L35
#[derive(Clone)]
struct CxxOrchardShardTreeState {
@@ -270,17 +245,17 @@ mod ffi {
// The height of the block
block_height: u32,
// Tree size of the tree at the end of the prior block, used to calculate leafs indexes
- tree_size: u32
+ tree_size: u32,
}
// Retention of the leaf in the shard tree descibes lifetime of the leaf.
- // Leafs which are marked couldn't be pruned and checkpointed leafs also keep tree state for the leaf.
- // https://github.com/zcash/incrementalmerkletree/blob/382d915c068a5691e900e129e58b3da215cba6f2/incrementalmerkletree/src/lib.rs#L82
+ // Leafs which are marked couldn't be pruned and checkpointed leafs also keep
+ // tree state for the leaf. https://github.com/zcash/incrementalmerkletree/blob/382d915c068a5691e900e129e58b3da215cba6f2/incrementalmerkletree/src/lib.rs#L82
#[derive(Clone)]
struct CxxOrchardCheckpointRetention {
checkpoint: bool,
marked: bool,
- checkpoint_id: u32
+ checkpoint_id: u32,
}
// Represents a leaf of the shard tree as a pair of
@@ -288,12 +263,12 @@ mod ffi {
#[derive(Clone)]
struct CxxOrchardShardTreeLeaf {
hash: [u8; 32],
- retention: CxxOrchardCheckpointRetention
+ retention: CxxOrchardCheckpointRetention,
}
#[derive(Clone)]
struct CxxOrchardShardTreeLeafs {
- commitments: Vec
+ commitments: Vec,
}
// Address of the shard in the shard tree
@@ -301,7 +276,7 @@ mod ffi {
#[derive(Default)]
struct CxxOrchardShardAddress {
level: u8,
- index: u32
+ index: u32,
}
// Serialized binary tree representation of the shard tree cap
@@ -320,7 +295,7 @@ mod ffi {
address: CxxOrchardShardAddress,
// Maybe empty on uncompleted shards
hash: Vec,
- data: Vec
+ data: Vec,
}
// Represents checkpoint data to be stored in the shard tree
@@ -329,19 +304,19 @@ mod ffi {
struct CxxOrchardCheckpoint {
empty: bool,
position: u32,
- mark_removed: Vec
+ mark_removed: Vec,
}
// Checkpoint Id + Checkpoint value
#[derive(Default)]
struct CxxOrchardCheckpointBundle {
checkpoint_id: u32,
- checkpoint: CxxOrchardCheckpoint
+ checkpoint: CxxOrchardCheckpoint,
}
extern "Rust" {
- // Extended spending key is a key used to derive new keys in the Orchard protocol.
- // https://zips.z.cash/zip-0032#orchard-extended-keys
+ // Extended spending key is a key used to derive new keys in the Orchard
+ // protocol. https://zips.z.cash/zip-0032#orchard-extended-keys
type CxxOrchardExtendedSpendingKey;
// Orchard transation part in unsigned state.
// https://github.com/zcash/orchard/blob/5c451beb05a10337a57a7fdf279c1dd6a533b805/src/bundle.rs#L152
@@ -356,7 +331,7 @@ mod ffi {
type CxxOrchardShardTree;
// Testing shard tree with size of 8.
type CxxOrchardTestingShardTree;
- // Merkle path in the shard tree for the provided leaf position.
+ // Merkle path in the shard tree for the provided leaf position.
type CxxOrchardWitness;
type CxxOrchardExtendedSpendingKeyResult;
@@ -380,7 +355,7 @@ mod ffi {
fn create_orchard_bundle(
tree_state: &[u8],
spends: Vec,
- outputs: Vec
+ outputs: Vec,
) -> Box;
// Creates orchard bundle with mocked rng using provided rng seed.
@@ -389,46 +364,44 @@ mod ffi {
tree_state: &[u8],
spends: Vec,
outputs: Vec,
- rng_seed: u64
+ rng_seed: u64,
) -> Box;
fn generate_orchard_extended_spending_key_from_seed(
- bytes: &[u8]
+ bytes: &[u8],
) -> Box;
fn is_ok(self: &CxxOrchardExtendedSpendingKeyResult) -> bool;
fn error_message(self: &CxxOrchardExtendedSpendingKeyResult) -> String;
- fn unwrap(self: &mut CxxOrchardExtendedSpendingKeyResult) -> Box;
+ fn unwrap(
+ self: &mut CxxOrchardExtendedSpendingKeyResult,
+ ) -> Box;
fn batch_decode(
- fvk_bytes: &[u8; 96], // Array size should match kOrchardFullViewKeySize
+ fvk_bytes: &[u8; 96], // Array size should match kOrchardFullViewKeySize
prior_tree_state: CxxOrchardShardTreeState,
- actions: Vec
+ actions: Vec,
) -> Box;
fn derive(
self: &CxxOrchardExtendedSpendingKey,
- index: u32
+ index: u32,
) -> Box;
// External addresses can be used for receiving funds from external
// senders.
fn external_address(
self: &CxxOrchardExtendedSpendingKey,
- diversifier_index: u32
- ) -> [u8; 43]; // Array size should match kOrchardRawBytesSize
- // Internal addresses are used for change or internal shielding and
- // shouldn't be exposed to public.
+ diversifier_index: u32,
+ ) -> [u8; 43]; // Array size should match kOrchardRawBytesSize
+ // Internal addresses are used for change or internal shielding and
+ // shouldn't be exposed to public.
fn internal_address(
self: &CxxOrchardExtendedSpendingKey,
- diversifier_index: u32
- ) -> [u8; 43]; // Array size should match kOrchardRawBytesSize
- fn full_view_key(
- self: &CxxOrchardExtendedSpendingKey
- ) -> [u8; 96]; // Array size sohuld match kOrchardFullViewKeySize
+ diversifier_index: u32,
+ ) -> [u8; 43]; // Array size should match kOrchardRawBytesSize
+ fn full_view_key(self: &CxxOrchardExtendedSpendingKey) -> [u8; 96]; // Array size sohuld match kOrchardFullViewKeySize
- fn spending_key(
- self: &CxxOrchardExtendedSpendingKey
- ) -> [u8; 32]; // Array size should match kSpendingKeySize
+ fn spending_key(self: &CxxOrchardExtendedSpendingKey) -> [u8; 32]; // Array size should match kSpendingKeySize
fn is_ok(self: &CxxOrchardAuthorizedBundleResult) -> bool;
fn error_message(self: &CxxOrchardAuthorizedBundleResult) -> String;
@@ -436,22 +409,27 @@ mod ffi {
fn is_ok(self: &CxxOrchardUnauthorizedBundleResult) -> bool;
fn error_message(self: &CxxOrchardUnauthorizedBundleResult) -> String;
- fn unwrap(self: &mut CxxOrchardUnauthorizedBundleResult) -> Box;
+ fn unwrap(
+ self: &mut CxxOrchardUnauthorizedBundleResult,
+ ) -> Box;
fn is_ok(self: &CxxOrchardDecodedBlocksBundleResult) -> bool;
fn error_message(self: &CxxOrchardDecodedBlocksBundleResult) -> String;
- fn unwrap(self: &mut CxxOrchardDecodedBlocksBundleResult) -> Box;
+ fn unwrap(
+ self: &mut CxxOrchardDecodedBlocksBundleResult,
+ ) -> Box;
- fn size(self :&CxxOrchardDecodedBlocksBundle) -> usize;
- fn note_value(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> u32;
+ fn size(self: &CxxOrchardDecodedBlocksBundle) -> usize;
+ fn note_value(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> u32;
// Result array size should match kOrchardNullifierSize
// fvk array size should match kOrchardFullViewKeySize
- fn note_nullifier(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
- fn note_rho(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
- fn note_rseed(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
- fn note_addr(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 43];
- fn note_block_height(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> u32;
- fn note_commitment_tree_position(self :&CxxOrchardDecodedBlocksBundle, index: usize) -> u32;
+ fn note_nullifier(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
+ fn note_rho(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
+ fn note_rseed(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 32];
+ fn note_addr(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> [u8; 43];
+ fn note_block_height(self: &CxxOrchardDecodedBlocksBundle, index: usize) -> u32;
+ fn note_commitment_tree_position(self: &CxxOrchardDecodedBlocksBundle, index: usize)
+ -> u32;
fn is_ok(self: &CxxOrchardShardTreeResult) -> bool;
fn error_message(self: &CxxOrchardShardTreeResult) -> String;
@@ -463,10 +441,13 @@ mod ffi {
// Orchard digest is desribed here https://zips.z.cash/zip-0244#t-4-orchard-digest
// Used in constructing signature digest and tx id
- fn orchard_digest(self: &CxxOrchardUnauthorizedBundle) -> [u8; 32]; // Array size should match kZCashDigestSize
- // Completes unauthorized bundle to authorized state
- // Signature digest should be constructed as desribed in https://zips.z.cash/zip-0244#signature-digest
- fn complete(self: &CxxOrchardUnauthorizedBundle, sighash: [u8; 32]) -> Box; // Array size should match kZCashDigestSize
+ fn orchard_digest(self: &CxxOrchardUnauthorizedBundle) -> [u8; 32]; // Array size should match kZCashDigestSize
+ // Completes unauthorized bundle to authorized state
+ // Signature digest should be constructed as desribed in https://zips.z.cash/zip-0244#signature-digest
+ fn complete(
+ self: &CxxOrchardUnauthorizedBundle,
+ sighash: [u8; 32],
+ ) -> Box; // Array size should match kZCashDigestSize
// Orchard part of v5 transaction as described in
// https://zips.z.cash/zip-0225
@@ -476,125 +457,117 @@ mod ffi {
fn is_ok(self: &CxxOrchardWitnessResult) -> bool;
fn error_message(self: &CxxOrchardWitnessResult) -> String;
fn unwrap(self: &mut CxxOrchardWitnessResult) -> Box;
- fn size(self :&CxxOrchardWitness) -> usize;
+ fn size(self: &CxxOrchardWitness) -> usize;
fn item(self: &CxxOrchardWitness, index: usize) -> [u8; 32];
// Creates shard tree of default orchard height
fn create_orchard_shard_tree(
- delegate: UniquePtr
+ delegate: UniquePtr,
) -> Box;
// Creates shard tree of smaller size for testing purposes
fn create_orchard_testing_shard_tree(
- delegate: UniquePtr
+ delegate: UniquePtr,
) -> Box;
fn insert_commitments(
self: &mut CxxOrchardShardTree,
- scan_result: &mut CxxOrchardDecodedBlocksBundle) -> bool;
+ scan_result: &mut CxxOrchardDecodedBlocksBundle,
+ ) -> bool;
fn calculate_witness(
self: &mut CxxOrchardShardTree,
commitment_tree_position: u32,
- checkpoint: u32) -> Box;
+ checkpoint: u32,
+ ) -> Box;
fn truncate(self: &mut CxxOrchardShardTree, checkpoint_id: u32) -> bool;
fn insert_commitments(
self: &mut CxxOrchardTestingShardTree,
- scan_result: &mut CxxOrchardDecodedBlocksBundle) -> bool;
+ scan_result: &mut CxxOrchardDecodedBlocksBundle,
+ ) -> bool;
fn calculate_witness(
self: &mut CxxOrchardTestingShardTree,
commitment_tree_position: u32,
- checkpoint: u32) -> Box;
+ checkpoint: u32,
+ ) -> Box;
fn truncate(self: &mut CxxOrchardTestingShardTree, checkpoint_id: u32) -> bool;
// Size matches kOrchardCmxSize in zcash_utils
fn create_mock_commitment(position: u32, seed: u32) -> [u8; 32];
fn create_mock_decode_result(
prior_tree_state: CxxOrchardShardTreeState,
- commitments: CxxOrchardShardTreeLeafs) -> Box;
+ commitments: CxxOrchardShardTreeLeafs,
+ ) -> Box;
fn wrap_shard_tree_shard(item: CxxOrchardShard) -> Box;
- fn wrap_shard_tree_shard_error()-> Box;
- fn wrap_shard_tree_shard_none()-> Box;
+ fn wrap_shard_tree_shard_error() -> Box;
+ fn wrap_shard_tree_shard_none() -> Box;
- fn wrap_bool(item : bool) -> Box;
+ fn wrap_bool(item: bool) -> Box;
fn wrap_bool_error() -> Box;
- fn wrap_shard_tree_cap(item :CxxOrchardShardTreeCap) -> Box;
+ fn wrap_shard_tree_cap(
+ item: CxxOrchardShardTreeCap,
+ ) -> Box;
fn wrap_shard_tree_cap_error() -> Box;
fn wrap_shard_tree_cap_none() -> Box;
- fn wrap_checkpoint_id(item : u32) -> Box;
+ fn wrap_checkpoint_id(item: u32) -> Box;
fn wrap_checkpoint_id_error() -> Box;
fn wrap_checkpoint_id_none() -> Box;
- fn wrap_checkpoint_bundle(item: CxxOrchardCheckpointBundle) -> Box;
+ fn wrap_checkpoint_bundle(
+ item: CxxOrchardCheckpointBundle,
+ ) -> Box;
fn wrap_checkpoint_bundle_error() -> Box;
fn wrap_checkpoint_bundle_none() -> Box;
fn wrap_checkpoint_count(item: usize) -> Box;
fn wrap_checkpoint_count_error() -> Box;
- fn wrap_checkpoints(item: Vec) -> Box;
+ fn wrap_checkpoints(
+ item: Vec,
+ ) -> Box;
fn wrap_checkpoints_error() -> Box;
- fn wrap_shard_tree_roots(item: Vec) -> Box;
+ fn wrap_shard_tree_roots(
+ item: Vec,
+ ) -> Box;
fn wrap_shard_tree_roots_error() -> Box;
}
unsafe extern "C++" {
- include!("brave/components/brave_wallet/browser/zcash/rust/cxx_orchard_shard_tree_delegate.h");
+ include!(
+ "brave/components/brave_wallet/browser/zcash/rust/cxx_orchard_shard_tree_delegate.h"
+ );
type CxxOrchardShardTreeDelegate;
- fn LastShard(
- &self, shard_level: u8) -> Box;
- fn GetShard(
- &self,
- addr: &CxxOrchardShardAddress)-> Box;
- fn PutShard(
- &self,
- tree: &CxxOrchardShard) -> Box;
- fn GetShardRoots(
- &self, shard_level: u8) -> Box;
- fn Truncate(
- &self,
- address: &CxxOrchardShardAddress) -> Box;
- fn GetCap(
- &self) -> Box;
- fn PutCap(
- &self,
- tree: &CxxOrchardShardTreeCap) -> Box;
- fn MinCheckpointId(
- &self) -> Box;
- fn MaxCheckpointId(
- &self) -> Box;
+ fn LastShard(&self, shard_level: u8) -> Box;
+ fn GetShard(&self, addr: &CxxOrchardShardAddress) -> Box;
+ fn PutShard(&self, tree: &CxxOrchardShard) -> Box;
+ fn GetShardRoots(&self, shard_level: u8) -> Box;
+ fn Truncate(&self, address: &CxxOrchardShardAddress) -> Box;
+ fn GetCap(&self) -> Box;
+ fn PutCap(&self, tree: &CxxOrchardShardTreeCap) -> Box;
+ fn MinCheckpointId(&self) -> Box;
+ fn MaxCheckpointId(&self) -> Box;
fn AddCheckpoint(
&self,
checkpoint_id: u32,
- checkpoint: &CxxOrchardCheckpoint) -> Box;
+ checkpoint: &CxxOrchardCheckpoint,
+ ) -> Box;
fn UpdateCheckpoint(
&self,
checkpoint_id: u32,
- checkpoint: &CxxOrchardCheckpoint) -> Box;
- fn CheckpointCount(
- &self) -> Box;
- fn CheckpointAtDepth(
- &self,
- depth: usize) -> Box;
- fn GetCheckpoint(
- &self,
- checkpoint_id: u32) -> Box;
- fn RemoveCheckpoint(
- &self,
- checkpoint_id: u32) -> Box;
- fn TruncateCheckpoint(
- &self,
- checkpoint_id: u32) -> Box;
- fn GetCheckpoints(
- &self,
- limit: usize) -> Box;
+ checkpoint: &CxxOrchardCheckpoint,
+ ) -> Box;
+ fn CheckpointCount(&self) -> Box;
+ fn CheckpointAtDepth(&self, depth: usize) -> Box;
+ fn GetCheckpoint(&self, checkpoint_id: u32) -> Box;
+ fn RemoveCheckpoint(&self, checkpoint_id: u32) -> Box;
+ fn TruncateCheckpoint(&self, checkpoint_id: u32) -> Box;
+ fn GetCheckpoints(&self, limit: usize) -> Box;
}
-
}
#[derive(Debug)]
@@ -652,21 +625,21 @@ enum OrchardRandomSource {
pub struct OrchardUnauthorizedBundleValue {
unauthorized_bundle: Bundle, Amount>,
rng: OrchardRandomSource,
- asks: Vec
+ asks: Vec,
}
// Authorized bundle is a bundle where inputs are signed with signature digests
// and proof is generated.
#[derive(Clone)]
pub struct OrchardAuthorizedBundleValue {
- raw_tx: Vec
+ raw_tx: Vec,
}
#[derive(Clone)]
pub struct DecryptedOrchardOutput {
note: ::Note,
block_height: u32,
- commitment_tree_position: u32
+ commitment_tree_position: u32,
}
#[derive(Clone)]
@@ -674,28 +647,31 @@ pub struct OrchardDecodedBlocksBundleValue {
fvk: [u8; 96],
outputs: Vec,
commitments: Vec<(MerkleHashOrchard, Retention)>,
- prior_tree_state: CxxOrchardShardTreeState
+ prior_tree_state: CxxOrchardShardTreeState,
}
pub struct OrchardWitnessValue {
- path: MarkleHashVec
+ path: MarkleHashVec,
}
pub struct OrchardGenericShardTreeBundleValue {
- tree: ShardTree, T, S>
+ tree: ShardTree, T, S>,
}
type OrchardShardTreeValue =
OrchardGenericShardTreeBundleValue;
-type OrchardTestingShardTreeValue =
- OrchardGenericShardTreeBundleValue;
+type OrchardTestingShardTreeValue = OrchardGenericShardTreeBundleValue<
+ TESTING_TREE_HEIGHT,
+ TESTING_SHARD_HEIGHT,
+ TESTING_PRUNING_DEPTH,
+>;
#[derive(Clone)]
pub struct MarkleHashVec(Vec);
impl From> for MarkleHashVec {
fn from(item: incrementalmerkletree::MerklePath) -> Self {
- let mut result : Vec = vec![];
+ let mut result: Vec = vec![];
for elem in item.path_elems() {
result.push(*elem);
}
@@ -719,12 +695,32 @@ struct CxxOrchardShardTreeResult(Result