diff --git a/android/brave_java_sources.gni b/android/brave_java_sources.gni index 2fae959096cc..781df1730c98 100644 --- a/android/brave_java_sources.gni +++ b/android/brave_java_sources.gni @@ -7,10 +7,10 @@ import("//brave/android/features/tab_ui/brave_tab_management_java_sources.gni") import("//brave/android/feed/brave_feed_java_sources.gni") import( "//brave/android/java/org/chromium/chrome/browser/vpn/billing/sources.gni") +import("//brave/base/brave_base_shared_preferences_java.gni") import("//brave/browser/brave_ads/android/java_sources.gni") import("//brave/browser/flags/brave_flags_java_sources.gni") import("//brave/browser/incognito/android/java_sources.gni") -import("//brave/browser/preferences/brave_preferences_java_sources.gni") import("//brave/browser/share/android/java_sources.gni") import("//brave/components/embedder_support/android/java_sources.gni") import("//brave/components/permissions/android/java_sources.gni") @@ -300,7 +300,6 @@ brave_java_sources = [ "../../brave/android/java/org/chromium/chrome/browser/onboarding/v2/HighlightView.java", "../../brave/android/java/org/chromium/chrome/browser/onboarding/v2/OnboardingV2Fragment.java", "../../brave/android/java/org/chromium/chrome/browser/onboarding/v2/OnboardingV2PagerAdapter.java", - "../../brave/android/java/org/chromium/chrome/browser/paint_preview/BraveStartupPaintPreviewHelper.java", "../../brave/android/java/org/chromium/chrome/browser/partnercustomizations/CloseBraveManager.java", "../../brave/android/java/org/chromium/chrome/browser/password_manager/settings/BravePasswordSettingsBase.java", "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java", diff --git a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java index 97e9d8f7aed3..6837c44b88c1 100644 --- a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java +++ b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java @@ -15,6 +15,7 @@ import androidx.annotation.Px; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.jank_tracker.JankTracker; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; @@ -38,26 +39,58 @@ public class BraveFeedSurfaceCoordinator extends FeedSurfaceCoordinator { // Own members. private @Nullable FrameLayout mFrameLayoutForPolicy; - public BraveFeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarManager, - WindowAndroid windowAndroid, @Nullable SnapScrollHelper snapScrollHelper, - @Nullable View ntpHeader, @Px int toolbarHeight, boolean showDarkBackground, - FeedSurfaceDelegate delegate, Profile profile, boolean isPlaceholderShownInitially, + public BraveFeedSurfaceCoordinator( + Activity activity, + SnackbarManager snackbarManager, + WindowAndroid windowAndroid, + @Nullable JankTracker jankTracker, + @Nullable SnapScrollHelper snapScrollHelper, + @Nullable View ntpHeader, + @Px int toolbarHeight, + boolean showDarkBackground, + FeedSurfaceDelegate delegate, + Profile profile, + boolean isPlaceholderShownInitially, BottomSheetController bottomSheetController, Supplier shareDelegateSupplier, @Nullable ScrollableContainerDelegate externalScrollableContainerDelegate, @NewTabPageLaunchOrigin int launchOrigin, PrivacyPreferencesManagerImpl privacyPreferencesManager, - @NonNull Supplier toolbarSupplier, @SurfaceType int surfaceType, - long embeddingSurfaceCreatedTimeNs, @Nullable FeedSwipeRefreshLayout swipeRefreshLayout, - boolean overScrollDisabled, @Nullable ViewGroup viewportView, - FeedActionDelegate actionDelegate, HelpAndFeedbackLauncher helpAndFeedbackLauncher, + @NonNull Supplier toolbarSupplier, + @SurfaceType int surfaceType, + long embeddingSurfaceCreatedTimeNs, + @Nullable FeedSwipeRefreshLayout swipeRefreshLayout, + boolean overScrollDisabled, + @Nullable ViewGroup viewportView, + FeedActionDelegate actionDelegate, + HelpAndFeedbackLauncher helpAndFeedbackLauncher, TabModelSelector tabModelSelector) { - super(activity, snackbarManager, windowAndroid, snapScrollHelper, ntpHeader, toolbarHeight, - showDarkBackground, delegate, profile, isPlaceholderShownInitially, - bottomSheetController, shareDelegateSupplier, externalScrollableContainerDelegate, - launchOrigin, privacyPreferencesManager, toolbarSupplier, surfaceType, - embeddingSurfaceCreatedTimeNs, swipeRefreshLayout, overScrollDisabled, viewportView, - actionDelegate, helpAndFeedbackLauncher, tabModelSelector); + super( + activity, + snackbarManager, + windowAndroid, + jankTracker, + snapScrollHelper, + ntpHeader, + toolbarHeight, + showDarkBackground, + delegate, + profile, + isPlaceholderShownInitially, + bottomSheetController, + shareDelegateSupplier, + externalScrollableContainerDelegate, + launchOrigin, + privacyPreferencesManager, + toolbarSupplier, + surfaceType, + embeddingSurfaceCreatedTimeNs, + swipeRefreshLayout, + overScrollDisabled, + viewportView, + actionDelegate, + helpAndFeedbackLauncher, + tabModelSelector); } public void createFrameLayoutForPolicy() { diff --git a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator.java b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator.java index 90f4f65f28c5..005129138bab 100644 --- a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator.java +++ b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator.java @@ -11,6 +11,7 @@ import androidx.annotation.Nullable; import org.chromium.chrome.browser.feed.sort_ui.FeedOptionsCoordinator; +import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.ui.modelutil.PropertyModel; public class BraveFeedSurfaceMediator extends FeedSurfaceMediator { @@ -18,12 +19,24 @@ public class BraveFeedSurfaceMediator extends FeedSurfaceMediator { private FeedSurfaceCoordinator mCoordinator; private SnapScrollHelper mSnapScrollHelper; - BraveFeedSurfaceMediator(FeedSurfaceCoordinator coordinator, Context context, - @Nullable SnapScrollHelper snapScrollHelper, PropertyModel headerModel, - @FeedSurfaceCoordinator.StreamTabId int openingTabId, FeedActionDelegate actionDelegate, - FeedOptionsCoordinator optionsCoordinator) { - super(coordinator, context, snapScrollHelper, headerModel, openingTabId, actionDelegate, - optionsCoordinator); + BraveFeedSurfaceMediator( + FeedSurfaceCoordinator coordinator, + Context context, + @Nullable SnapScrollHelper snapScrollHelper, + PropertyModel headerModel, + @FeedSurfaceCoordinator.StreamTabId int openingTabId, + FeedActionDelegate actionDelegate, + FeedOptionsCoordinator optionsCoordinator, + @Nullable UiConfig uiConfig) { + super( + coordinator, + context, + snapScrollHelper, + headerModel, + openingTabId, + actionDelegate, + optionsCoordinator, + uiConfig); } @Override @@ -51,7 +64,12 @@ void updateContent() { } } - public void destroyPropertiesForStream() { - assert false : "destroyPropertiesForStream should be redirected to parent in bytecode!"; + @Override + public void onTemplateURLServiceChanged() { + if (!FeedFeatures.isFeedEnabled()) { + // We don't need any special handling since feed is disabled. + return; + } + super.onTemplateURLServiceChanged(); } } diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags index d0a1a2e0dab8..98db29e806a9 100644 --- a/android/java/apk_for_test.flags +++ b/android/java/apk_for_test.flags @@ -266,8 +266,13 @@ public (...); } --keep class org.chromium.chrome.browser.preferences.ChromePreferenceKeyChecker { - *** getInstance(...); +-keep class org.chromium.base.shared_preferences.StrictPreferenceKeyChecker { + (...); + *** isKeyInUse(...); +} + +-keep class org.chromium.base.shared_preferences.BraveStrictPreferenceKeyChecker { + (...); } -keep class org.chromium.chrome.browser.toolbar.BraveToolbarManager { @@ -409,7 +414,6 @@ (...); *** mCoordinator; *** mSnapScrollHelper; - *** destroyPropertiesForStream(...); } -keep class org.chromium.chrome.browser.feed.BraveFeedSurfaceMediator { @@ -525,6 +529,7 @@ -keep class org.chromium.chrome.browser.omnibox.suggestions.AutocompleteMediator { *** mNativeInitialized; *** mDropdownViewInfoListManager; + *** mDropdownViewInfoListBuilder; public (...); } @@ -719,11 +724,6 @@ *** updateVisibility(...); } - --keep class org.chromium.chrome.browser.paint_preview.StartupPaintPreviewHelper { - *** isEnabled(...); -} - -keep class org.chromium.chrome.browser.document.ChromeLauncherActivity { public (...); } diff --git a/android/java/org/chromium/base/BravePreferenceKeys.java b/android/java/org/chromium/base/BravePreferenceKeys.java index cd5a505743fa..104b2d384c04 100644 --- a/android/java/org/chromium/base/BravePreferenceKeys.java +++ b/android/java/org/chromium/base/BravePreferenceKeys.java @@ -5,6 +5,9 @@ package org.chromium.base; +import java.util.Arrays; +import java.util.List; + public final class BravePreferenceKeys { public static final String BRAVE_BOTTOM_TOOLBAR_ENABLED_KEY = "brave_bottom_toolbar_enabled_key"; @@ -56,4 +59,70 @@ public final class BravePreferenceKeys { public static final String BRAVE_DEFERRED_DEEPLINK_PLAYLIST = "brave_deferred_deeplink_playlist"; public static final String BRAVE_DEFERRED_DEEPLINK_VPN = "brave_deferred_deeplink_vpn"; + public static final String BRAVE_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit"; + public static final String BRAVE_CLEAR_ON_EXIT = "clear_on_exit"; + public static final String BRAVE_QUICK_ACTION_SEARCH_AND_BOOKMARK_WIDGET_TILES = + "org.chromium.chrome.browser.widget.quickactionsearchandbookmark.QuickActionSearchAndBookmarkWidgetProvider.TILES"; + + // These are dynamic keys + public static final String BRAVE_RECYCLERVIEW_POSITION = "recyclerview_visible_position_"; + public static final String BRAVE_RECYCLERVIEW_OFFSET_POSITION = "recyclerview_offset_position_"; + + /* + * Returns the list of Brave's preference keys. + */ + private static List getKeysInUse() { + return Arrays.asList( + BRAVE_BOTTOM_TOOLBAR_ENABLED_KEY, + BRAVE_BOTTOM_TOOLBAR_SET_KEY, + BRAVE_USE_CUSTOM_TABS, + BRAVE_APP_OPEN_COUNT, + BRAVE_ROLE_MANAGER_DIALOG_COUNT, + BRAVE_IS_DEFAULT, + BRAVE_WAS_DEFAULT_ASK_COUNT, + BRAVE_SET_DEFAULT_BOTTOM_SHEET_COUNT, + BRAVE_DEFAULT_DONT_ASK, + BRAVE_UPDATE_EXTRA_PARAM, + BRAVE_NOTIFICATION_PREF_NAME, + BRAVE_MILLISECONDS_NAME, + BRAVE_DOWNLOADS_AUTOMATICALLY_OPEN_WHEN_POSSIBLE, + BRAVE_DOWNLOADS_DOWNLOAD_PROGRESS_NOTIFICATION_BUBBLE, + BRAVE_DOUBLE_RESTART, + BRAVE_TAB_GROUPS_ENABLED, + BRAVE_DISABLE_SHARING_HUB, + BRAVE_NEWS_CARDS_VISITED, + BRAVE_NEWS_CHANGE_SOURCE, + BRAVE_NEWS_FEED_HASH, + BRAVE_NEWS_PREF_SHOW_NEWS, + BRAVE_NEWS_PREF_TURN_ON_NEWS, + BRAVE_USE_BIOMETRICS_FOR_WALLET, + BRAVE_BIOMETRICS_FOR_WALLET_IV, + BRAVE_BIOMETRICS_FOR_WALLET_ENCRYPTED, + BRAVE_AD_FREE_CALLOUT_DIALOG, + BRAVE_OPENED_YOUTUBE, + SHOULD_SHOW_COOKIE_CONSENT_NOTICE, + LOADED_SITE_COUNT, + BRAVE_BACKGROUND_VIDEO_PLAYBACK_CONVERTED_TO_FEATURE, + BRAVE_APP_OPEN_COUNT_FOR_WIDGET_PROMO, + BRAVE_DEFERRED_DEEPLINK_PLAYLIST, + BRAVE_DEFERRED_DEEPLINK_VPN, + BRAVE_CLOSE_TABS_ON_EXIT, + BRAVE_CLEAR_ON_EXIT, + BRAVE_QUICK_ACTION_SEARCH_AND_BOOKMARK_WIDGET_TILES); + } + + /* + * Checks if preference key is among Brave's dynamic keys. + */ + private static boolean isBraveDynamicKeyInUse(String key) { + return key.startsWith(BRAVE_RECYCLERVIEW_POSITION) + || key.startsWith(BRAVE_RECYCLERVIEW_OFFSET_POSITION); + } + + /* + * Checks if preference key is used in Brave. + */ + public static boolean isBraveKeyInUse(String key) { + return getKeysInUse().contains(key) || isBraveDynamicKeyInUse(key); + } } diff --git a/android/java/org/chromium/chrome/browser/BraveIntentHandler.java b/android/java/org/chromium/chrome/browser/BraveIntentHandler.java index f8f24fb1a89f..d9f9cbf3d1fe 100644 --- a/android/java/org/chromium/chrome/browser/BraveIntentHandler.java +++ b/android/java/org/chromium/chrome/browser/BraveIntentHandler.java @@ -5,10 +5,8 @@ package org.chromium.chrome.browser; -import android.app.Activity; import android.app.SearchManager; import android.content.Intent; -import android.net.Uri; import android.text.TextUtils; import org.chromium.base.IntentUtils; @@ -16,46 +14,19 @@ import org.chromium.base.ThreadUtils; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; -import org.chromium.chrome.browser.util.BraveConstants; import org.chromium.content_public.browser.BrowserStartupController; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; -public class BraveIntentHandler extends IntentHandler { +public class BraveIntentHandler { private static final String TAG = "BraveIntentHandler"; - private static final String CONNECTION_INFO_HELP_URL = + public static final String CONNECTION_INFO_HELP_URL = "https://support.google.com/chrome?p=android_connection_info"; - private static final String BRAVE_CONNECTION_INFO_HELP_URL = + public static final String BRAVE_CONNECTION_INFO_HELP_URL = "https://support.brave.com/hc/en-us/articles/360018185871-How-do-I-check-if-a-site-s-connection-is-secure-"; - public BraveIntentHandler(Activity activity, IntentHandlerDelegate delegate) { - super(activity, delegate); - } - - @Override - public boolean onNewIntent(Intent intent) { - // Redirect requests if necessary - String url = getUrlFromIntent(intent); - if (url != null && url.equals(CONNECTION_INFO_HELP_URL)) { - intent.setData(Uri.parse(BRAVE_CONNECTION_INFO_HELP_URL)); - } - String appLinkAction = intent.getAction(); - Uri appLinkData = intent.getData(); - - if (Intent.ACTION_VIEW.equals(appLinkAction) && appLinkData != null) { - String lastPathSegment = appLinkData.getLastPathSegment(); - if (lastPathSegment != null - && (lastPathSegment.equalsIgnoreCase(BraveConstants.DEEPLINK_ANDROID_PLAYLIST) - || lastPathSegment.equalsIgnoreCase( - BraveConstants.DEEPLINK_ANDROID_VPN))) { - return false; - } - } - return super.onNewIntent(intent); - } - /** * Helper method to extract the raw URL from the intent, without further processing. * The URL may be in multiple locations. @@ -64,7 +35,7 @@ public boolean onNewIntent(Intent intent) { */ protected static String extractUrlFromIntent(Intent intent) { if (intent == null) return null; - String url = getUrlFromVoiceSearchResult(intent); + String url = IntentHandler.getUrlFromVoiceSearchResult(intent); if (url == null) url = getUrlForCustomTab(intent); if (url == null) url = getUrlForWebapp(intent); if (url == null) url = intent.getDataString(); diff --git a/android/java/org/chromium/chrome/browser/app/BraveActivity.java b/android/java/org/chromium/chrome/browser/app/BraveActivity.java index 245d56d6b124..b33b177de99d 100644 --- a/android/java/org/chromium/chrome/browser/app/BraveActivity.java +++ b/android/java/org/chromium/chrome/browser/app/BraveActivity.java @@ -15,6 +15,7 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -74,6 +75,7 @@ import org.chromium.chrome.browser.BraveAdFreeCalloutDialogFragment; import org.chromium.chrome.browser.BraveFeatureUtil; import org.chromium.chrome.browser.BraveHelper; +import org.chromium.chrome.browser.BraveIntentHandler; import org.chromium.chrome.browser.BraveRelaunchUtils; import org.chromium.chrome.browser.BraveRewardsHelper; import org.chromium.chrome.browser.BraveSyncInformers; @@ -81,6 +83,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.CrossPromotionalModalDialogFragment; import org.chromium.chrome.browser.DormantUsersEngagementDialogFragment; +import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.InternetConnection; import org.chromium.chrome.browser.LaunchIntentDispatcher; import org.chromium.chrome.browser.app.domain.WalletModel; @@ -219,12 +222,11 @@ public abstract class BraveActivity extends ChromeActivity public static final String BRAVE_REWARDS_SETTINGS_MONTHLY_URL = "brave://rewards/#monthly"; public static final String REWARDS_AC_SETTINGS_URL = "brave://rewards/contribute"; public static final String BRAVE_AI_CHAT_URL = "chrome-untrusted://chat"; - public static final String REWARDS_LEARN_MORE_URL = "https://brave.com/faq-rewards/#unclaimed-funds"; + public static final String REWARDS_LEARN_MORE_URL = + "https://brave.com/faq-rewards/#unclaimed-funds"; public static final String BRAVE_TERMS_PAGE = "https://basicattentiontoken.org/user-terms-of-service/"; public static final String BRAVE_PRIVACY_POLICY = "https://brave.com/privacy/browser/#rewards"; - private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit"; - private static final String PREF_CLEAR_ON_EXIT = "clear_on_exit"; public static final String OPEN_URL = "open_url"; private static final int DAYS_1 = 1; @@ -1511,11 +1513,13 @@ private void createNotificationChannel() { } private boolean isNoRestoreState() { - return SharedPreferencesManager.getInstance().readBoolean(PREF_CLOSE_TABS_ON_EXIT, false); + return SharedPreferencesManager.getInstance() + .readBoolean(BravePreferenceKeys.BRAVE_CLOSE_TABS_ON_EXIT, false); } private boolean isClearBrowsingDataOnExit() { - return SharedPreferencesManager.getInstance().readBoolean(PREF_CLEAR_ON_EXIT, false); + return SharedPreferencesManager.getInstance() + .readBoolean(BravePreferenceKeys.BRAVE_CLEAR_ON_EXIT, false); } public void onRewardsPanelDismiss() { @@ -1717,7 +1721,8 @@ private void showBraveRateDialog() { private void showCrossPromotionalDialog() { CrossPromotionalModalDialogFragment mCrossPromotionalModalDialogFragment = new CrossPromotionalModalDialogFragment(); - mCrossPromotionalModalDialogFragment.show(getSupportFragmentManager(), "CrossPromotionalModalDialogFragment"); + mCrossPromotionalModalDialogFragment.show( + getSupportFragmentManager(), "CrossPromotionalModalDialogFragment"); } public void showDormantUsersEngagementDialog(String notificationType) { @@ -2093,4 +2098,36 @@ public void updateBottomSheetPosition(int orientation) { } } } + + /** + * Calls to {@link ChromeTabbedActivity#maybeHandleUrlIntent} will be redirected here via + * bytecode changes. + */ + public boolean maybeHandleUrlIntent(Intent intent) { + // Redirect requests if necessary + String url = IntentHandler.getUrlFromIntent(intent); + if (url != null && url.equals(BraveIntentHandler.CONNECTION_INFO_HELP_URL)) { + intent.setData(Uri.parse(BraveIntentHandler.BRAVE_CONNECTION_INFO_HELP_URL)); + } + String appLinkAction = intent.getAction(); + Uri appLinkData = intent.getData(); + + if (Intent.ACTION_VIEW.equals(appLinkAction) && appLinkData != null) { + String lastPathSegment = appLinkData.getLastPathSegment(); + if (lastPathSegment != null + && (lastPathSegment.equalsIgnoreCase(BraveConstants.DEEPLINK_ANDROID_PLAYLIST) + || lastPathSegment.equalsIgnoreCase( + BraveConstants.DEEPLINK_ANDROID_VPN))) { + return false; + } + } + // Call ChromeTabbedActivity's version. + return (boolean) + BraveReflectionUtil.InvokeMethod( + ChromeTabbedActivity.class, + this, + "maybeHandleUrlIntent", + Intent.class, + intent); + } } diff --git a/android/java/org/chromium/chrome/browser/app/domain/NetworkSelectorModel.java b/android/java/org/chromium/chrome/browser/app/domain/NetworkSelectorModel.java index 9d2f05d6b4b7..5643ea0e3711 100644 --- a/android/java/org/chromium/chrome/browser/app/domain/NetworkSelectorModel.java +++ b/android/java/org/chromium/chrome/browser/app/domain/NetworkSelectorModel.java @@ -72,23 +72,28 @@ public void init() { _mSelectedNetwork.postValue(NetworkUtils.getAllNetworkOption(mContext)); } } - mNetworkListsLd = Transformations.map(mNetworkModel.mNetworkLists, networkLists -> { - if (networkLists == null) return new NetworkModel.NetworkLists(); - NetworkModel.NetworkLists networkListsCopy = - new NetworkModel.NetworkLists(networkLists); - List allNetworkList = new ArrayList<>(networkLists.mCoreNetworks); - if (mMode == Mode.LOCAL_NETWORK_FILTER && SelectionMode.MULTI != mSelectionMode) { - NetworkInfo allNetwork = NetworkUtils.getAllNetworkOption(mContext); - networkListsCopy.mPrimaryNetworkList.add(0, allNetwork); - // Selected local network can be "All networks" - allNetworkList.add(0, allNetwork); - } - final NetworkInfo network = mNetworkModel.getNetwork(mSelectedChainId); - if (network != null) { - updateLocalNetwork(allNetworkList, mSelectedChainId, network.coin); - } - return networkListsCopy; - }); + mNetworkListsLd = + Transformations.map( + mNetworkModel.mNetworkLists, + networkLists -> { + if (networkLists == null) return new NetworkModel.NetworkLists(); + NetworkModel.NetworkLists networkListsCopy = + new NetworkModel.NetworkLists(networkLists); + List allNetworkList = + new ArrayList<>(networkLists.mCoreNetworks); + if (mMode == Mode.LOCAL_NETWORK_FILTER + && SelectionMode.MULTI != mSelectionMode) { + NetworkInfo allNetwork = NetworkUtils.getAllNetworkOption(mContext); + networkListsCopy.mPrimaryNetworkList.add(0, allNetwork); + // Selected local network can be "All networks" + allNetworkList.add(0, allNetwork); + } + final NetworkInfo network = mNetworkModel.getNetwork(mSelectedChainId); + if (network != null) { + updateLocalNetwork(allNetworkList, mSelectedChainId, network.coin); + } + return networkListsCopy; + }); } /** @@ -149,6 +154,7 @@ public Mode getMode() { public SelectionMode getSelectionType() { return mSelectionMode; } + private void updateLocalNetwork(List networkInfos, String chainId, int coin) { NetworkInfo networkInfo = NetworkUtils.findNetwork(networkInfos, chainId, coin); if (networkInfo != null) { diff --git a/android/java/org/chromium/chrome/browser/app/domain/PortfolioModel.java b/android/java/org/chromium/chrome/browser/app/domain/PortfolioModel.java index 71b57d9b835a..6bac88937e15 100644 --- a/android/java/org/chromium/chrome/browser/app/domain/PortfolioModel.java +++ b/android/java/org/chromium/chrome/browser/app/domain/PortfolioModel.java @@ -125,23 +125,32 @@ private void fetchNftMetadata(List nftList, List a } else { // Other NFTs. - nftDataModels.add(new NftDataModel(userAsset, - NetworkUtils.findNetwork( - allNetworkList, userAsset.chainId, userAsset.coin), - null)); + nftDataModels.add( + new NftDataModel( + userAsset, + NetworkUtils.findNetwork( + allNetworkList, userAsset.chainId, userAsset.coin), + null)); } } } - nftMetaDataHandler.setWhenAllCompletedAction(() -> { - for (AsyncUtils.BaseGetNftMetadataContext metadata : nftMetadataList) { - nftDataModels.add(new NftDataModel(metadata.asset, - NetworkUtils.findNetwork( - allNetworkList, metadata.asset.chainId, metadata.asset.coin), - new NftMetadata(metadata.tokenMetadata, metadata.errorCode, - metadata.errorMessage))); - } - nftModels.postValue(nftDataModels); - }); + nftMetaDataHandler.setWhenAllCompletedAction( + () -> { + for (AsyncUtils.BaseGetNftMetadataContext metadata : nftMetadataList) { + nftDataModels.add( + new NftDataModel( + metadata.asset, + NetworkUtils.findNetwork( + allNetworkList, + metadata.asset.chainId, + metadata.asset.coin), + new NftMetadata( + metadata.tokenMetadata, + metadata.errorCode, + metadata.errorMessage))); + } + nftModels.postValue(nftDataModels); + }); } public void discoverAssetsOnAllSupportedChains() { diff --git a/android/java/org/chromium/chrome/browser/app/domain/TransactionsModel.java b/android/java/org/chromium/chrome/browser/app/domain/TransactionsModel.java index dc7845d41cc9..b3d313628287 100644 --- a/android/java/org/chromium/chrome/browser/app/domain/TransactionsModel.java +++ b/android/java/org/chromium/chrome/browser/app/domain/TransactionsModel.java @@ -95,110 +95,166 @@ public void update(WeakReference activityRef) { if (JavaUtils.anyNull( mJsonRpcService, mKeyringService, mActivityRef, mActivityRef.get())) return; - NetworkModel.getAllNetworks(mJsonRpcService, mSharedData.getSupportedCryptoCoins(), allNetworks -> { - mAllNetworkInfoList = allNetworks; - mKeyringService.getAllAccounts(allAccounts -> { - mAllAccountInfoList = Arrays.asList(allAccounts.accounts); - var allAccountsArray = allAccounts.accounts; - // Fetch transactions - PendingTxHelper pendingTxHelper = - new PendingTxHelper(mTxService, allAccountsArray, true, null); - pendingTxHelper.fetchTransactions(() -> { - HashMap pendingTxInfos = - pendingTxHelper.getTransactions(); - pendingTxHelper.destroy(); - TransactionInfo[] filteredTransactions = - pendingTxInfos.values() - .stream() - .flatMap( - transactionInfos -> Arrays.stream(transactionInfos)) - .filter(tx -> tx.txStatus != TransactionStatus.REJECTED) - .toArray(TransactionInfo[] ::new); - if (filteredTransactions.length == 0) { - postTxListResponse(Collections.emptyList()); - return; - } - // Fetch tokens, balances, price etc. - List assetAccountsNetworkBalances = - new ArrayList<>(); - AtomicInteger balanceResultCounter = new AtomicInteger(); - List txNetworks = - mAllNetworkInfoList.stream() - .filter(networkInfo - -> Arrays.stream(filteredTransactions) - .anyMatch(transactionInfo - -> transactionInfo.chainId.equals( - networkInfo.chainId))) - .collect(Collectors.toList()); - for (NetworkInfo networkInfo : txNetworks) { - var accountInfoListPerCoin = - mAllAccountInfoList.stream() - .filter(accountInfo - -> accountInfo.accountId.coin - == networkInfo.coin) - .collect(Collectors.toList()); + NetworkModel.getAllNetworks( + mJsonRpcService, + mSharedData.getSupportedCryptoCoins(), + allNetworks -> { + mAllNetworkInfoList = allNetworks; + mKeyringService.getAllAccounts( + allAccounts -> { + mAllAccountInfoList = Arrays.asList(allAccounts.accounts); + var allAccountsArray = allAccounts.accounts; + // Fetch transactions + PendingTxHelper pendingTxHelper = + new PendingTxHelper( + mTxService, allAccountsArray, true, null); + pendingTxHelper.fetchTransactions( + () -> { + HashMap pendingTxInfos = + pendingTxHelper.getTransactions(); + pendingTxHelper.destroy(); + TransactionInfo[] filteredTransactions = + pendingTxInfos.values().stream() + .flatMap( + transactionInfos -> + Arrays.stream( + transactionInfos)) + .filter( + tx -> + tx.txStatus + != TransactionStatus + .REJECTED) + .toArray(TransactionInfo[]::new); + if (filteredTransactions.length == 0) { + postTxListResponse(Collections.emptyList()); + return; + } + // Fetch tokens, balances, price etc. + List + assetAccountsNetworkBalances = + new ArrayList<>(); + AtomicInteger balanceResultCounter = + new AtomicInteger(); + List txNetworks = + mAllNetworkInfoList.stream() + .filter( + networkInfo -> + Arrays.stream( + filteredTransactions) + .anyMatch( + transactionInfo -> + transactionInfo + .chainId + .equals( + networkInfo + .chainId))) + .collect(Collectors.toList()); + for (NetworkInfo networkInfo : txNetworks) { + var accountInfoListPerCoin = + mAllAccountInfoList.stream() + .filter( + accountInfo -> + accountInfo + .accountId + .coin + == networkInfo + .coin) + .collect(Collectors.toList()); - Utils.getTxExtraInfo(mActivityRef, TokenUtils.TokenType.ALL, - mAllNetworkInfoList, networkInfo, - accountInfoListPerCoin.toArray(new AccountInfo[0]), null, false, - (assetPrices, userAssetsList, nativeAssetsBalances, - blockchainTokensBalances) -> { - AssetAccountsNetworkBalance asset = - new AssetAccountsNetworkBalance(assetPrices, - userAssetsList, nativeAssetsBalances, - blockchainTokensBalances, networkInfo, - accountInfoListPerCoin); - assetAccountsNetworkBalances.add(asset); - if (balanceResultCounter.incrementAndGet() - == txNetworks.size()) { - parseTransactions(mActivityRef, - assetAccountsNetworkBalances, - filteredTransactions, networkInfo.coin); - } - }); - } + Utils.getTxExtraInfo( + mActivityRef, + TokenUtils.TokenType.ALL, + mAllNetworkInfoList, + networkInfo, + accountInfoListPerCoin.toArray( + new AccountInfo[0]), + null, + false, + (assetPrices, + userAssetsList, + nativeAssetsBalances, + blockchainTokensBalances) -> { + AssetAccountsNetworkBalance asset = + new AssetAccountsNetworkBalance( + assetPrices, + userAssetsList, + nativeAssetsBalances, + blockchainTokensBalances, + networkInfo, + accountInfoListPerCoin); + assetAccountsNetworkBalances.add( + asset); + if (balanceResultCounter + .incrementAndGet() + == txNetworks.size()) { + parseTransactions( + mActivityRef, + assetAccountsNetworkBalances, + filteredTransactions, + networkInfo.coin); + } + }); + } + }); + }); }); - }); - }); } } - private void parseTransactions(WeakReference activityRef, + private void parseTransactions( + WeakReference activityRef, List assetAccountsNetworkBalances, - TransactionInfo[] transactionInfoArr, int coin) { + TransactionInfo[] transactionInfoArr, + int coin) { // Received balances of all network, can now fetch transaction var allAccountsArray = mAllAccountInfoList.toArray(new AccountInfo[0]); SolanaTransactionsGasHelper solanaTransactionsGasHelper = new SolanaTransactionsGasHelper(activityRef.get(), transactionInfoArr); - solanaTransactionsGasHelper.maybeGetSolanaGasEstimations(() -> { - List walletListItemModelList = new ArrayList<>(); - var perTxSolanaFee = solanaTransactionsGasHelper.getPerTxFee(); - for (TransactionInfo txInfo : transactionInfoArr) { - AccountInfo txAccountInfo = - Utils.findAccount(allAccountsArray, txInfo.fromAccountId); - if (txAccountInfo == null) { - continue; - } - long solanaEstimatedTxFee = 0; - if (perTxSolanaFee.get(txInfo.id) != null) { - solanaEstimatedTxFee = perTxSolanaFee.get(txInfo.id); - } - var txNetwork = NetworkUtils.findNetwork(mAllNetworkInfoList, txInfo.chainId, coin); - var txExtraData = - assetAccountsNetworkBalances.stream() - .filter(data -> data.networkInfo.chainId.equals(txInfo.chainId)) - .findFirst() - .get(); - ParsedTransaction parsedTx = ParsedTransaction.parseTransaction(txInfo, txNetwork, - allAccountsArray, txExtraData.assetPrices, solanaEstimatedTxFee, - txExtraData.userAssetsList, txExtraData.nativeAssetsBalances, - txExtraData.blockchainTokensBalances); - WalletListItemModel itemModel = Utils.makeWalletItem( - activityRef.get(), txInfo, txNetwork, parsedTx, txAccountInfo); - walletListItemModelList.add(itemModel); - } - postTxListResponse(walletListItemModelList); - }); + solanaTransactionsGasHelper.maybeGetSolanaGasEstimations( + () -> { + List walletListItemModelList = new ArrayList<>(); + var perTxSolanaFee = solanaTransactionsGasHelper.getPerTxFee(); + for (TransactionInfo txInfo : transactionInfoArr) { + AccountInfo txAccountInfo = + Utils.findAccount(allAccountsArray, txInfo.fromAccountId); + if (txAccountInfo == null) { + continue; + } + long solanaEstimatedTxFee = 0; + if (perTxSolanaFee.get(txInfo.id) != null) { + solanaEstimatedTxFee = perTxSolanaFee.get(txInfo.id); + } + var txNetwork = + NetworkUtils.findNetwork(mAllNetworkInfoList, txInfo.chainId, coin); + var txExtraData = + assetAccountsNetworkBalances.stream() + .filter( + data -> + data.networkInfo.chainId.equals( + txInfo.chainId)) + .findFirst() + .get(); + ParsedTransaction parsedTx = + ParsedTransaction.parseTransaction( + txInfo, + txNetwork, + allAccountsArray, + txExtraData.assetPrices, + solanaEstimatedTxFee, + txExtraData.userAssetsList, + txExtraData.nativeAssetsBalances, + txExtraData.blockchainTokensBalances); + WalletListItemModel itemModel = + Utils.makeWalletItem( + activityRef.get(), + txInfo, + txNetwork, + parsedTx, + txAccountInfo); + walletListItemModelList.add(itemModel); + } + postTxListResponse(walletListItemModelList); + }); } private void postTxListResponse(List walletListItemModelList) { diff --git a/android/java/org/chromium/chrome/browser/app/domain/UserAssetModel.java b/android/java/org/chromium/chrome/browser/app/domain/UserAssetModel.java index b5da3a0a0897..02026c6caaa0 100644 --- a/android/java/org/chromium/chrome/browser/app/domain/UserAssetModel.java +++ b/android/java/org/chromium/chrome/browser/app/domain/UserAssetModel.java @@ -56,25 +56,34 @@ public void fetchAssets(boolean nftsOnly, NetworkInfo selectedNetwork) { mSelectedNetwork = selectedNetwork; if (JavaUtils.anyNull(mBraveWalletService, mJsonRpcService, mSelectedNetwork)) return; NetworkModel.getAllNetworks( - mJsonRpcService, mSharedData.getSupportedCryptoCoins(), allNetworks -> { + mJsonRpcService, + mSharedData.getSupportedCryptoCoins(), + allNetworks -> { mCryptoNetworks = allNetworks; if (mType == WalletCoinAdapter.AdapterType.EDIT_VISIBLE_ASSETS_LIST) { if (NetworkUtils.isAllNetwork(mSelectedNetwork)) { fetchAllNetworksAssets(nftsOnly); } else { - TokenUtils.getVisibleUserAssetsFiltered(mBraveWalletService, - mSelectedNetwork, mSelectedNetwork.coin, + TokenUtils.getVisibleUserAssetsFiltered( + mBraveWalletService, + mSelectedNetwork, + mSelectedNetwork.coin, TokenUtils.TokenType.ALL, - userAssets - -> TokenUtils.getAllTokensFiltered(mBraveWalletService, - mBlockchainRegistry, mSelectedNetwork, - nftsOnly ? TokenUtils.TokenType.NFTS - : TokenUtils.TokenType.NON_NFTS, - tokens -> { - _mAssetsResult.postValue( - new AssetsResult(Arrays.asList(tokens), - Arrays.asList(userAssets))); - })); + userAssets -> + TokenUtils.getAllTokensFiltered( + mBraveWalletService, + mBlockchainRegistry, + mSelectedNetwork, + nftsOnly + ? TokenUtils.TokenType.NFTS + : TokenUtils.TokenType.NON_NFTS, + tokens -> { + _mAssetsResult.postValue( + new AssetsResult( + Arrays.asList(tokens), + Arrays.asList( + userAssets))); + })); } } }); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/ApproveTxBottomSheetDialogFragment.java b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/ApproveTxBottomSheetDialogFragment.java index 885f8ff1ab99..8fd365e70da6 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/ApproveTxBottomSheetDialogFragment.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/ApproveTxBottomSheetDialogFragment.java @@ -272,8 +272,9 @@ public void setupDialog(@NonNull Dialog dialog, int style) { networkName.setText(mTxNetwork.chainName); keyringService.getAllAccounts( allAccounts -> { - AccountInfo[] accounts = AssetUtils.filterAccountsByNetwork( - allAccounts.accounts, mTxNetwork.coin, mTxNetwork.chainId); + AccountInfo[] accounts = + AssetUtils.filterAccountsByNetwork( + allAccounts.accounts, mTxNetwork.coin, mTxNetwork.chainId); AccountInfo txAccountInfo = Utils.findAccount(accounts, mTxInfo.fromAccountId); if (txAccountInfo == null) { @@ -285,42 +286,58 @@ public void setupDialog(@NonNull Dialog dialog, int style) { mExecutor, mHandler, icon, txAccountInfo, true); // First fill in data that does not require remote queries - TokenUtils.getAllTokensFiltered(getBraveWalletService(), - getBlockchainRegistry(), mTxNetwork, TokenUtils.TokenType.ALL, + TokenUtils.getAllTokensFiltered( + getBraveWalletService(), + getBlockchainRegistry(), + mTxNetwork, + TokenUtils.TokenType.ALL, tokenList -> { SolanaTransactionsGasHelper solanaTransactionsGasHelper = new SolanaTransactionsGasHelper( (BraveWalletBaseActivity) getActivity(), new TransactionInfo[] {mTxInfo}); - solanaTransactionsGasHelper.maybeGetSolanaGasEstimations(() -> { - HashMap perTxFee = - solanaTransactionsGasHelper.getPerTxFee(); - if (perTxFee.get(mTxInfo.id) != null) { - mSolanaEstimatedTxFee = perTxFee.get(mTxInfo.id); - } - if (!canUpdateUi()) return; - ParsedTransaction parsedTx = fillAssetDependentControls(view, - mTxNetwork, txAccountInfo, accounts, - new HashMap(), tokenList, - new HashMap(), - new HashMap>(), - mSolanaEstimatedTxFee); - - // Get tokens involved in this transaction - List tokens = new ArrayList<>(); - tokens.add(Utils.makeNetworkAsset( - mTxNetwork)); // Always add native asset - if (parsedTx.getIsSwap()) { - tokens.add(parsedTx.getSellToken()); - tokens.add(parsedTx.getBuyToken()); - } else if (parsedTx.getToken() != null) - tokens.add(parsedTx.getToken()); - BlockchainToken[] filterByTokens = - tokens.toArray(new BlockchainToken[0]); - - fetchTxBalanceAndUpdateUi(view, mTxNetwork, txAccountInfo, - accounts, filterByTokens); - }); + solanaTransactionsGasHelper.maybeGetSolanaGasEstimations( + () -> { + HashMap perTxFee = + solanaTransactionsGasHelper.getPerTxFee(); + if (perTxFee.get(mTxInfo.id) != null) { + mSolanaEstimatedTxFee = perTxFee.get(mTxInfo.id); + } + if (!canUpdateUi()) return; + ParsedTransaction parsedTx = + fillAssetDependentControls( + view, + mTxNetwork, + txAccountInfo, + accounts, + new HashMap(), + tokenList, + new HashMap(), + new HashMap< + String, + HashMap>(), + mSolanaEstimatedTxFee); + + // Get tokens involved in this transaction + List tokens = new ArrayList<>(); + tokens.add( + Utils.makeNetworkAsset( + mTxNetwork)); // Always add native asset + if (parsedTx.getIsSwap()) { + tokens.add(parsedTx.getSellToken()); + tokens.add(parsedTx.getBuyToken()); + } else if (parsedTx.getToken() != null) + tokens.add(parsedTx.getToken()); + BlockchainToken[] filterByTokens = + tokens.toArray(new BlockchainToken[0]); + + fetchTxBalanceAndUpdateUi( + view, + mTxNetwork, + txAccountInfo, + accounts, + filterByTokens); + }); }); }); Button reject = view.findViewById(R.id.reject); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/EditVisibleAssetsBottomSheetDialogFragment.java b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/EditVisibleAssetsBottomSheetDialogFragment.java index 97984bfe563b..2b6d1765c5af 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/EditVisibleAssetsBottomSheetDialogFragment.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/EditVisibleAssetsBottomSheetDialogFragment.java @@ -314,47 +314,54 @@ public void onAttach(@NonNull Context context) { // Pass @{code ActivityResultRegistry} reference explicitly to avoid crash // https://github.com/brave/brave-browser/issues/31882 - mAddAssetActivityResultLauncher = registerForActivityResult( - new ActivityResultContracts.StartActivityForResult(), - ((BraveWalletBaseActivity) requireActivity()).getActivityResultRegistry(), - result -> { - if (result.getResultCode() == Activity.RESULT_OK) { - Intent intent = result.getData(); - if (intent == null) { - return; - } - final BlockchainToken token = - WalletUtils.getBlockchainTokenFromIntent(intent); - final NetworkInfo networkInfo = - WalletUtils.getNetworkInfoFromIntent(intent); - if (token == null || networkInfo == null) { - return; - } - - boolean isDuplicateToken = false; - for (WalletListItemModel item : mWalletCoinAdapter.getCheckedAssets()) { - // We can have multiple ERC721 or Solana NFTs with the same name - if (!item.isNft() - && (item.getTitle().equals(token.name) - || item.getSubTitle().equals(token.symbol))) { - isDuplicateToken = true; - break; + mAddAssetActivityResultLauncher = + registerForActivityResult( + new ActivityResultContracts.StartActivityForResult(), + ((BraveWalletBaseActivity) requireActivity()).getActivityResultRegistry(), + result -> { + if (result.getResultCode() == Activity.RESULT_OK) { + Intent intent = result.getData(); + if (intent == null) { + return; + } + final BlockchainToken token = + WalletUtils.getBlockchainTokenFromIntent(intent); + final NetworkInfo networkInfo = + WalletUtils.getNetworkInfoFromIntent(intent); + if (token == null || networkInfo == null) { + return; + } + + boolean isDuplicateToken = false; + for (WalletListItemModel item : + mWalletCoinAdapter.getCheckedAssets()) { + // We can have multiple ERC721 or Solana NFTs with the same name + if (!item.isNft() + && (item.getTitle().equals(token.name) + || item.getSubTitle().equals(token.symbol))) { + isDuplicateToken = true; + break; + } + } + if (!isDuplicateToken) { + WalletListItemModel itemModel = + new WalletListItemModel( + R.drawable.ic_eth, + token.name, + token.symbol, + token.tokenId, + "", + ""); + itemModel.setBlockchainToken(token); + itemModel.setIconPath(token.logo); + itemModel.setAssetNetwork(networkInfo); + + itemModel.isVisible(true); + mWalletCoinAdapter.addItem(itemModel); + mIsAssetsListChanged = true; + } } - } - if (!isDuplicateToken) { - WalletListItemModel itemModel = - new WalletListItemModel(R.drawable.ic_eth, token.name, - token.symbol, token.tokenId, "", ""); - itemModel.setBlockchainToken(token); - itemModel.setIconPath(token.logo); - itemModel.setAssetNetwork(networkInfo); - - itemModel.isVisible(true); - mWalletCoinAdapter.addItem(itemModel); - mIsAssetsListChanged = true; - } - } - }); + }); } private void showAddAssetActivity() { @@ -380,15 +387,20 @@ private void setUpAssetsList( NetworkInfo assetNetwork = NetworkUtils.findNetwork(mCryptoNetworks, token.chainId, token.coin); if (assetNetwork == null) { - Log.e(TAG, - String.format("Asset network for token with chain Id %s was null.", + Log.e( + TAG, + String.format( + "Asset network for token with chain Id %s was null.", token.chainId)); continue; } - String subtitle = !isEditVisibleAssetType - ? token.symbol - : getString(R.string.brave_wallet_portfolio_asset_network_description, - token.symbol, assetNetwork.chainName); + String subtitle = + !isEditVisibleAssetType + ? token.symbol + : getString( + R.string.brave_wallet_portfolio_asset_network_description, + token.symbol, + assetNetwork.chainName); WalletListItemModel itemModel = new WalletListItemModel( Utils.getCoinIcon(token.coin), token.name, subtitle, token.tokenId, "", ""); @@ -516,13 +528,18 @@ public void onAssetCheckedChanged( return; } - TokenUtils.isCustomToken(blockchainRegistry, walletListItemModel.getAssetNetwork(), - walletListItemModel.getBlockchainToken().coin, thisToken, isCustom -> { + TokenUtils.isCustomToken( + blockchainRegistry, + walletListItemModel.getAssetNetwork(), + walletListItemModel.getBlockchainToken().coin, + thisToken, + isCustom -> { // Only show add asset dialog on click when: // 1. It is an ERC721 token // 2. It is a token listed in Registry // 3. It is not user added (i.e. doesn't have a token id) - if (thisToken.isErc721 && !isCustom + if (thisToken.isErc721 + && !isCustom && (thisToken.tokenId == null || thisToken.tokenId.trim().isEmpty())) { showAddAssetActivity(); walletListItemModel.isVisible( @@ -531,23 +548,31 @@ public void onAssetCheckedChanged( } else { if (!isCustom) { if (isChecked) { - braveWalletService.addUserAsset(thisToken, (success) -> { - if (success) { - walletListItemModel.isVisible(true); - } - itemCheckboxConsistency(walletListItemModel, assetCheck, true); - }); + braveWalletService.addUserAsset( + thisToken, + (success) -> { + if (success) { + walletListItemModel.isVisible(true); + } + itemCheckboxConsistency( + walletListItemModel, assetCheck, true); + }); } else { - braveWalletService.removeUserAsset(thisToken, (success) -> { - if (success) { - walletListItemModel.isVisible(false); - } - itemCheckboxConsistency(walletListItemModel, assetCheck, false); - }); + braveWalletService.removeUserAsset( + thisToken, + (success) -> { + if (success) { + walletListItemModel.isVisible(false); + } + itemCheckboxConsistency( + walletListItemModel, assetCheck, false); + }); } } else { braveWalletService.setUserAssetVisible( - thisToken, isChecked, success -> { + thisToken, + isChecked, + success -> { if (success) { walletListItemModel.isVisible(isChecked); } diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/BalanceHelper.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/BalanceHelper.java index 501dddea973e..90d2e9a7869a 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/BalanceHelper.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/BalanceHelper.java @@ -251,33 +251,48 @@ private static void processP3ACoinNetworks(@CoinType.EnumType int coinType, blockchainTokensBalancesResponses) { if (JavaUtils.anyNull(braveWalletService, blockchainRegistry)) return; - keyringService.getAllAccounts(allAccounts -> { - for (NetworkInfo network : networks) { - AccountInfo[] accountInfoArray = AssetUtils.filterAccountsByNetwork( - allAccounts.accounts, network.coin, network.chainId); + keyringService.getAllAccounts( + allAccounts -> { + for (NetworkInfo network : networks) { + AccountInfo[] accountInfoArray = + AssetUtils.filterAccountsByNetwork( + allAccounts.accounts, network.coin, network.chainId); - TokenUtils.getVisibleUserAssetsFiltered( - braveWalletService, network, coinType, TokenUtils.TokenType.ALL, tokens -> { - // Assets balances. - GetNativeAssetsBalancesResponseContext getNativeAssetsBalancesContext = - new GetNativeAssetsBalancesResponseContext( - multiResponse.singleResponseComplete); - getNativeAssetsBalances(jsonRpcService, network, accountInfoArray, - getNativeAssetsBalancesContext); - nativeAssetsBalancesResponses.add(getNativeAssetsBalancesContext); + TokenUtils.getVisibleUserAssetsFiltered( + braveWalletService, + network, + coinType, + TokenUtils.TokenType.ALL, + tokens -> { + // Assets balances. + GetNativeAssetsBalancesResponseContext + getNativeAssetsBalancesContext = + new GetNativeAssetsBalancesResponseContext( + multiResponse.singleResponseComplete); + getNativeAssetsBalances( + jsonRpcService, + network, + accountInfoArray, + getNativeAssetsBalancesContext); + nativeAssetsBalancesResponses.add( + getNativeAssetsBalancesContext); - // Tokens balances. - GetBlockchainTokensBalancesResponseContext - getBlockchainTokensBalancesContext = - new GetBlockchainTokensBalancesResponseContext( - multiResponse.singleResponseComplete); - getBlockchainTokensBalances(jsonRpcService, network, accountInfoArray, - tokens, getBlockchainTokensBalancesContext); - blockchainTokensBalancesResponses.add( - getBlockchainTokensBalancesContext); - }); - } - }); + // Tokens balances. + GetBlockchainTokensBalancesResponseContext + getBlockchainTokensBalancesContext = + new GetBlockchainTokensBalancesResponseContext( + multiResponse.singleResponseComplete); + getBlockchainTokensBalances( + jsonRpcService, + network, + accountInfoArray, + tokens, + getBlockchainTokensBalancesContext); + blockchainTokensBalancesResponses.add( + getBlockchainTokensBalancesContext); + }); + } + }); } private static T addBalanceResponseContext( diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java index 6163e85d6577..dfbcd5fb5373 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java @@ -93,6 +93,7 @@ public static List nonTestNetwork(List networkInfos) { /** * Gets the network info object of given chainId and symbol. + * * @param networks All networks available. * @param chainId Chain Id of the network to be found. * @param coin Coin type of the network to be found. @@ -104,7 +105,8 @@ public static NetworkInfo findNetwork( if (networks.isEmpty() || TextUtils.isEmpty(chainId)) { return null; } - return JavaUtils.find(networks, + return JavaUtils.find( + networks, networkInfo -> networkInfo.chainId.equals(chainId) && networkInfo.coin == coin); } 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 b212f8107d06..1ed0ab48a8ef 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,44 +72,52 @@ public enum TokenType { private static BlockchainToken[] filterTokens(NetworkInfo selectedNetwork, BlockchainToken[] tokens, TokenType tokenType, boolean keepVisibleOnly) { BlockchainToken nativeAsset = Utils.makeNetworkAsset(selectedNetwork); - Stream tokenStream = Arrays.stream(tokens).filter(token -> { - final boolean typeFilter; - switch (tokenType) { - case NFTS: - typeFilter = token.isNft; - break; - case ERC20: - typeFilter = token.isErc20; - break; - case ERC721: - typeFilter = token.isErc721; - break; - case SOL: - typeFilter = token.coin == CoinType.SOL; - break; - case NON_NFTS: - typeFilter = !token.isNft; - break; - case ALL: - typeFilter = true; - break; - default: - throw new UnsupportedOperationException("Token type not supported."); - } - return typeFilter && !isSameToken(token, nativeAsset) - && (!keepVisibleOnly || token.visible); - }); + Stream tokenStream = + Arrays.stream(tokens) + .filter( + token -> { + final boolean typeFilter; + switch (tokenType) { + case NFTS: + typeFilter = token.isNft; + break; + case ERC20: + typeFilter = token.isErc20; + break; + case ERC721: + typeFilter = token.isErc721; + break; + case SOL: + typeFilter = token.coin == CoinType.SOL; + break; + case NON_NFTS: + typeFilter = !token.isNft; + break; + case ALL: + typeFilter = true; + break; + default: + throw new UnsupportedOperationException( + "Token type not supported."); + } + return typeFilter + && !isSameToken(token, nativeAsset) + && (!keepVisibleOnly || token.visible); + }); // When token type is NFTS the native assets should not be added. // For all the other cases we add them. if (tokenType != TokenType.NFTS) { tokenStream = Stream.concat(Stream.of(nativeAsset), tokenStream); } - return tokenStream.toArray(BlockchainToken[] ::new); + return tokenStream.toArray(BlockchainToken[]::new); } - public static void getVisibleUserAssetsFiltered(BraveWalletService braveWalletService, - NetworkInfo selectedNetwork, int coinType, TokenType tokenType, + public static void getVisibleUserAssetsFiltered( + BraveWalletService braveWalletService, + NetworkInfo selectedNetwork, + int coinType, + TokenType tokenType, Callbacks.Callback1 callback) { braveWalletService.getUserAssets( selectedNetwork.chainId, coinType, (BlockchainToken[] tokens) -> { @@ -126,22 +134,30 @@ public static void getVisibleUserAssetsFiltered(BraveWalletService braveWalletSe * Note:: all calls to {@link BlockchainRegistry#getAllTokens} should be intercepted by * this method. */ - public static void getAllTokens(@NonNull BlockchainRegistry blockchainRegistry, String chainId, - int coinType, Callbacks.Callback1 callback) { - blockchainRegistry.getAllTokens(chainId, coinType, + public static void getAllTokens( + @NonNull BlockchainRegistry blockchainRegistry, + String chainId, + int coinType, + Callbacks.Callback1 callback) { + blockchainRegistry.getAllTokens( + chainId, + coinType, tokens -> callback.call(Utils.fixupTokensRegistry(tokens, chainId))); } /** * Gets all tokens from each network and filters out tokens different from a given type. + * * @param blockchainRegistry BraveChainRegistry to retrieve all tokens from core. * @param networks Network list whose tokens will get retrieved and filtered. * @param tokenType Token type used for filtering. * @param callback Callback containing a filtered array of tokens for each network. - * Note:: It does not add user assets. + * Note:: It does not add user assets. */ - public static void getAllTokensFiltered(BlockchainRegistry blockchainRegistry, - List networks, TokenType tokenType, + public static void getAllTokensFiltered( + BlockchainRegistry blockchainRegistry, + List networks, + TokenType tokenType, Callbacks.Callback1 callback) { AsyncUtils.MultiResponseHandler allNetworkTokenCollector = new AsyncUtils.MultiResponseHandler(networks.size()); @@ -155,36 +171,54 @@ public static void getAllTokensFiltered(BlockchainRegistry blockchainRegistry, allTokenContexts.add(context); } allNetworkTokenCollector.setWhenAllCompletedAction( - () - -> callback.call(allTokenContexts.stream() - .map(context - -> filterTokens(context.networkInfo, - context.tokens, tokenType, false)) - .flatMap(Arrays::stream) - .toArray(BlockchainToken[] ::new))); + () -> + callback.call( + allTokenContexts.stream() + .map( + context -> + filterTokens( + context.networkInfo, + context.tokens, + tokenType, + false)) + .flatMap(Arrays::stream) + .toArray(BlockchainToken[]::new))); } /** * Gets all tokens from a given single network, includes user assets and filters out tokens * different from a given type. + * * @param braveWalletService BraveWalletService to retrieve user asset from core. * @param blockchainRegistry BraveChainRegistry to retrieve all tokens from core. * @param selectedNetwork Selected network whose tokens will be retrieved. * @param tokenType Token type used for filtering. * @param callback Callback containing a filtered array of tokens for the given network. */ - public static void getAllTokensFiltered(BraveWalletService braveWalletService, - BlockchainRegistry blockchainRegistry, NetworkInfo selectedNetwork, TokenType tokenType, + public static void getAllTokensFiltered( + BraveWalletService braveWalletService, + BlockchainRegistry blockchainRegistry, + NetworkInfo selectedNetwork, + TokenType tokenType, Callbacks.Callback1 callback) { - getAllTokens(blockchainRegistry, selectedNetwork.chainId, selectedNetwork.coin, - tokens - -> braveWalletService.getUserAssets( - selectedNetwork.chainId, selectedNetwork.coin, userTokens -> { - BlockchainToken[] filteredTokens = filterTokens(selectedNetwork, - distinctiveConcatenatedArrays(tokens, userTokens), tokenType, - false); - callback.call(filteredTokens); - })); + getAllTokens( + blockchainRegistry, + selectedNetwork.chainId, + selectedNetwork.coin, + tokens -> + braveWalletService.getUserAssets( + selectedNetwork.chainId, + selectedNetwork.coin, + userTokens -> { + BlockchainToken[] filteredTokens = + filterTokens( + selectedNetwork, + distinctiveConcatenatedArrays( + tokens, userTokens), + tokenType, + false); + callback.call(filteredTokens); + })); } /** @@ -231,8 +265,10 @@ public static void getUserOrAllTokensFiltered(BraveWalletService braveWalletServ private static final int[] SUPPORTED_RAMP_PROVIDERS = { OnRampProvider.RAMP, OnRampProvider.SARDINE, OnRampProvider.TRANSAK}; - public static void getBuyTokensFiltered(BlockchainRegistry blockchainRegistry, - NetworkInfo selectedNetwork, Callbacks.Callback1 callback) { + public static void getBuyTokensFiltered( + BlockchainRegistry blockchainRegistry, + NetworkInfo selectedNetwork, + Callbacks.Callback1 callback) { int[] rampProviders = SUPPORTED_RAMP_PROVIDERS; blockchainRegistry.getProvidersBuyTokens(rampProviders, selectedNetwork.chainId, tokens -> { // blockchainRegistry.getProvidersBuyTokens returns a full list of tokens that are @@ -253,16 +289,26 @@ public static void isBuySupported(BlockchainRegistry blockchainRegistry, NetworkInfo selectedNetwork, String assetSymbol, String contractAddress, String chainId, Callback1 callback) { getBuyTokensFiltered( - blockchainRegistry, selectedNetwork, tokens -> { - callback.call(JavaUtils.includes(tokens, - iToken - -> AssetUtils.Filters.isSameToken( - iToken, assetSymbol, contractAddress, chainId))); + blockchainRegistry, + selectedNetwork, + tokens -> { + callback.call( + JavaUtils.includes( + tokens, + iToken -> + AssetUtils.Filters.isSameToken( + iToken, + assetSymbol, + contractAddress, + chainId))); }); } - public static void isCustomToken(@NonNull BlockchainRegistry blockchainRegistry, - @NonNull NetworkInfo selectedNetwork, int coinType, @NonNull BlockchainToken token, + public static void isCustomToken( + @NonNull BlockchainRegistry blockchainRegistry, + @NonNull NetworkInfo selectedNetwork, + int coinType, + @NonNull BlockchainToken token, Callbacks.Callback1 callback) { assert !JavaUtils.anyNull(token, selectedNetwork) : "Token or network should not be null"; if (JavaUtils.anyNull(token, selectedNetwork)) return; @@ -291,9 +337,10 @@ public static void isCustomToken(@NonNull BlockchainRegistry blockchainRegistry, /** * Concatenates arrays, add only elements of arraySecond that are not present in the arrayFirst + * * @param arrayFirst first array to be added in the result * @param arraySecond second array, only distinctive elements are added in result by comparing - * with the items of arrayFirst + * with the items of arrayFirst * @return concatenated array */ public static BlockchainToken[] distinctiveConcatenatedArrays( @@ -318,11 +365,8 @@ public static BlockchainToken[] distinctiveConcatenatedArrays( } /** - * Checks if two tokens are equal. Two tokens are equal if: - * - Chain ID matches. - * - Symbol matches. - * - Token ID matches. - * - Contract address (ignore case) matches. + * Checks if two tokens are equal. Two tokens are equal if: - Chain ID matches. - Symbol + * matches. - Token ID matches. - Contract address (ignore case) matches. * * @param token1 First token to compare. * @param token2 Second token to compare. @@ -330,7 +374,8 @@ public static BlockchainToken[] distinctiveConcatenatedArrays( */ public static boolean isSameToken( @NonNull BlockchainToken token1, @NonNull BlockchainToken token2) { - return token1.chainId.equals(token2.chainId) && token1.symbol.equals(token2.symbol) + return token1.chainId.equals(token2.chainId) + && token1.symbol.equals(token2.symbol) && token1.tokenId.equals(token2.tokenId) && token1.contractAddress.equalsIgnoreCase(token2.contractAddress); } @@ -340,7 +385,11 @@ public static void getExactUserAsset(BraveWalletService braveWalletService, String assetId, String contractAddress, int assetDecimals, Callback callback) { getVisibleUserAssetsFiltered( - braveWalletService, selectedNetwork, coinType, TokenType.ALL, userAssets -> { + braveWalletService, + selectedNetwork, + coinType, + TokenType.ALL, + userAssets -> { BlockchainToken resultToken = null; for (BlockchainToken userAsset : userAssets) { if (selectedNetwork.chainId.equals(userAsset.chainId) @@ -359,21 +408,16 @@ public static void getExactUserAsset(BraveWalletService braveWalletService, private static final Comparator blockchainTokenComparatorPerGasOrBatType = (token1, token2) -> { - boolean isNativeToken1 = AssetUtils.isNativeToken(token1); - boolean isNativeToken2 = AssetUtils.isNativeToken(token2); - boolean isBatToken1 = AssetUtils.isBatToken(token1); - boolean isBatToken2 = AssetUtils.isBatToken(token2); - if (isNativeToken1 && !isNativeToken2) - return -1; - else if (!isNativeToken1 && isNativeToken2) - return 1; - else if (isBatToken1 && !isBatToken2) - return -1; - else if (!isBatToken1 && isBatToken2) - return 1; - else - return token1.symbol.compareTo(token2.symbol); - }; + boolean isNativeToken1 = AssetUtils.isNativeToken(token1); + boolean isNativeToken2 = AssetUtils.isNativeToken(token2); + boolean isBatToken1 = AssetUtils.isBatToken(token1); + boolean isBatToken2 = AssetUtils.isBatToken(token2); + if (isNativeToken1 && !isNativeToken2) return -1; + else if (!isNativeToken1 && isNativeToken2) return 1; + else if (isBatToken1 && !isBatToken2) return -1; + else if (!isBatToken1 && isBatToken2) return 1; + else return token1.symbol.compareTo(token2.symbol); + }; // Returns an array of available assets per ramp provider and removes duplicates with the // same contract address using case insensitive contractAddress comparison. 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 aeaa34002c40..e314b82f9386 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 @@ -1233,9 +1233,11 @@ private static void workWithTransactions(BraveWalletBaseActivity activity, continue; } - var txNetwork = JavaUtils.safeVal( - NetworkUtils.findNetwork(allNetworks, txInfo.chainId, selectedNetwork.coin), - selectedNetwork); + var txNetwork = + JavaUtils.safeVal( + NetworkUtils.findNetwork( + allNetworks, txInfo.chainId, selectedNetwork.coin), + selectedNetwork); ParsedTransaction parsedTx = ParsedTransaction.parseTransaction(txInfo, txNetwork, accounts, assetPrices, solanaEstimatedTxFee, fullTokenList, nativeAssetsBalances, blockchainTokensBalances); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Validations.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Validations.java index b070ed03b7e2..a56102e06601 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Validations.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Validations.java @@ -92,8 +92,12 @@ public void validate(NetworkInfo selectedNetwork, KeyringService keyringService, assert blockchainRegistry != null; assert selectedNetwork != null; - TokenUtils.getAllTokensFiltered(braveWalletService, blockchainRegistry, - selectedNetwork, TokenUtils.TokenType.ALL, (tokens) -> { + TokenUtils.getAllTokensFiltered( + braveWalletService, + blockchainRegistry, + selectedNetwork, + TokenUtils.TokenType.ALL, + (tokens) -> { fillKnowContracts(tokens); checkForKnowContracts( receiverAccountAddressLower, callback, resources); diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java index 3928623d6ec6..76ba5ea94ff4 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java @@ -8,6 +8,7 @@ import android.app.Activity; import android.view.LayoutInflater; +import org.chromium.base.jank_tracker.JankTracker; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; @@ -38,6 +39,8 @@ import org.chromium.ui.base.WindowAndroid; public class BraveNewTabPage extends NewTabPage { + private JankTracker mJankTracker; + // To delete in bytecode, members from parent class will be used instead. private BrowserControlsStateProvider mBrowserControlsStateProvider; private NewTabPageLayout mNewTabPageLayout; @@ -46,21 +49,50 @@ public class BraveNewTabPage extends NewTabPage { private TabModelSelector mTabModelSelector; private BottomSheetController mBottomSheetController; - public BraveNewTabPage(Activity activity, + public BraveNewTabPage( + Activity activity, BrowserControlsStateProvider browserControlsStateProvider, - Supplier activityTabProvider, SnackbarManager snackbarManager, - ActivityLifecycleDispatcher lifecycleDispatcher, TabModelSelector tabModelSelector, - boolean isTablet, NewTabPageUma uma, boolean isInNightMode, - NativePageHost nativePageHost, Tab tab, String url, + Supplier activityTabProvider, + SnackbarManager snackbarManager, + ActivityLifecycleDispatcher lifecycleDispatcher, + TabModelSelector tabModelSelector, + boolean isTablet, + NewTabPageUma uma, + boolean isInNightMode, + NativePageHost nativePageHost, + Tab tab, + String url, BottomSheetController bottomSheetController, - Supplier shareDelegateSupplier, WindowAndroid windowAndroid, - Supplier toolbarSupplier, SettingsLauncher settingsLauncher, + Supplier shareDelegateSupplier, + WindowAndroid windowAndroid, + JankTracker jankTracker, + Supplier toolbarSupplier, + SettingsLauncher settingsLauncher, HomeSurfaceTracker homeSurfaceTracker, ObservableSupplier tabContentManagerSupplier) { - super(activity, browserControlsStateProvider, activityTabProvider, snackbarManager, - lifecycleDispatcher, tabModelSelector, isTablet, uma, isInNightMode, nativePageHost, - tab, url, bottomSheetController, shareDelegateSupplier, windowAndroid, - toolbarSupplier, settingsLauncher, homeSurfaceTracker, tabContentManagerSupplier); + super( + activity, + browserControlsStateProvider, + activityTabProvider, + snackbarManager, + lifecycleDispatcher, + tabModelSelector, + isTablet, + uma, + isInNightMode, + nativePageHost, + tab, + url, + bottomSheetController, + shareDelegateSupplier, + windowAndroid, + jankTracker, + toolbarSupplier, + settingsLauncher, + homeSurfaceTracker, + tabContentManagerSupplier); + + mJankTracker = jankTracker; assert mNewTabPageLayout instanceof BraveNewTabPageLayout; if (mNewTabPageLayout instanceof BraveNewTabPageLayout) { @@ -96,19 +128,33 @@ protected void initializeMainView(Activity activity, WindowAndroid windowAndroid mNewTabPageLayout = (NewTabPageLayout) inflater.inflate(R.layout.new_tab_page_layout, null); assert !FeedFeatures.isFeedEnabled(); - FeedSurfaceCoordinator feedSurfaceCoordinator = new BraveFeedSurfaceCoordinator(activity, - snackbarManager, windowAndroid, - new SnapScrollHelperImpl(mNewTabPageManager, mNewTabPageLayout), mNewTabPageLayout, - mBrowserControlsStateProvider.getTopControlsHeight(), isInNightMode, this, profile, - /* isPlaceholderShownInitially= */ false, mBottomSheetController, - shareDelegateSupplier, /* externalScrollableContainerDelegate= */ null, - NewTabPageUtils.decodeOriginFromNtpUrl(url), - PrivacyPreferencesManagerImpl.getInstance(), mToolbarSupplier, - SurfaceType.NEW_TAB_PAGE, mConstructedTimeNs, - FeedSwipeRefreshLayout.create(activity, R.id.toolbar_container), - /* overScrollDisabled= */ false, /* viewportView= */ null, - /* actionDelegate= */ null, HelpAndFeedbackLauncherImpl.getForProfile(profile), - mTabModelSelector); + FeedSurfaceCoordinator feedSurfaceCoordinator = + new BraveFeedSurfaceCoordinator( + activity, + snackbarManager, + windowAndroid, + mJankTracker, + new SnapScrollHelperImpl(mNewTabPageManager, mNewTabPageLayout), + mNewTabPageLayout, + mBrowserControlsStateProvider.getTopControlsHeight(), + isInNightMode, + this, + profile, + /* isPlaceholderShownInitially= */ false, + mBottomSheetController, + shareDelegateSupplier, + /* externalScrollableContainerDelegate= */ null, + NewTabPageUtils.decodeOriginFromNtpUrl(url), + PrivacyPreferencesManagerImpl.getInstance(), + mToolbarSupplier, + SurfaceType.NEW_TAB_PAGE, + mConstructedTimeNs, + FeedSwipeRefreshLayout.create(activity, R.id.toolbar_container), + /* overScrollDisabled= */ false, + /* viewportView= */ null, + /* actionDelegate= */ null, + HelpAndFeedbackLauncherImpl.getForProfile(profile), + mTabModelSelector); mFeedSurfaceProvider = feedSurfaceCoordinator; } diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java index 8d78b5efce86..2838896af59a 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java @@ -92,7 +92,6 @@ import org.chromium.chrome.browser.onboarding.OnboardingPrefManager; import org.chromium.chrome.browser.preferences.BravePref; import org.chromium.chrome.browser.preferences.BravePrefServiceBridge; -import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.query_tiles.BraveQueryTileSection; import org.chromium.chrome.browser.rate.RateUtils; @@ -127,9 +126,6 @@ public class BraveNewTabPageLayout private static final String TAG = "BraveNewTabPage"; private static final int MINIMUM_VISIBLE_HEIGHT_THRESHOLD = 50; - private static final String BRAVE_RECYCLERVIEW_POSITION = "recyclerview_visible_position_"; - private static final String BRAVE_RECYCLERVIEW_OFFSET_POSITION = - "recyclerview_offset_position_"; // To delete in bytecode, parent variable will be used instead. private ViewGroup mMvTilesContainerLayout; @@ -181,7 +177,7 @@ public class BraveNewTabPageLayout private int mNewsSessionCardViews; private FeedItemsCard mVisibleCard; private String mFeedHash; - private SharedPreferencesManager.Observer mPreferenceObserver; + private SharedPreferences.OnSharedPreferenceChangeListener mPreferenceListener; private boolean mComesFromNewTab; private boolean mIsTopSitesEnabled; private boolean mIsBraveStatsEnabled; @@ -322,8 +318,9 @@ protected void onAttachedToWindow() { mIsDisplayNews = BraveNewsUtils.shouldDisplayNews(); initPreferenceObserver(); - if (mPreferenceObserver != null) { - SharedPreferencesManager.getInstance().addObserver(mPreferenceObserver); + if (mPreferenceListener != null) { + ContextUtils.getAppSharedPreferences() + .registerOnSharedPreferenceChangeListener(mPreferenceListener); } setNtpViews(); } @@ -422,13 +419,24 @@ private void setNtpRecyclerView(LinearLayoutManager linearLayoutManager) { boolean isFromNewTab = BraveActivity.getBraveActivity().isComesFromNewTab(); Tab tab = BraveActivity.getBraveActivity().getActivityTab(); - int offsetPosition = (tab != null) ? SharedPreferencesManager.getInstance().readInt( - BRAVE_RECYCLERVIEW_OFFSET_POSITION + tab.getId(), 0) - : 0; - - int itemPosition = (tab != null) ? SharedPreferencesManager.getInstance().readInt( - BRAVE_RECYCLERVIEW_POSITION + tab.getId(), 0) - : 0; + int offsetPosition = + (tab != null) + ? ContextUtils.getAppSharedPreferences() + .getInt( + BravePreferenceKeys + .BRAVE_RECYCLERVIEW_OFFSET_POSITION + + tab.getId(), + 0) + : 0; + + int itemPosition = + (tab != null) + ? ContextUtils.getAppSharedPreferences() + .getInt( + BravePreferenceKeys.BRAVE_RECYCLERVIEW_POSITION + + tab.getId(), + 0) + : 0; if (offsetPosition == 0 && itemPosition == 0) { isFeedLoaded = false; @@ -449,307 +457,382 @@ private void setNtpRecyclerView(LinearLayoutManager linearLayoutManager) { } mPrevVisibleNewsCardPosition = firstNewsFeedPosition() - 1; - mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { - @Override - public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) { - super.onScrollStateChanged(recyclerView, newState); - - int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition(); - - int newsFeedPosition = firstNewsFeedPosition(); - - if (newState == RecyclerView.SCROLL_STATE_IDLE) { - try { - if (BraveActivity.getBraveActivity().getActivityTab() != null - && mRecyclerView.getChildCount() > 0) { - View firstChild = mRecyclerView.getChildAt(0); - if (firstChild != null) { - int firstVisiblePosition = - mRecyclerView.getChildAdapterPosition(firstChild); - int verticalOffset = firstChild.getTop(); - - SharedPreferencesManager.getInstance().writeInt( - BRAVE_RECYCLERVIEW_OFFSET_POSITION - + BraveActivity.getBraveActivity() - .getActivityTab() - .getId(), - verticalOffset); - - SharedPreferencesManager.getInstance().writeInt( - BRAVE_RECYCLERVIEW_POSITION - + BraveActivity.getBraveActivity() - .getActivityTab() - .getId(), - firstVisiblePosition); - } - } - } catch (BraveActivity.BraveActivityNotFoundException e) { - Log.e(TAG, "onScrollStateChanged " + e); - } - } - if (mIsDisplayNews && firstVisibleItemPosition >= newsFeedPosition - 1) { - if (!mNewsFeedViewedOnce && mBraveNewsController != null) { - // Brave News interaction started - mBraveNewsController.onInteractionSessionStarted(); - mNewsFeedViewedOnce = true; - } - if (newState == RecyclerView.SCROLL_STATE_DRAGGING) { - mEndCardViewTime = System.currentTimeMillis(); - long timeDiff = mEndCardViewTime - mStartCardViewTime; - // if viewed for more than 100 ms send the event - if (timeDiff > BraveNewsUtils.BRAVE_NEWS_VIEWD_CARD_TIME) { - if (mVisibleCard != null && mCardType != null) { - // send viewed cards events - if (mCardType.equals("promo") && !mCardType.equals("displayad")) { - if (!mUuid.equals("") && !mCreativeInstanceId.equals("")) { - mVisibleCard.setViewStatSent(true); - if (mBraveNewsController != null) { - mBraveNewsController.onPromotedItemView( - mUuid, mCreativeInstanceId); - } + mRecyclerView.addOnScrollListener( + new RecyclerView.OnScrollListener() { + @Override + public void onScrollStateChanged( + @NonNull RecyclerView recyclerView, int newState) { + super.onScrollStateChanged(recyclerView, newState); + + int firstVisibleItemPosition = + linearLayoutManager.findFirstVisibleItemPosition(); + + int newsFeedPosition = firstNewsFeedPosition(); + + if (newState == RecyclerView.SCROLL_STATE_IDLE) { + try { + if (BraveActivity.getBraveActivity().getActivityTab() != null + && mRecyclerView.getChildCount() > 0) { + View firstChild = mRecyclerView.getChildAt(0); + if (firstChild != null) { + int firstVisiblePosition = + mRecyclerView.getChildAdapterPosition(firstChild); + int verticalOffset = firstChild.getTop(); + + ContextUtils.getAppSharedPreferences() + .edit() + .putInt( + BravePreferenceKeys + .BRAVE_RECYCLERVIEW_OFFSET_POSITION + + BraveActivity.getBraveActivity() + .getActivityTab() + .getId(), + verticalOffset) + .apply(); + + ContextUtils.getAppSharedPreferences() + .edit() + .putInt( + BravePreferenceKeys + .BRAVE_RECYCLERVIEW_POSITION + + BraveActivity.getBraveActivity() + .getActivityTab() + .getId(), + firstVisiblePosition) + .apply(); } } + } catch (BraveActivity.BraveActivityNotFoundException e) { + Log.e(TAG, "onScrollStateChanged " + e); } } - - int lastVisibleItemPosition = - linearLayoutManager.findLastCompletelyVisibleItemPosition(); - if (mNewsItemsFeedCard != null && mNewsItemsFeedCard.size() > 0 - && lastVisibleItemPosition >= newsFeedPosition - && lastVisibleItemPosition > mPrevVisibleNewsCardPosition) { - short newCardViews = 0; - for (int i = mPrevVisibleNewsCardPosition + 1; - i <= lastVisibleItemPosition; i++) { - int itemCardPosition = i - newsFeedPosition; - if (itemCardPosition >= 0 - && itemCardPosition < mNewsItemsFeedCard.size()) { - FeedItemsCard itemsCard = - mNewsItemsFeedCard.get(itemCardPosition); - if (itemsCard != null) { - List feedItems = itemsCard.getFeedItems(); - // Two items are shown as two cards side by side, - // and three or more items is shown as one card as a list - newCardViews = - (short) (feedItems != null && feedItems.size() == 2 - ? 2 - : 1); - mNewsSessionCardViews += newCardViews; + if (mIsDisplayNews && firstVisibleItemPosition >= newsFeedPosition - 1) { + if (!mNewsFeedViewedOnce && mBraveNewsController != null) { + // Brave News interaction started + mBraveNewsController.onInteractionSessionStarted(); + mNewsFeedViewedOnce = true; + } + if (newState == RecyclerView.SCROLL_STATE_DRAGGING) { + mEndCardViewTime = System.currentTimeMillis(); + long timeDiff = mEndCardViewTime - mStartCardViewTime; + // if viewed for more than 100 ms send the event + if (timeDiff > BraveNewsUtils.BRAVE_NEWS_VIEWD_CARD_TIME) { + if (mVisibleCard != null && mCardType != null) { + // send viewed cards events + if (mCardType.equals("promo") + && !mCardType.equals("displayad")) { + if (!mUuid.equals("") + && !mCreativeInstanceId.equals("")) { + mVisibleCard.setViewStatSent(true); + if (mBraveNewsController != null) { + mBraveNewsController.onPromotedItemView( + mUuid, mCreativeInstanceId); + } + } + } } } - } - if (mBraveNewsController != null) { - mBraveNewsController.onSessionCardViewsCountChanged( - (short) mNewsSessionCardViews, newCardViews); - } - mPrevVisibleNewsCardPosition = lastVisibleItemPosition; - } - } - if (newState == RecyclerView.SCROLL_STATE_IDLE) { - mStartCardViewTime = System.currentTimeMillis(); - int lastVisibleItemPosition = - linearLayoutManager.findLastVisibleItemPosition(); - - mFeedHash = SharedPreferencesManager.getInstance().readString( - BravePreferenceKeys.BRAVE_NEWS_FEED_HASH, ""); - //@TODO alex optimize feed availability check - if (mBraveNewsController != null) { - mBraveNewsController.isFeedUpdateAvailable( - mFeedHash, isNewsFeedAvailable -> { - if (isNewsFeedAvailable) { - mPrevVisibleNewsCardPosition = - mPrevVisibleNewsCardPosition + 1; - - setNewContentChanges(true); + int lastVisibleItemPosition = + linearLayoutManager.findLastCompletelyVisibleItemPosition(); + if (mNewsItemsFeedCard != null + && mNewsItemsFeedCard.size() > 0 + && lastVisibleItemPosition >= newsFeedPosition + && lastVisibleItemPosition > mPrevVisibleNewsCardPosition) { + short newCardViews = 0; + for (int i = mPrevVisibleNewsCardPosition + 1; + i <= lastVisibleItemPosition; + i++) { + int itemCardPosition = i - newsFeedPosition; + if (itemCardPosition >= 0 + && itemCardPosition < mNewsItemsFeedCard.size()) { + FeedItemsCard itemsCard = + mNewsItemsFeedCard.get(itemCardPosition); + if (itemsCard != null) { + List feedItems = + itemsCard.getFeedItems(); + // Two items are shown as two cards side by side, + // and three or more items is shown as one card as a + // list + newCardViews = + (short) + (feedItems != null + && feedItems.size() + == 2 + ? 2 + : 1); + mNewsSessionCardViews += newCardViews; + } } - }); - } - - Rect rvRect = new Rect(); - mRecyclerView.getGlobalVisibleRect(rvRect); - - int visiblePercentage = 0; - for (int viewPosition = firstVisibleItemPosition; - viewPosition <= lastVisibleItemPosition; viewPosition++) { - Rect rowRect = new Rect(); - if (linearLayoutManager.findViewByPosition(viewPosition) != null) { - linearLayoutManager.findViewByPosition(viewPosition) - .getGlobalVisibleRect(rowRect); - - if (linearLayoutManager.findViewByPosition(viewPosition).getHeight() - > 0) { - if (rowRect.bottom >= rvRect.bottom) { - int visibleHeightFirst = rvRect.bottom - rowRect.top; - visiblePercentage = (visibleHeightFirst * 100) - / linearLayoutManager - .findViewByPosition(viewPosition) - .getHeight(); - } else { - int visibleHeightFirst = rowRect.bottom - rvRect.top; - visiblePercentage = (visibleHeightFirst * 100) - / linearLayoutManager - .findViewByPosition(viewPosition) - .getHeight(); } + if (mBraveNewsController != null) { + mBraveNewsController.onSessionCardViewsCountChanged( + (short) mNewsSessionCardViews, newCardViews); + } + mPrevVisibleNewsCardPosition = lastVisibleItemPosition; } + } - if (visiblePercentage > 100) { - visiblePercentage = 100; + if (newState == RecyclerView.SCROLL_STATE_IDLE + || newState == RecyclerView.SCROLL_STATE_DRAGGING) { + mStartCardViewTime = System.currentTimeMillis(); + int lastVisibleItemPosition = + linearLayoutManager.findLastVisibleItemPosition(); + + mFeedHash = + ContextUtils.getAppSharedPreferences() + .getString( + BravePreferenceKeys.BRAVE_NEWS_FEED_HASH, + ""); + // @TODO alex optimize feed availability check + if (mBraveNewsController != null) { + mBraveNewsController.isFeedUpdateAvailable( + mFeedHash, + isNewsFeedAvailable -> { + if (isNewsFeedAvailable) { + mPrevVisibleNewsCardPosition = + mPrevVisibleNewsCardPosition + 1; + + setNewContentChanges(true); + } + }); } - } - final int visiblePercentageFinal = visiblePercentage; - - int newsFeedViewPosition = viewPosition - newsFeedPosition; - if (newsFeedViewPosition >= 0 - && newsFeedViewPosition < mNewsItemsFeedCard.size()) { - if (visiblePercentageFinal >= MINIMUM_VISIBLE_HEIGHT_THRESHOLD) { - mVisibleCard = mNewsItemsFeedCard.get(newsFeedViewPosition); - // get params for view PROMOTED_ARTICLE - if (mVisibleCard.getCardType() == CardType.PROMOTED_ARTICLE) { - mItemPosition = newsFeedViewPosition; - mCreativeInstanceId = - BraveNewsUtils.getPromotionIdItem(mVisibleCard); - mUuid = mVisibleCard.getUuid(); - mCardType = "promo"; + Rect rvRect = new Rect(); + mRecyclerView.getGlobalVisibleRect(rvRect); + + int visiblePercentage = 0; + for (int viewPosition = firstVisibleItemPosition; + viewPosition <= lastVisibleItemPosition; + viewPosition++) { + Rect rowRect = new Rect(); + if (linearLayoutManager.findViewByPosition(viewPosition) + != null) { + linearLayoutManager + .findViewByPosition(viewPosition) + .getGlobalVisibleRect(rowRect); + + if (linearLayoutManager + .findViewByPosition(viewPosition) + .getHeight() + > 0) { + if (rowRect.bottom >= rvRect.bottom) { + int visibleHeightFirst = + rvRect.bottom - rowRect.top; + visiblePercentage = + (visibleHeightFirst * 100) + / linearLayoutManager + .findViewByPosition( + viewPosition) + .getHeight(); + } else { + int visibleHeightFirst = + rowRect.bottom - rvRect.top; + visiblePercentage = + (visibleHeightFirst * 100) + / linearLayoutManager + .findViewByPosition( + viewPosition) + .getHeight(); + } + } + + if (visiblePercentage > 100) { + visiblePercentage = 100; + } } - // get params for view DISPLAY_AD - if (mVisibleCard.getCardType() == CardType.DISPLAY_AD) { - mItemPosition = newsFeedViewPosition; - DisplayAd currentDisplayAd = - BraveNewsUtils.getFromDisplayAdsMap( - newsFeedViewPosition); - if (currentDisplayAd != null) { - mCreativeInstanceId = currentDisplayAd != null - ? currentDisplayAd.creativeInstanceId - : ""; - mUuid = currentDisplayAd != null ? currentDisplayAd.uuid - : ""; - mCardType = "displayad"; - - // if viewed for more than 100 ms and is more than 50% - // visible send the event - Timer timer = new Timer(); - timer.schedule(new TimerTask() { - @Override - public void run() { - new Thread() { - @Override - public void run() { - if (!mDatabaseHelper - .isDisplayAdAlreadyAdded( - mUuid) - && visiblePercentageFinal - > MINIMUM_VISIBLE_HEIGHT_THRESHOLD - && mBraveNewsController - != null) { - mVisibleCard.setViewStatSent(true); - mBraveNewsController.onDisplayAdView( - mUuid, mCreativeInstanceId); - - insertAd(); - } - } - }.start(); + final int visiblePercentageFinal = visiblePercentage; + + int newsFeedViewPosition = viewPosition - newsFeedPosition; + if (newsFeedViewPosition >= 0 + && newsFeedViewPosition < mNewsItemsFeedCard.size()) { + if (visiblePercentageFinal + >= MINIMUM_VISIBLE_HEIGHT_THRESHOLD) { + mVisibleCard = + mNewsItemsFeedCard.get(newsFeedViewPosition); + // get params for view PROMOTED_ARTICLE + if (mVisibleCard.getCardType() + == CardType.PROMOTED_ARTICLE) { + mItemPosition = newsFeedViewPosition; + mCreativeInstanceId = + BraveNewsUtils.getPromotionIdItem( + mVisibleCard); + mUuid = mVisibleCard.getUuid(); + mCardType = "promo"; + } + + // get params for view DISPLAY_AD + if (mVisibleCard.getCardType() == CardType.DISPLAY_AD) { + mItemPosition = newsFeedViewPosition; + DisplayAd currentDisplayAd = + BraveNewsUtils.getFromDisplayAdsMap( + newsFeedViewPosition); + if (currentDisplayAd != null) { + mCreativeInstanceId = + currentDisplayAd != null + ? currentDisplayAd + .creativeInstanceId + : ""; + mUuid = + currentDisplayAd != null + ? currentDisplayAd.uuid + : ""; + mCardType = "displayad"; + + // if viewed for more than 100 ms and is more + // than 50% + // visible send the event + Timer timer = new Timer(); + timer.schedule( + new TimerTask() { + @Override + public void run() { + new Thread() { + @Override + public void run() { + if (!mDatabaseHelper + .isDisplayAdAlreadyAdded( + mUuid) + && visiblePercentageFinal + > MINIMUM_VISIBLE_HEIGHT_THRESHOLD + && mBraveNewsController + != null) { + mVisibleCard + .setViewStatSent( + true); + mBraveNewsController + .onDisplayAdView( + mUuid, + mCreativeInstanceId); + + insertAd(); + } + } + }.start(); + } + }, + BraveNewsUtils + .BRAVE_NEWS_VIEWD_CARD_TIME); } - }, BraveNewsUtils.BRAVE_NEWS_VIEWD_CARD_TIME); + } } } } } } } - } - } - private void insertAd() { - DisplayAd currentDisplayAd = BraveNewsUtils.getFromDisplayAdsMap(mItemPosition); - try { - mDatabaseHelper.insertAd(currentDisplayAd, mItemPosition, - BraveActivity.getBraveActivity().getActivityTab().getId()); - } catch (BraveActivity.BraveActivityNotFoundException e) { - Log.e(TAG, "insertAd " + e); - } - } - - @Override - public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { - super.onScrolled(recyclerView, dx, dy); - - if (mIsDisplayNews) { - int lastVisibleItemPosition = - linearLayoutManager.findLastCompletelyVisibleItemPosition(); - - if (!mNtpAdapter.shouldDisplayNewsLoading() && mNewsItemsFeedCard != null - && mNewsItemsFeedCard.size() > 0 - && lastVisibleItemPosition > mNtpAdapter.getStatsCount() - + mNtpAdapter.getTopSitesCount() - + mNtpAdapter.getNewContentCount()) { - if (mNewsSettingsBar.getVisibility() != View.VISIBLE) { - mNewsSettingsBar.setVisibility(View.VISIBLE); + private void insertAd() { + DisplayAd currentDisplayAd = + BraveNewsUtils.getFromDisplayAdsMap(mItemPosition); + try { + mDatabaseHelper.insertAd( + currentDisplayAd, + mItemPosition, + BraveActivity.getBraveActivity().getActivityTab().getId()); + } catch (BraveActivity.BraveActivityNotFoundException e) { + Log.e(TAG, "insertAd " + e); } - mNtpAdapter.setImageCreditAlpha(0f); - } else if (lastVisibleItemPosition > -1) { - if (mNewsSettingsBar.getVisibility() != View.GONE) { - mNewsSettingsBar.setVisibility(View.GONE); - } - mNtpAdapter.setImageCreditAlpha(1f); } - if (mNtpAdapter.isNewContent()) { - int firstVisibleItemPosition = - linearLayoutManager.findFirstVisibleItemPosition(); + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + super.onScrolled(recyclerView, dx, dy); + + if (mIsDisplayNews) { + int lastVisibleItemPosition = + linearLayoutManager.findLastCompletelyVisibleItemPosition(); + + if (!mNtpAdapter.shouldDisplayNewsLoading() + && mNewsItemsFeedCard != null + && mNewsItemsFeedCard.size() > 0 + && lastVisibleItemPosition + > mNtpAdapter.getStatsCount() + + mNtpAdapter.getTopSitesCount() + + mNtpAdapter.getNewContentCount()) { + if (mNewsSettingsBar.getVisibility() != View.VISIBLE) { + mNewsSettingsBar.setVisibility(View.VISIBLE); + } + mNtpAdapter.setImageCreditAlpha(0f); + } else if (lastVisibleItemPosition > -1) { + if (mNewsSettingsBar.getVisibility() != View.GONE) { + mNewsSettingsBar.setVisibility(View.GONE); + } + mNtpAdapter.setImageCreditAlpha(1f); + } - if (firstVisibleItemPosition - >= mNtpAdapter.getStatsCount() + mNtpAdapter.getTopSitesCount()) { - mNewContentLayout.setVisibility(View.VISIBLE); - } else { - mNewContentLayout.setVisibility(View.GONE); + if (mNtpAdapter.isNewContent()) { + int firstVisibleItemPosition = + linearLayoutManager.findFirstVisibleItemPosition(); + + if (firstVisibleItemPosition + >= mNtpAdapter.getStatsCount() + + mNtpAdapter.getTopSitesCount()) { + mNewContentLayout.setVisibility(View.VISIBLE); + } else { + mNewContentLayout.setVisibility(View.GONE); + } + } else { + mNewContentLayout.setVisibility(View.GONE); + } + } else if (mIsDisplayNewsOptin) { + int lastVisibleItemPosition = + linearLayoutManager.findLastCompletelyVisibleItemPosition(); + + if (lastVisibleItemPosition == mNtpAdapter.getItemCount() - 1) { + mNtpAdapter.setImageCreditAlpha(0f); + } else { + mNtpAdapter.setImageCreditAlpha(1f); + } } - } else { - mNewContentLayout.setVisibility(View.GONE); } - } else if (mIsDisplayNewsOptin) { - int lastVisibleItemPosition = - linearLayoutManager.findLastCompletelyVisibleItemPosition(); - - if (lastVisibleItemPosition == mNtpAdapter.getItemCount() - 1) { - mNtpAdapter.setImageCreditAlpha(0f); - } else { - mNtpAdapter.setImageCreditAlpha(1f); - } - } - } - }); + }); } private void keepPosition() { try { Tab tab = BraveActivity.getBraveActivity().getActivityTab(); if (tab != null) { - int itemPosition = SharedPreferencesManager.getInstance().readInt( - BRAVE_RECYCLERVIEW_POSITION + tab.getId(), 0); - - new Handler(Looper.getMainLooper()).postDelayed(() -> { - if (mNtpAdapter != null && mNtpAdapter.getItemCount() > itemPosition) { - RecyclerView.LayoutManager manager = mRecyclerView.getLayoutManager(); - if (manager instanceof LinearLayoutManager) { - int offsetPosition = SharedPreferencesManager.getInstance().readInt( - BRAVE_RECYCLERVIEW_OFFSET_POSITION + tab.getId(), 0); - - if (itemPosition - == mNtpAdapter.getStatsCount() + mNtpAdapter.getTopSitesCount() - + mNtpAdapter.getNewContentCount()) { - offsetPosition -= mNtpAdapter.getTopMarginImageCredit(); - } - - LinearLayoutManager linearLayoutManager = (LinearLayoutManager) manager; - linearLayoutManager.scrollToPositionWithOffset( - itemPosition, offsetPosition); - } - } - }, 10); + int itemPosition = + ContextUtils.getAppSharedPreferences() + .getInt( + BravePreferenceKeys.BRAVE_RECYCLERVIEW_POSITION + + tab.getId(), + 0); + + new Handler(Looper.getMainLooper()) + .postDelayed( + () -> { + if (mNtpAdapter != null + && mNtpAdapter.getItemCount() > itemPosition) { + RecyclerView.LayoutManager manager = + mRecyclerView.getLayoutManager(); + if (manager instanceof LinearLayoutManager) { + int offsetPosition = + ContextUtils.getAppSharedPreferences() + .getInt( + BravePreferenceKeys + .BRAVE_RECYCLERVIEW_OFFSET_POSITION + + tab.getId(), + 0); + + if (itemPosition + == mNtpAdapter.getStatsCount() + + mNtpAdapter.getTopSitesCount() + + mNtpAdapter.getNewContentCount()) { + offsetPosition -= + mNtpAdapter.getTopMarginImageCredit(); + } + + LinearLayoutManager linearLayoutManager = + (LinearLayoutManager) manager; + linearLayoutManager.scrollToPositionWithOffset( + itemPosition, offsetPosition); + } + } + }, + 10); } } catch (BraveActivity.BraveActivityNotFoundException e) { Log.e(TAG, "keepPosition " + e); @@ -792,26 +875,39 @@ private boolean shouldDisplayNewsOptin() { } private void initPreferenceObserver() { - mPreferenceObserver = (key) -> { - if (TextUtils.equals(key, BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE)) { - if (SharedPreferencesManager.getInstance().readBoolean( - BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE, false)) { - new Handler(Looper.getMainLooper()).postDelayed(() -> { - mPrevVisibleNewsCardPosition = mPrevVisibleNewsCardPosition + 1; - setNewContentChanges(true); - }, 10); - } + mPreferenceListener = + (prefs, key) -> { + if (TextUtils.equals(key, BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE)) { + if (ContextUtils.getAppSharedPreferences() + .getBoolean(BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE, false)) { + new Handler(Looper.getMainLooper()) + .postDelayed( + () -> { + mPrevVisibleNewsCardPosition = + mPrevVisibleNewsCardPosition + 1; + setNewContentChanges(true); + }, + 10); + } - } else if (TextUtils.equals(key, BravePreferenceKeys.BRAVE_NEWS_PREF_SHOW_NEWS)) { - new Handler(Looper.getMainLooper()).postDelayed(() -> { refreshFeed(); }, 10); - } else if (TextUtils.equals(key, BackgroundImagesPreferences.PREF_SHOW_TOP_SITES)) { - mIsTopSitesEnabled = shouldDisplayTopSites(); - mNtpAdapter.setTopSitesEnabled(mIsTopSitesEnabled); - } else if (TextUtils.equals(key, BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS)) { - mIsBraveStatsEnabled = shouldDisplayBraveStats(); - mNtpAdapter.setBraveStatsEnabled(mIsBraveStatsEnabled); - } - }; + } else if (TextUtils.equals( + key, BravePreferenceKeys.BRAVE_NEWS_PREF_SHOW_NEWS)) { + new Handler(Looper.getMainLooper()) + .postDelayed( + () -> { + refreshFeed(); + }, + 10); + } else if (TextUtils.equals( + key, BackgroundImagesPreferences.PREF_SHOW_TOP_SITES)) { + mIsTopSitesEnabled = shouldDisplayTopSites(); + mNtpAdapter.setTopSitesEnabled(mIsTopSitesEnabled); + } else if (TextUtils.equals( + key, BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS)) { + mIsBraveStatsEnabled = shouldDisplayBraveStats(); + mNtpAdapter.setBraveStatsEnabled(mIsBraveStatsEnabled); + } + }; } @Override @@ -843,9 +939,10 @@ protected void onDetachedFromWindow() { mBraveNewsController = null; } - // removes preference observer - SharedPreferencesManager.getInstance().removeObserver(mPreferenceObserver); - mPreferenceObserver = null; + // Removes preference listener. + ContextUtils.getAppSharedPreferences() + .unregisterOnSharedPreferenceChangeListener(mPreferenceListener); + mPreferenceListener = null; mRecyclerView.clearOnScrollListeners(); super.onDetachedFromWindow(); @@ -884,8 +981,10 @@ public void loadNewContent() { mNewContentText.setVisibility(View.GONE); mNewContentProgressBar.setVisibility(View.VISIBLE); mNewContentLayout.setClickable(false); - SharedPreferencesManager.getInstance().writeBoolean( - BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE, false); + ContextUtils.getAppSharedPreferences() + .edit() + .putBoolean(BravePreferenceKeys.BRAVE_NEWS_CHANGE_SOURCE, false) + .apply(); getFeed(true); } @@ -897,11 +996,16 @@ public void getFeed(boolean isNewContent) { mNtpAdapter.setNewsLoading(true); } initBraveNewsController(); - PostTask.postTask(TaskTraits.BEST_EFFORT_MAY_BLOCK, () -> { - if (mBraveNewsController != null) { - mBraveNewsController.getFeed(feed -> { runFeed(isNewContent, feed); }); - } - }); + PostTask.postTask( + TaskTraits.BEST_EFFORT_MAY_BLOCK, + () -> { + if (mBraveNewsController != null) { + mBraveNewsController.getFeed( + feed -> { + runFeed(isNewContent, feed); + }); + } + }); } private void runFeed(boolean isNewContent, Feed feed) { @@ -920,8 +1024,10 @@ private void runFeed(boolean isNewContent, Feed feed) { mNewsItemsFeedCard.clear(); BraveNewsUtils.initCurrentAds(); - SharedPreferencesManager.getInstance().writeString( - BravePreferenceKeys.BRAVE_NEWS_FEED_HASH, feed.hash); + ContextUtils.getAppSharedPreferences() + .edit() + .putString(BravePreferenceKeys.BRAVE_NEWS_FEED_HASH, feed.hash) + .apply(); if (feed.featuredItem != null) { // process Featured item @@ -1090,25 +1196,48 @@ private void setNewContentChanges(boolean isNewContent) { } @Override - public void initialize(NewTabPageManager manager, Activity activity, Delegate tileGroupDelegate, - boolean searchProviderHasLogo, boolean searchProviderIsGoogle, - FeedSurfaceScrollDelegate scrollDelegate, TouchEnabledDelegate touchEnabledDelegate, - UiConfig uiConfig, ActivityLifecycleDispatcher lifecycleDispatcher, NewTabPageUma uma, - boolean isIncognito, WindowAndroid windowAndroid, boolean isNtpAsHomeSurfaceEnabled, - boolean isSurfacePolishEnabled, boolean isSurfacePolishOmniboxColorEnabled) { - super.initialize(manager, activity, tileGroupDelegate, searchProviderHasLogo, - searchProviderIsGoogle, scrollDelegate, touchEnabledDelegate, uiConfig, - lifecycleDispatcher, uma, isIncognito, windowAndroid, isNtpAsHomeSurfaceEnabled, - isSurfacePolishEnabled, isSurfacePolishOmniboxColorEnabled); + public void initialize( + NewTabPageManager manager, + Activity activity, + Delegate tileGroupDelegate, + boolean searchProviderHasLogo, + boolean searchProviderIsGoogle, + FeedSurfaceScrollDelegate scrollDelegate, + TouchEnabledDelegate touchEnabledDelegate, + UiConfig uiConfig, + ActivityLifecycleDispatcher lifecycleDispatcher, + NewTabPageUma uma, + boolean isIncognito, + WindowAndroid windowAndroid, + boolean isNtpAsHomeSurfaceEnabled, + boolean isSurfacePolishEnabled, + boolean isSurfacePolishOmniboxColorEnabled, + boolean isTablet) { + super.initialize( + manager, + activity, + tileGroupDelegate, + searchProviderHasLogo, + searchProviderIsGoogle, + scrollDelegate, + touchEnabledDelegate, + uiConfig, + lifecycleDispatcher, + uma, + isIncognito, + windowAndroid, + isNtpAsHomeSurfaceEnabled, + isSurfacePolishEnabled, + isSurfacePolishOmniboxColorEnabled, + isTablet); assert mMvTilesContainerLayout != null : "Something has changed in the upstream!"; if (mMvTilesContainerLayout != null && !isScrollableMvtEnabled()) { ViewGroup tilesLayout = mMvTilesContainerLayout.findViewById(R.id.mv_tiles_layout); - assert tilesLayout - instanceof MostVisitedTilesGridLayout - : "Something has changed in the upstream!"; + assert tilesLayout instanceof MostVisitedTilesGridLayout + : "Something has changed in the upstream!"; if (tilesLayout instanceof MostVisitedTilesGridLayout) { ((MostVisitedTilesGridLayout) tilesLayout) diff --git a/android/java/org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator.java b/android/java/org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator.java index 9df379e13d8d..adfb32a370c2 100644 --- a/android/java/org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator.java +++ b/android/java/org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator.java @@ -31,9 +31,17 @@ class BraveAutocompleteMediator extends AutocompleteMediator implements BraveSug private static final String AUTOCOMPLETE_ENABLED = "brave.autocomplete_enabled"; private Context mContext; + private AutocompleteDelegate mDelegate; + + /** Will be deleted in bytecode, value from the parent class will be used instead. */ private boolean mNativeInitialized; + + /** Will be deleted in bytecode, value from the parent class will be used instead. */ private DropdownItemViewInfoListManager mDropdownViewInfoListManager; + /** Will be deleted in bytecode, value from the parent class will be used instead. */ + private DropdownItemViewInfoListBuilder mDropdownViewInfoListBuilder; + public BraveAutocompleteMediator(@NonNull Context context, @NonNull AutocompleteControllerProvider controllerProvider, @NonNull AutocompleteDelegate delegate, @@ -53,6 +61,7 @@ public BraveAutocompleteMediator(@NonNull Context context, locationBarDataProvider, bringTabToFrontCallback, tabWindowManagerSupplier, bookmarkState, omniboxActionDelegate, openHistoryClustersDelegate); mContext = context; + mDelegate = delegate; } @Override @@ -80,4 +89,14 @@ public void removeBraveSearchSuggestion() { .removeBraveSearchSuggestion(); } } + + /** We override parent to move back ability to set AutocompleteDelegate. */ + @Override + void initDefaultProcessors() { + if (mDropdownViewInfoListBuilder instanceof BraveDropdownItemViewInfoListBuilder) { + ((BraveDropdownItemViewInfoListBuilder) mDropdownViewInfoListBuilder) + .setAutocompleteDelegate(mDelegate); + } + super.initDefaultProcessors(); + } } diff --git a/android/java/org/chromium/chrome/browser/paint_preview/BraveStartupPaintPreviewHelper.java b/android/java/org/chromium/chrome/browser/paint_preview/BraveStartupPaintPreviewHelper.java deleted file mode 100644 index 0d3933ec13dc..000000000000 --- a/android/java/org/chromium/chrome/browser/paint_preview/BraveStartupPaintPreviewHelper.java +++ /dev/null @@ -1,12 +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/. */ - -package org.chromium.chrome.browser.paint_preview; - -public class BraveStartupPaintPreviewHelper { - public static boolean isEnabled() { - return false; - } -} 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 eeb9447f3e10..4c881672e5a9 100644 --- a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java +++ b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java @@ -12,6 +12,7 @@ import androidx.preference.PreferenceCategory; import org.chromium.base.BraveFeatureList; +import org.chromium.base.BravePreferenceKeys; import org.chromium.base.ContextUtils; import org.chromium.brave_shields.mojom.FilterListAndroidHandler; import org.chromium.brave_shields.mojom.FilterListConstants; @@ -142,11 +143,11 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private static final int STANDARD = 1; private static final int ALLOW = 2; - private final PrefService mPrefServiceBridge = UserPrefs.get(Profile.getLastUsedRegularProfile()); + private final PrefService mPrefServiceBridge = + UserPrefs.get(Profile.getLastUsedRegularProfile()); private final PrivacyPreferencesManagerImpl mPrivacyPrefManager = PrivacyPreferencesManagerImpl.getInstance(); - private final ChromeManagedPreferenceDelegate mManagedPreferenceDelegate = - createManagedPreferenceDelegate(); + private ChromeManagedPreferenceDelegate mManagedPreferenceDelegate; private ChromeSwitchPreference mSearchSuggestions; private ChromeSwitchPreference mCanMakePayment; private BraveDialogPreference mAdsTrakersBlockPref; @@ -211,6 +212,8 @@ public void onDestroy() { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { super.onCreatePreferences(savedInstanceState, rootKey); + mManagedPreferenceDelegate = createManagedPreferenceDelegate(); + // override title getActivity().setTitle(R.string.brave_shields_and_privacy); @@ -317,7 +320,8 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { (ChromeSwitchPreference) findPreference(PREF_SHOW_AUTOCOMPLETE_IN_ADDRESS_BAR); mShowAutocompleteInAddressBar.setOnPreferenceChangeListener(this); - mAutocompleteTopSites = (ChromeSwitchPreference) findPreference(PREF_AUTOCOMPLETE_TOP_SITES); + mAutocompleteTopSites = + (ChromeSwitchPreference) findPreference(PREF_AUTOCOMPLETE_TOP_SITES); mAutocompleteTopSites.setOnPreferenceChangeListener(this); mSocialBlockingCategory = @@ -336,13 +340,16 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { } } - mSocialBlockingFacebook = (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_FACEBOOK); + mSocialBlockingFacebook = + (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_FACEBOOK); mSocialBlockingFacebook.setOnPreferenceChangeListener(this); - mSocialBlockingTwitter = (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_TWITTER); + mSocialBlockingTwitter = + (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_TWITTER); mSocialBlockingTwitter.setOnPreferenceChangeListener(this); - mSocialBlockingLinkedin = (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_LINKEDIN); + mSocialBlockingLinkedin = + (ChromeSwitchPreference) findPreference(PREF_SOCIAL_BLOCKING_LINKEDIN); mSocialBlockingLinkedin.setOnPreferenceChangeListener(this); mAppLinks = (ChromeSwitchPreference) findPreference(PREF_APP_LINKS); @@ -544,7 +551,8 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } else if (PREF_FORGET_FIRST_PARTY_STORAGE.equals(key)) { BraveShieldsContentSettings.setForgetFirstPartyStoragePref((boolean) newValue); } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) { - sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean) newValue); + sharedPreferencesEditor.putBoolean( + BravePreferenceKeys.BRAVE_CLOSE_TABS_ON_EXIT, (boolean) newValue); } else if (PREF_SEND_P3A.equals(key)) { BraveLocalState.get().setBoolean(BravePref.P3A_ENABLED, (boolean) newValue); BraveLocalState.commitPendingWrite(); @@ -577,7 +585,8 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { UserPrefs.get(Profile.getLastUsedRegularProfile()) .setBoolean(BravePref.LINKED_IN_EMBED_CONTROL_TYPE, (boolean) newValue); } else if (PREF_CLEAR_ON_EXIT.equals(key)) { - sharedPreferencesEditor.putBoolean(PREF_CLEAR_ON_EXIT, (boolean) newValue); + sharedPreferencesEditor.putBoolean( + BravePreferenceKeys.BRAVE_CLEAR_ON_EXIT, (boolean) newValue); } else if (PREF_APP_LINKS.equals(key)) { sharedPreferencesEditor.putBoolean(PREF_APP_LINKS, (boolean) newValue); SharedPreferencesManager.getInstance().writeBoolean( @@ -734,7 +743,7 @@ private void updateBravePreferences() { .getBoolean(BravePref.TOP_SITE_SUGGESTIONS_ENABLED)); mClearBrowsingDataOnExit.setChecked( - sharedPreferences.getBoolean(PREF_CLEAR_ON_EXIT, false)); + sharedPreferences.getBoolean(BravePreferenceKeys.BRAVE_CLEAR_ON_EXIT, false)); boolean autocompleteEnabled = UserPrefs.get(Profile.getLastUsedRegularProfile()) .getBoolean(BravePref.AUTOCOMPLETE_ENABLED); @@ -825,12 +834,15 @@ private void removePreferenceIfPresent(String key) { } private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() { - return preference -> { - String key = preference.getKey(); - if (PREF_SEARCH_SUGGESTIONS.equals(key)) { - return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED); + return new ChromeManagedPreferenceDelegate(getProfile()) { + @Override + public boolean isPreferenceControlledByPolicy(Preference preference) { + String key = preference.getKey(); + if (PREF_SEARCH_SUGGESTIONS.equals(key)) { + return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED); + } + return false; } - return false; }; } diff --git a/android/java/org/chromium/chrome/browser/search_engines/BUILD.gn b/android/java/org/chromium/chrome/browser/search_engines/BUILD.gn index e03313f21701..6f1de73e7cad 100644 --- a/android/java/org/chromium/chrome/browser/search_engines/BUILD.gn +++ b/android/java/org/chromium/chrome/browser/search_engines/BUILD.gn @@ -4,6 +4,7 @@ # You can obtain one at http://mozilla.org/MPL/2.0/. import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") android_library("java") { srcjar_deps = [ ":jni_headers" ] @@ -24,6 +25,7 @@ android_library("java") { "//chrome/browser/search_engines/android:java", "//components/search_engines/android:java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_fragment_fragment_java", ] resources_package = "org.chromium.chrome.browser.search_engines" diff --git a/android/java/org/chromium/chrome/browser/settings/BravePreferenceFragment.java b/android/java/org/chromium/chrome/browser/settings/BravePreferenceFragment.java index 54205ece1834..f3a59a0c9f8c 100644 --- a/android/java/org/chromium/chrome/browser/settings/BravePreferenceFragment.java +++ b/android/java/org/chromium/chrome/browser/settings/BravePreferenceFragment.java @@ -15,7 +15,6 @@ import android.view.MenuItem; import androidx.preference.Preference; -import androidx.preference.PreferenceFragmentCompat; import org.chromium.base.ContextUtils; import org.chromium.chrome.R; @@ -24,7 +23,7 @@ import org.chromium.chrome.browser.preferences.BravePrefServiceBridge; import org.chromium.chrome.browser.settings.developer.BraveRewardsDebugPreferences; -public class BravePreferenceFragment extends PreferenceFragmentCompat { +public class BravePreferenceFragment extends ChromeBaseSettingsFragment { protected static final int STORAGE_PERMISSION_EXPORT_REQUEST_CODE = 8000; protected static final int STORAGE_PERMISSION_IMPORT_REQUEST_CODE = STORAGE_PERMISSION_EXPORT_REQUEST_CODE + 1; diff --git a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java index 9c597dc26c07..d91e270644e1 100644 --- a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java +++ b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java @@ -217,13 +217,13 @@ public void addStat(int tabId, String blockType, String subResource) { if (!BraveShieldsUtils.hasShieldsTooltipShown(BraveShieldsUtils.PREF_SHIELDS_TOOLTIP)) { blockersInfo = addBlockerNames(blockersInfo, subResource); } - } else if (blockType.equals(BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES)) { + } else if (blockType.equals( + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES)) { blockersInfo.mHTTPSUpgrades++; } else if (blockType.equals(BraveShieldsContentSettings.RESOURCE_IDENTIFIER_JAVASCRIPTS)) { blockersInfo.mScriptsBlocked++; } else if (blockType.equals( - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_FINGERPRINTING)) { + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_FINGERPRINTING)) { blockersInfo.mFingerprintsBlocked++; } } @@ -724,22 +724,30 @@ public void onCheckedChanged(RadioGroup group, int checkedId) { boolean isChecked = checkedRadioButton.isChecked(); if (isChecked) { if (checkedId == R.id.option1) { - BraveShieldsContentSettings.setShieldsValue(mProfile, mUrlSpec, - layout, BraveShieldsContentSettings.BLOCK_RESOURCE, + BraveShieldsContentSettings.setShieldsValue( + mProfile, + mUrlSpec, + layout, + BraveShieldsContentSettings.BLOCK_RESOURCE, false); } else if (checkedId == R.id.option2) { - BraveShieldsContentSettings.setShieldsValue(mProfile, mUrlSpec, + BraveShieldsContentSettings.setShieldsValue( + mProfile, + mUrlSpec, layout, layout.equals( - BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_FINGERPRINTING) + BraveShieldsContentSettings + .RESOURCE_IDENTIFIER_FINGERPRINTING) ? BraveShieldsContentSettings.DEFAULT : BraveShieldsContentSettings - .BLOCK_THIRDPARTY_RESOURCE, + .BLOCK_THIRDPARTY_RESOURCE, false); } else if (checkedId == R.id.option3) { - BraveShieldsContentSettings.setShieldsValue(mProfile, mUrlSpec, - layout, BraveShieldsContentSettings.ALLOW_RESOURCE, + BraveShieldsContentSettings.setShieldsValue( + mProfile, + mUrlSpec, + layout, + BraveShieldsContentSettings.ALLOW_RESOURCE, false); } if (null != mMenuObserver) { @@ -821,21 +829,22 @@ public void onClick(View view) { }); Button mSubmitButton = mReportBrokenSiteLayout.findViewById(R.id.btn_submit); - mSubmitButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - // Profile.getLastUsedRegularProfile requires to run in UI thread, - // so get api key here and pass it to IO worker task - String referralApiKey = - NTPBackgroundImagesBridge.getInstance(mProfile).getReferralApiKey(); - BraveShieldsUtils.BraveShieldsWorkerTask mWorkerTask = - new BraveShieldsUtils.BraveShieldsWorkerTask( - reportUri.toString(), referralApiKey); - mWorkerTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - mReportBrokenSiteLayout.setVisibility(View.GONE); - mThankYouLayout.setVisibility(View.VISIBLE); - } - }); + mSubmitButton.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View view) { + // Profile.getLastUsedRegularProfile requires to run in UI thread, + // so get api key here and pass it to IO worker task + String referralApiKey = + NTPBackgroundImagesBridge.getInstance(mProfile).getReferralApiKey(); + BraveShieldsUtils.BraveShieldsWorkerTask mWorkerTask = + new BraveShieldsUtils.BraveShieldsWorkerTask( + reportUri.toString(), referralApiKey); + mWorkerTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + mReportBrokenSiteLayout.setVisibility(View.GONE); + mThankYouLayout.setVisibility(View.VISIBLE); + } + }); } private void setUpMainSwitchLayout(boolean isChecked) { @@ -900,21 +909,24 @@ private void setupHTTPSEverywhereSwitchClick(SwitchCompat braveShieldsHTTPSEvery } setupHTTPSEverywhereSwitch(braveShieldsHTTPSEverywhereSwitch, false); - mBraveShieldsHTTPSEverywhereChangeListener = new OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, - boolean isChecked) { - if (0 != mUrlSpec.length()) { - BraveShieldsContentSettings.setShields(mProfile, mUrlSpec, - BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES, - isChecked, false); - if (null != mMenuObserver) { - mMenuObserver.onMenuTopShieldsChanged(isChecked, false); + mBraveShieldsHTTPSEverywhereChangeListener = + new OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (0 != mUrlSpec.length()) { + BraveShieldsContentSettings.setShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings + .RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES, + isChecked, + false); + if (null != mMenuObserver) { + mMenuObserver.onMenuTopShieldsChanged(isChecked, false); + } + } } - } - } - }; + }; braveShieldsHTTPSEverywhereSwitch.setOnCheckedChangeListener(mBraveShieldsHTTPSEverywhereChangeListener); } @@ -929,11 +941,15 @@ private void setupHTTPSEverywhereSwitch( braveShieldsHTTPSEverywhereSwitch.setOnCheckedChangeListener(null); } if (0 != mUrlSpec.length()) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings + .RESOURCE_IDENTIFIER_HTTP_UPGRADABLE_RESOURCES)) { braveShieldsHTTPSEverywhereSwitch.setChecked(true); } else { braveShieldsHTTPSEverywhereSwitch.setChecked(false); @@ -955,20 +971,23 @@ private void setupBlockingScriptsSwitchClick(SwitchCompat braveShieldsBlockingSc } setupBlockingScriptsSwitch(braveShieldsBlockingScriptsSwitch, false); - mBraveShieldsBlockingScriptsChangeListener = new OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, - boolean isChecked) { - if (0 != mUrlSpec.length()) { - BraveShieldsContentSettings.setShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_JAVASCRIPTS, isChecked, - false); - if (null != mMenuObserver) { - mMenuObserver.onMenuTopShieldsChanged(isChecked, false); + mBraveShieldsBlockingScriptsChangeListener = + new OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (0 != mUrlSpec.length()) { + BraveShieldsContentSettings.setShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_JAVASCRIPTS, + isChecked, + false); + if (null != mMenuObserver) { + mMenuObserver.onMenuTopShieldsChanged(isChecked, false); + } + } } - } - } - }; + }; braveShieldsBlockingScriptsSwitch.setOnCheckedChangeListener(mBraveShieldsBlockingScriptsChangeListener); } @@ -983,10 +1002,14 @@ private void setupBlockingScriptsSwitch( braveShieldsBlockingScriptsSwitch.setOnCheckedChangeListener(null); } if (0 != mUrlSpec.length()) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_JAVASCRIPTS)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_JAVASCRIPTS)) { braveShieldsBlockingScriptsSwitch.setChecked(true); } else { braveShieldsBlockingScriptsSwitch.setChecked(false); @@ -1009,17 +1032,21 @@ private void setupForgetFirstPartyStorageSwitchClick( } setupForgetFirstPartyStorageSwitch(braveShieldsForgetFirstPartyStorageSwitch, false); - mBraveShieldsForgetFirstPartyStorageChangeListener = new OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (0 != mUrlSpec.length()) { - BraveShieldsContentSettings.setShields(mProfile, mUrlSpec, - BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_FORGET_FIRST_PARTY_STORAGE, - isChecked, false); - } - } - }; + mBraveShieldsForgetFirstPartyStorageChangeListener = + new OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (0 != mUrlSpec.length()) { + BraveShieldsContentSettings.setShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings + .RESOURCE_IDENTIFIER_FORGET_FIRST_PARTY_STORAGE, + isChecked, + false); + } + } + }; braveShieldsForgetFirstPartyStorageSwitch.setOnCheckedChangeListener( mBraveShieldsForgetFirstPartyStorageChangeListener); @@ -1035,11 +1062,15 @@ private void setupForgetFirstPartyStorageSwitch( braveShieldsForgetFirstPartyStorageSwitch.setOnCheckedChangeListener(null); } if (0 != mUrlSpec.length()) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings - .RESOURCE_IDENTIFIER_FORGET_FIRST_PARTY_STORAGE)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings + .RESOURCE_IDENTIFIER_FORGET_FIRST_PARTY_STORAGE)) { braveShieldsForgetFirstPartyStorageSwitch.setChecked(true); } else { braveShieldsForgetFirstPartyStorageSwitch.setChecked(false); @@ -1061,8 +1092,10 @@ private void setupMainSwitchClick(SwitchCompat braveShieldsSwitch) { return; } if (0 != mUrlSpec.length()) { - if (BraveShieldsContentSettings.getShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { + if (BraveShieldsContentSettings.getShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS)) { braveShieldsSwitch.setChecked(true); setUpMainSwitchLayout(true); } else { @@ -1070,26 +1103,29 @@ private void setupMainSwitchClick(SwitchCompat braveShieldsSwitch) { setUpMainSwitchLayout(false); } } - braveShieldsSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, - boolean isChecked) { - if (0 != mUrlSpec.length()) { - BraveShieldsContentSettings.setShields(mProfile, mUrlSpec, - BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS, - isChecked, false); - setupHTTPSEverywhereSwitch(mBraveShieldsHTTPSEverywhereSwitch, true); - setupBlockingScriptsSwitch(mBraveShieldsBlockingScriptsSwitch, true); - setupForgetFirstPartyStorageSwitch( - mBraveShieldsForgetFirstPartyStorageSwitch, true); - if (null != mMenuObserver) { - mMenuObserver.onMenuTopShieldsChanged(isChecked, true); - } - } + braveShieldsSwitch.setOnCheckedChangeListener( + new OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (0 != mUrlSpec.length()) { + BraveShieldsContentSettings.setShields( + mProfile, + mUrlSpec, + BraveShieldsContentSettings.RESOURCE_IDENTIFIER_BRAVE_SHIELDS, + isChecked, + false); + setupHTTPSEverywhereSwitch(mBraveShieldsHTTPSEverywhereSwitch, true); + setupBlockingScriptsSwitch(mBraveShieldsBlockingScriptsSwitch, true); + setupForgetFirstPartyStorageSwitch( + mBraveShieldsForgetFirstPartyStorageSwitch, true); + if (null != mMenuObserver) { + mMenuObserver.onMenuTopShieldsChanged(isChecked, true); + } + } - setUpMainSwitchLayout(isChecked); - } - }); + setUpMainSwitchLayout(isChecked); + } + }); } @Override diff --git a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java index 2cd3e6774828..a7fff5e97d8b 100644 --- a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java +++ b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java @@ -111,7 +111,7 @@ void destroy() { } @Override - public void wipeSyncUserData(Runnable wipeDataCallback) {} + public void wipeSyncUserData(Runnable wipeDataCallback, @DataWipeOption int dataWipeOption) {} @Override public boolean isSyncOptInAllowed() { diff --git a/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java b/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java index 0012147bb54e..2d19785aabfd 100644 --- a/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java +++ b/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java @@ -8,11 +8,14 @@ import android.app.Activity; import android.os.Build; +import androidx.annotation.Nullable; + import org.chromium.base.BraveReflectionUtil; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.compositor.CompositorViewHolder; +import org.chromium.chrome.browser.new_tab_url.DseNewTabUrlManager; import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge; import org.chromium.chrome.browser.ntp_background_images.util.SponsoredImageUtil; import org.chromium.chrome.browser.preferences.BravePref; @@ -26,13 +29,26 @@ import org.chromium.ui.base.WindowAndroid; public class BraveTabCreator extends ChromeTabCreator { - public BraveTabCreator(Activity activity, WindowAndroid nativeWindow, - Supplier tabDelegateFactory, boolean incognito, - OverviewNTPCreator overviewNTPCreator, AsyncTabParamsManager asyncTabParamsManager, + public BraveTabCreator( + Activity activity, + WindowAndroid nativeWindow, + Supplier tabDelegateFactory, + boolean incognito, + OverviewNTPCreator overviewNTPCreator, + AsyncTabParamsManager asyncTabParamsManager, Supplier tabModelSelectorSupplier, - Supplier compositorViewHolderSupplier) { - super(activity, nativeWindow, tabDelegateFactory, incognito, overviewNTPCreator, - asyncTabParamsManager, tabModelSelectorSupplier, compositorViewHolderSupplier); + Supplier compositorViewHolderSupplier, + @Nullable DseNewTabUrlManager dseNewTabUrlManager) { + super( + activity, + nativeWindow, + tabDelegateFactory, + incognito, + overviewNTPCreator, + asyncTabParamsManager, + tabModelSelectorSupplier, + compositorViewHolderSupplier, + dseNewTabUrlManager); } @Override diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarVariationManager.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarVariationManager.java index be2e58e0359e..e297aaeccd50 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarVariationManager.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarVariationManager.java @@ -5,12 +5,9 @@ package org.chromium.chrome.browser.toolbar.bottom; -import org.chromium.chrome.browser.flags.CachedFeatureFlags; - /** * The variation manager helps figure out the current variation and the visibility of buttons on - * bottom toolbar. Every operation related to the variation, e.g. getting variation value, should be - * through {@link BottomToolbarVariationManager} rather than calling {@link CachedFeatureFlags}. + * bottom toolbar. */ public class BottomToolbarVariationManager { /** 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 825a0338b2fd..c88ff3cd3394 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java @@ -422,120 +422,134 @@ public void setTabModelSelector(TabModelSelector selector) { // to proactively update the shields button state here, otherwise shields // might sometimes show as disabled while it is actually enabled. updateBraveShieldsButtonState(getToolbarDataProvider().getTab()); - mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(selector) { - @Override - protected void onTabRegistered(Tab tab) { - super.onTabRegistered(tab); - if (tab.isIncognito()) { - showWalletIcon(false); - } - } - - @Override - public void onShown(Tab tab, @TabSelectionType int type) { - // Update shields button state when visible tab is changed. - updateBraveShieldsButtonState(tab); - // case when window.open is triggered from dapps site and new tab is in focus - if (type != TabSelectionType.FROM_USER) { - dismissWalletPanelOrDialog(); - } - findMediaFiles(tab); - } + mTabModelSelectorTabObserver = + new TabModelSelectorTabObserver(selector) { + @Override + protected void onTabRegistered(Tab tab) { + super.onTabRegistered(tab); + if (tab.isIncognito()) { + showWalletIcon(false); + } + } - @Override - public void onHidden(Tab tab, @TabHidingType int reason) { - hidePlaylistButton(); - } + @Override + public void onShown(Tab tab, @TabSelectionType int type) { + // Update shields button state when visible tab is changed. + updateBraveShieldsButtonState(tab); + // case when window.open is triggered from dapps site and new tab is in + // focus + if (type != TabSelectionType.FROM_USER) { + dismissWalletPanelOrDialog(); + } + findMediaFiles(tab); + } - @Override - public void onPageLoadStarted(Tab tab, GURL url) { - showWalletIcon(false, tab); - if (getToolbarDataProvider().getTab() == tab) { - updateBraveShieldsButtonState(tab); - } - mBraveShieldsHandler.clearBraveShieldsCount(tab.getId()); - dismissShieldsTooltip(); - hidePlaylistButton(); - } + @Override + public void onHidden(Tab tab, @TabHidingType int reason) { + hidePlaylistButton(); + } - @Override - public void onPageLoadFinished(final Tab tab, GURL url) { - if (getToolbarDataProvider().getTab() == tab) { - mBraveShieldsHandler.updateUrlSpec(url.getSpec()); - updateBraveShieldsButtonState(tab); - - if (mBraveShieldsButton != null && mBraveShieldsButton.isShown() - && mBraveShieldsHandler != null && !mBraveShieldsHandler.isShowing()) { - checkForTooltip(tab); + @Override + public void onPageLoadStarted(Tab tab, GURL url) { + showWalletIcon(false, tab); + if (getToolbarDataProvider().getTab() == tab) { + updateBraveShieldsButtonState(tab); + } + mBraveShieldsHandler.clearBraveShieldsCount(tab.getId()); + dismissShieldsTooltip(); + hidePlaylistButton(); } - } - if (mBraveShieldsButton != null && mBraveShieldsButton.isShown() - && mBraveShieldsHandler != null && !mBraveShieldsHandler.isShowing() - && url.getSpec().contains("rewards") - && ((!BravePermissionUtils.hasNotificationPermission(getContext())) - || BraveNotificationWarningDialog.shouldShowRewardWarningDialog( - getContext()))) { - showNotificationNotEarningDialog(); - } + @Override + public void onPageLoadFinished(final Tab tab, GURL url) { + if (getToolbarDataProvider().getTab() == tab) { + mBraveShieldsHandler.updateUrlSpec(url.getSpec()); + updateBraveShieldsButtonState(tab); + + if (mBraveShieldsButton != null + && mBraveShieldsButton.isShown() + && mBraveShieldsHandler != null + && !mBraveShieldsHandler.isShowing()) { + checkForTooltip(tab); + } + } - String countryCode = Locale.getDefault().getCountry(); - if (countryCode.equals(BraveConstants.INDIA_COUNTRY_CODE) - && url.domainIs(YOUTUBE_DOMAIN) - && SharedPreferencesManager.getInstance().readBoolean( - BravePreferenceKeys.BRAVE_AD_FREE_CALLOUT_DIALOG, true)) { - SharedPreferencesManager.getInstance().writeBoolean( - BravePreferenceKeys.BRAVE_OPENED_YOUTUBE, true); - } - } + if (mBraveShieldsButton != null + && mBraveShieldsButton.isShown() + && mBraveShieldsHandler != null + && !mBraveShieldsHandler.isShowing() + && url.getSpec().contains("rewards") + && ((!BravePermissionUtils.hasNotificationPermission(getContext())) + || BraveNotificationWarningDialog + .shouldShowRewardWarningDialog(getContext()))) { + showNotificationNotEarningDialog(); + } - private void showNotificationNotEarningDialog() { - try { - RewardsYouAreNotEarningDialog rewardsYouAreNotEarningDialog = - RewardsYouAreNotEarningDialog.newInstance(); - rewardsYouAreNotEarningDialog.setCancelable(false); - rewardsYouAreNotEarningDialog.show( - BraveActivity.getBraveActivity().getSupportFragmentManager(), - RewardsYouAreNotEarningDialog.RewardsYouAreNotEarningDialogTAG); - - } catch (BraveActivity.BraveActivityNotFoundException | IllegalStateException e) { - Log.e(TAG, "showNotificationNotEarningDialog " + e); - } - } + String countryCode = Locale.getDefault().getCountry(); + if (countryCode.equals(BraveConstants.INDIA_COUNTRY_CODE) + && url.domainIs(YOUTUBE_DOMAIN) + && SharedPreferencesManager.getInstance() + .readBoolean( + BravePreferenceKeys.BRAVE_AD_FREE_CALLOUT_DIALOG, + true)) { + SharedPreferencesManager.getInstance() + .writeBoolean(BravePreferenceKeys.BRAVE_OPENED_YOUTUBE, true); + } + } - @Override - public void onDidFinishNavigationInPrimaryMainFrame( - Tab tab, NavigationHandle navigation) { - if (getToolbarDataProvider().getTab() == tab && mBraveRewardsNativeWorker != null - && !tab.isIncognito()) { - mBraveRewardsNativeWorker.OnNotifyFrontTabUrlChanged( - tab.getId(), tab.getUrl().getSpec()); - } - if (PackageUtils.isFirstInstall(getContext()) && tab.getUrl().getSpec() != null - && (tab.getUrl().getSpec().equals(BraveActivity.BRAVE_REWARDS_SETTINGS_URL)) - && BraveRewardsHelper.shouldShowBraveRewardsOnboardingModal() - && mBraveRewardsNativeWorker != null - && !mBraveRewardsNativeWorker.isRewardsEnabled() - && mBraveRewardsNativeWorker.IsSupported()) { - showOnBoarding(); - } - findMediaFiles(tab); - } + private void showNotificationNotEarningDialog() { + try { + RewardsYouAreNotEarningDialog rewardsYouAreNotEarningDialog = + RewardsYouAreNotEarningDialog.newInstance(); + rewardsYouAreNotEarningDialog.setCancelable(false); + rewardsYouAreNotEarningDialog.show( + BraveActivity.getBraveActivity().getSupportFragmentManager(), + RewardsYouAreNotEarningDialog.RewardsYouAreNotEarningDialogTAG); + + } catch (BraveActivity.BraveActivityNotFoundException + | IllegalStateException e) { + Log.e(TAG, "showNotificationNotEarningDialog " + e); + } + } - @Override - public void onDestroyed(Tab tab) { - // Remove references for the ads from the Database. Tab is destroyed, they are not - // needed anymore. - new Thread() { @Override - public void run() { - mDatabaseHelper.deleteDisplayAdsFromTab(tab.getId()); + public void onDidFinishNavigationInPrimaryMainFrame( + Tab tab, NavigationHandle navigation) { + if (getToolbarDataProvider().getTab() == tab + && mBraveRewardsNativeWorker != null + && !tab.isIncognito()) { + mBraveRewardsNativeWorker.OnNotifyFrontTabUrlChanged( + tab.getId(), tab.getUrl().getSpec()); + } + if (PackageUtils.isFirstInstall(getContext()) + && tab.getUrl().getSpec() != null + && (tab.getUrl() + .getSpec() + .equals(BraveActivity.BRAVE_REWARDS_SETTINGS_URL)) + && BraveRewardsHelper.shouldShowBraveRewardsOnboardingModal() + && mBraveRewardsNativeWorker != null + && !mBraveRewardsNativeWorker.isRewardsEnabled() + && mBraveRewardsNativeWorker.IsSupported()) { + showOnBoarding(); + } + findMediaFiles(tab); } - }.start(); - mBraveShieldsHandler.removeStat(tab.getId()); - mTabsWithWalletIcon.remove(tab.getId()); - } - }; + + @Override + public void onDestroyed(Tab tab) { + // Remove references for the ads from the Database. Tab is destroyed, they + // are not + // needed anymore. + new Thread() { + @Override + public void run() { + mDatabaseHelper.deleteDisplayAdsFromTab(tab.getId()); + } + }.start(); + mBraveShieldsHandler.removeStat(tab.getId()); + mTabsWithWalletIcon.remove(tab.getId()); + } + }; mTabModelSelectorTabModelObserver = new TabModelSelectorTabModelObserver(selector) { @Override diff --git a/android/java/org/chromium/chrome/browser/widget/quickactionsearchandbookmark/QuickActionSearchAndBookmarkWidgetProvider.java b/android/java/org/chromium/chrome/browser/widget/quickactionsearchandbookmark/QuickActionSearchAndBookmarkWidgetProvider.java index b7018978674d..99daf5ce23d5 100644 --- a/android/java/org/chromium/chrome/browser/widget/quickactionsearchandbookmark/QuickActionSearchAndBookmarkWidgetProvider.java +++ b/android/java/org/chromium/chrome/browser/widget/quickactionsearchandbookmark/QuickActionSearchAndBookmarkWidgetProvider.java @@ -30,6 +30,7 @@ import org.json.JSONException; import org.json.JSONObject; +import org.chromium.base.BravePreferenceKeys; import org.chromium.base.ContextUtils; import org.chromium.base.IntentUtils; import org.chromium.base.Log; @@ -452,8 +453,6 @@ private static PendingIntent createPendingIntent(Context context, Intent intent) **/ public static class DataManager { - private static final String TILES = - "org.chromium.chrome.browser.widget.quickactionsearchandbookmark.QuickActionSearchAndBookmarkWidgetProvider.TILES"; public static void parseTilesAndWriteWidgetTiles(List tiles) { List widgetTileList = new ArrayList<>(); for (Tile tile : tiles) { @@ -470,13 +469,20 @@ public static void writeWidgetTiles(List widgetTileList) { widgetTilesJsonArray.put(widgetTile.toJSONObject()); } } - SharedPreferencesManager.getInstance().writeString( - TILES, widgetTilesJsonArray.toString()); + SharedPreferencesManager.getInstance() + .writeString( + BravePreferenceKeys.BRAVE_QUICK_ACTION_SEARCH_AND_BOOKMARK_WIDGET_TILES, + widgetTilesJsonArray.toString()); updateAppWidgets(); } public static List readWidgetTiles() { - String widgetTilesJson = SharedPreferencesManager.getInstance().readString(TILES, null); + String widgetTilesJson = + SharedPreferencesManager.getInstance() + .readString( + BravePreferenceKeys + .BRAVE_QUICK_ACTION_SEARCH_AND_BOOKMARK_WIDGET_TILES, + null); List widgetTileList = new ArrayList(); widgetTilesJson = "{\"widgetTiles\":" + widgetTilesJson + "}"; try { diff --git a/android/java/proguard.flags b/android/java/proguard.flags index d2eee9c07dbd..bfe9f0a95215 100644 --- a/android/java/proguard.flags +++ b/android/java/proguard.flags @@ -9,6 +9,7 @@ # Add methods for invocation below -keep class org.chromium.chrome.browser.ChromeTabbedActivity { *** hideOverview(...); + *** maybeHandleUrlIntent(...); } -keep class org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator { diff --git a/android/java/res/layout/location_status_incognito_badge.xml b/android/java/res/layout/location_status_incognito_badge.xml index 4b92088073eb..587ef4124d8b 100644 --- a/android/java/res/layout/location_status_incognito_badge.xml +++ b/android/java/res/layout/location_status_incognito_badge.xml @@ -11,5 +11,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:visibility="gone" + android:paddingStart="@dimen/incognito_badge_lateral_padding" + android:paddingEnd="@dimen/incognito_badge_lateral_padding" android:contentDescription="@string/accessibility_incognito_badge" android:src="@drawable/incognito_simple" /> diff --git a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java index 721f57a0cf61..85eaed9b8f4d 100644 --- a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java +++ b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java @@ -28,6 +28,8 @@ import org.junit.runner.RunWith; import org.chromium.base.Callback; +import org.chromium.base.jank_tracker.JankTracker; +import org.chromium.base.shared_preferences.PreferenceKeyRegistry; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.supplier.OneshotSupplier; @@ -59,6 +61,7 @@ import org.chromium.chrome.browser.logo.CachedTintedBitmap; import org.chromium.chrome.browser.logo.LogoCoordinator; import org.chromium.chrome.browser.multiwindow.MultiWindowModeStateDispatcher; +import org.chromium.chrome.browser.new_tab_url.DseNewTabUrlManager; import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.omnibox.BackKeyBehaviorDelegate; import org.chromium.chrome.browser.omnibox.BraveLocationBarMediator; @@ -209,10 +212,12 @@ public void testClassesExist() throws Exception { Assert.assertTrue(classExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils")); Assert.assertTrue(classExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge")); Assert.assertTrue(classExists("org/chromium/chrome/browser/bookmarks/BraveBookmarkModel")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/safe_browsing/settings/BraveStandardProtectionSettingsFragment")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/safe_browsing/settings/StandardProtectionSettingsFragment")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/safe_browsing/settings/BraveStandardProtectionSettingsFragment")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/safe_browsing/settings/StandardProtectionSettingsFragment")); Assert.assertTrue( classExists("org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator")); Assert.assertTrue(classExists( @@ -259,8 +264,9 @@ public void testClassesExist() throws Exception { Assert.assertTrue(classExists("org/chromium/chrome/browser/theme/ThemeUtils")); Assert.assertTrue(classExists("org/chromium/chrome/browser/share/ShareDelegateImpl")); Assert.assertTrue(classExists("org/chromium/chrome/browser/share/BraveShareDelegateImpl")); - Assert.assertTrue(classExists( - "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem")); + Assert.assertTrue( + classExists( + "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem")); Assert.assertTrue( classExists("org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider")); Assert.assertTrue(classExists( @@ -270,18 +276,21 @@ public void testClassesExist() throws Exception { classExists("org/chromium/chrome/browser/autofill/BraveAutofillPopupBridge")); Assert.assertTrue( classExists("org/chromium/components/variations/firstrun/VariationsSeedFetcher")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/partnercustomizations/CustomizationProviderDelegateImpl")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/partnercustomizations/BraveCustomizationProviderDelegateImpl")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/partnercustomizations/CustomizationProviderDelegateImpl")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/partnercustomizations/BraveCustomizationProviderDelegateImpl")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/share/send_tab_to_self/ManageAccountDevicesLinkView")); Assert.assertTrue( classExists("org/chromium/chrome/browser/dom_distiller/ReaderModeManager")); Assert.assertTrue( classExists("org/chromium/chrome/browser/dom_distiller/BraveReaderModeManager")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/download/DownloadMessageUiControllerImpl")); Assert.assertTrue(classExists( @@ -294,12 +303,14 @@ public void testClassesExist() throws Exception { "org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediatorBase")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListManager")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListManager")); Assert.assertTrue( classExists("org/chromium/chrome/browser/omnibox/LocationBarCoordinator")); Assert.assertTrue( @@ -325,20 +336,21 @@ public void testClassesExist() throws Exception { classExists("org/chromium/chrome/browser/tracing/settings/DeveloperSettings")); Assert.assertTrue( classExists("org/chromium/chrome/browser/settings/BravePreferenceFragment")); - Assert.assertTrue( - classExists("org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker")); Assert.assertTrue( classExists("org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthCoordinator")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/incognito/reauth/FullScreenIncognitoReauthCoordinator")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthCoordinator")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/incognito/reauth/FullScreenIncognitoReauthCoordinator")); Assert.assertTrue(classExists( "org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinatorBase")); - Assert.assertTrue(classExists( - "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); + Assert.assertTrue( + classExists( + "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); Assert.assertTrue( classExists("org/chromium/chrome/browser/firstrun/BraveFreIntentCreator")); Assert.assertTrue(classExists("org/chromium/chrome/browser/firstrun/FreIntentCreator")); @@ -397,9 +409,12 @@ public void testMethodsExist() throws Exception { Assert.assertTrue(methodExists( "org/chromium/chrome/browser/ui/default_browser_promo/DefaultBrowserPromoUtils", "prepareLaunchPromoIfNeeded", false, null)); - Assert.assertTrue(methodExists( - "org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils", - "prepareLaunchPromoIfNeeded", false, null)); + Assert.assertTrue( + methodExists( + "org/chromium/chrome/browser/ui/default_browser_promo/BraveDefaultBrowserPromoUtils", + "prepareLaunchPromoIfNeeded", + false, + null)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/toolbar/ToolbarManager", "onOrientationChange", false, null)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/toolbar/ToolbarManager", @@ -433,8 +448,6 @@ public void testMethodsExist() throws Exception { Assert.assertTrue(methodExists( "org/chromium/chrome/browser/search_engines/settings/SearchEngineSettings", "createAdapterIfNecessary", false, null)); - Assert.assertTrue(methodExists("org/chromium/chrome/browser/feed/FeedSurfaceMediator", - "destroyPropertiesForStream", false, null)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/theme/ThemeUtils", "getTextBoxColorForToolbarBackgroundInNonNativePage", false, null)); Assert.assertTrue(methodExists( @@ -505,9 +518,13 @@ public void testMethodsExist() throws Exception { "isJavascriptSchemeOrInvalidUrl", true, boolean.class, String.class)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/IntentHandler", "extractUrlFromIntent", true, String.class, Intent.class)); - Assert.assertTrue(methodExists( - "org/chromium/chrome/browser/notifications/permissions/NotificationPermissionRationaleDialogController", - "wrapDialogDismissalCallback", true, Callback.class, Callback.class)); + Assert.assertTrue( + methodExists( + "org/chromium/chrome/browser/notifications/permissions/NotificationPermissionRationaleDialogController", + "wrapDialogDismissalCallback", + true, + Callback.class, + Callback.class)); Assert.assertTrue( methodExists("org/chromium/chrome/browser/download/DownloadMessageUiControllerImpl", "isVisibleToUser", false, null)); @@ -516,12 +533,16 @@ public void testMethodsExist() throws Exception { "isVisibleToUser", false, null)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/logo/LogoMediator", "updateVisibility", true, void.class)); - Assert.assertTrue( - methodExists("org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker", - "getInstance", false, null)); Assert.assertTrue( methodExists("org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator", "onItemSelected", true, boolean.class, int.class)); + Assert.assertTrue( + methodExists( + "org/chromium/base/shared_preferences/StrictPreferenceKeyChecker", + "isKeyInUse", + true, + boolean.class, + String.class)); } @Test @@ -529,7 +550,13 @@ public void testMethodsExist() throws Exception { public void testMethodsForInvocationExist() throws Exception { Assert.assertTrue(methodExists("org/chromium/chrome/browser/ChromeTabbedActivity", "hideOverview", true, void.class)); - + Assert.assertTrue( + methodExists( + "org/chromium/chrome/browser/ChromeTabbedActivity", + "maybeHandleUrlIntent", + true, + boolean.class, + Intent.class)); Assert.assertTrue(methodExists( "org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator", "createViewProvider", true, ViewProvider.class, Context.class, @@ -540,18 +567,24 @@ public void testMethodsForInvocationExist() throws Exception { GURL.class, long.class, boolean.class, boolean.class)); // Check for method type declaration changes here - Assert.assertTrue(methodExists( - "org/chromium/components/browser_ui/site_settings/BraveContentSettingsResources", - "getResourceItem", true, - getClassForPath( - "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem"), - int.class, SiteSettingsDelegate.class)); - Assert.assertTrue(methodExists( - "org/chromium/components/browser_ui/site_settings/ContentSettingsResources", - "getResourceItem", true, - getClassForPath( - "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem"), - int.class, SiteSettingsDelegate.class)); + Assert.assertTrue( + methodExists( + "org/chromium/components/browser_ui/site_settings/BraveContentSettingsResources", + "getResourceItem", + true, + getClassForPath( + "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem"), + int.class, + SiteSettingsDelegate.class)); + Assert.assertTrue( + methodExists( + "org/chromium/components/browser_ui/site_settings/ContentSettingsResources", + "getResourceItem", + true, + getClassForPath( + "org/chromium/components/browser_ui/site_settings/ContentSettingsResources$ResourceItem"), + int.class, + SiteSettingsDelegate.class)); Assert.assertTrue(methodExists( "org/chromium/components/browser_ui/site_settings/SingleCategorySettings", "getAddExceptionDialogMessage", true, String.class)); @@ -580,9 +613,6 @@ public void testMethodsForInvocationExist() throws Exception { Assert.assertTrue(methodExists("org/chromium/components/browser_ui/site_settings/Website", "setContentSetting", true, void.class, BrowserContextHandle.class, int.class, int.class)); - Assert.assertTrue( - methodExists("org/chromium/chrome/browser/paint_preview/StartupPaintPreviewHelper", - "isEnabled", true, boolean.class)); Assert.assertTrue(methodExists("org/chromium/chrome/browser/tab/TabHelpers", "initTabHelpers", true, void.class, Tab.class, Tab.class)); Assert.assertTrue( @@ -607,10 +637,19 @@ public void testConstructorsExistAndMatch() throws Exception { OneshotSupplier.class, OneshotSupplier.class, ObservableSupplier.class, WebFeedSnackbarController.FeedLauncher.class, ModalDialogManager.class, SnackbarManager.class, OneshotSupplier.class, Supplier.class)); - Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/tabmodel/ChromeTabCreator", - "org/chromium/chrome/browser/tabmodel/BraveTabCreator", Activity.class, - WindowAndroid.class, Supplier.class, boolean.class, OverviewNTPCreator.class, - AsyncTabParamsManager.class, Supplier.class, Supplier.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/tabmodel/ChromeTabCreator", + "org/chromium/chrome/browser/tabmodel/BraveTabCreator", + Activity.class, + WindowAndroid.class, + Supplier.class, + boolean.class, + OverviewNTPCreator.class, + AsyncTabParamsManager.class, + Supplier.class, + Supplier.class, + DseNewTabUrlManager.class)); Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/toolbar/ToolbarManager", "org/chromium/chrome/browser/toolbar/BraveToolbarManager", AppCompatActivity.class, BrowserControlsSizer.class, FullscreenManager.class, ToolbarControlContainer.class, @@ -667,13 +706,30 @@ public void testConstructorsExistAndMatch() throws Exception { LocationBarDataProvider.class, PermissionDialogController.class, SearchEngineLogoUtils.class, OneshotSupplier.class, Supplier.class, PageInfoIPHController.class, WindowAndroid.class, Supplier.class)); - Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/ntp/NewTabPage", - "org/chromium/chrome/browser/ntp/BraveNewTabPage", Activity.class, - BrowserControlsStateProvider.class, Supplier.class, SnackbarManager.class, - ActivityLifecycleDispatcher.class, TabModelSelector.class, boolean.class, - NewTabPageUma.class, boolean.class, NativePageHost.class, Tab.class, String.class, - BottomSheetController.class, Supplier.class, WindowAndroid.class, Supplier.class, - SettingsLauncher.class, HomeSurfaceTracker.class, ObservableSupplier.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/ntp/NewTabPage", + "org/chromium/chrome/browser/ntp/BraveNewTabPage", + Activity.class, + BrowserControlsStateProvider.class, + Supplier.class, + SnackbarManager.class, + ActivityLifecycleDispatcher.class, + TabModelSelector.class, + boolean.class, + NewTabPageUma.class, + boolean.class, + NativePageHost.class, + Tab.class, + String.class, + BottomSheetController.class, + Supplier.class, + WindowAndroid.class, + JankTracker.class, + Supplier.class, + SettingsLauncher.class, + HomeSurfaceTracker.class, + ObservableSupplier.class)); Assert.assertTrue(constructorsMatch( "org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator", "org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator", @@ -704,26 +760,47 @@ public void testConstructorsExistAndMatch() throws Exception { constructorsMatch("org/chromium/chrome/browser/autofill/AutofillPopupBridge", "org/chromium/chrome/browser/autofill/BraveAutofillPopupBridge", View.class, long.class, WindowAndroid.class)); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator", - "org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator", - Context.class, AutocompleteControllerProvider.class, AutocompleteDelegate.class, - UrlBarEditingTextStateProvider.class, PropertyModel.class, Handler.class, - Supplier.class, Supplier.class, Supplier.class, LocationBarDataProvider.class, - Callback.class, Supplier.class, BookmarkState.class, OmniboxActionDelegate.class, - OpenHistoryClustersDelegate.class)); - Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/feed/FeedSurfaceMediator", - "org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator", - FeedSurfaceCoordinator.class, Context.class, SnapScrollHelper.class, - PropertyModel.class, int.class, FeedActionDelegate.class, - FeedOptionsCoordinator.class)); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/partnercustomizations/CustomizationProviderDelegateImpl", - "org/chromium/chrome/browser/partnercustomizations/BraveCustomizationProviderDelegateImpl")); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/share/send_tab_to_self/ManageAccountDevicesLinkView", - "org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView", - Context.class, AttributeSet.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator", + "org/chromium/chrome/browser/omnibox/suggestions/BraveAutocompleteMediator", + Context.class, + AutocompleteControllerProvider.class, + AutocompleteDelegate.class, + UrlBarEditingTextStateProvider.class, + PropertyModel.class, + Handler.class, + Supplier.class, + Supplier.class, + Supplier.class, + LocationBarDataProvider.class, + Callback.class, + Supplier.class, + BookmarkState.class, + OmniboxActionDelegate.class, + OpenHistoryClustersDelegate.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/feed/FeedSurfaceMediator", + "org/chromium/chrome/browser/feed/BraveFeedSurfaceMediator", + FeedSurfaceCoordinator.class, + Context.class, + SnapScrollHelper.class, + PropertyModel.class, + int.class, + FeedActionDelegate.class, + FeedOptionsCoordinator.class, + UiConfig.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/partnercustomizations/CustomizationProviderDelegateImpl", + "org/chromium/chrome/browser/partnercustomizations/BraveCustomizationProviderDelegateImpl")); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/share/send_tab_to_self/ManageAccountDevicesLinkView", + "org/chromium/chrome/browser/share/send_tab_to_self/BraveManageAccountDevicesLinkView", + Context.class, + AttributeSet.class)); Assert.assertTrue(constructorsMatch( "org/chromium/chrome/browser/suggestions/tile/MostVisitedTilesMediator", "org/chromium/chrome/browser/suggestions/tile/BraveMostVisitedTilesMediator", @@ -737,14 +814,19 @@ public void testConstructorsExistAndMatch() throws Exception { Assert.assertTrue(constructorsMatch( "org/chromium/chrome/browser/crash/ChromePureJavaExceptionReporter", "org/chromium/chrome/browser/crash/BravePureJavaExceptionReporter")); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder", - "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder", - Supplier.class, BookmarkState.class, OpenHistoryClustersDelegate.class)); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager", - "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListManager", - ModelList.class, Context.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder", + "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder", + Supplier.class, + BookmarkState.class, + OpenHistoryClustersDelegate.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager", + "org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListManager", + ModelList.class, + Context.class)); Assert.assertTrue(constructorsMatch( "org/chromium/chrome/browser/omnibox/LocationBarCoordinator", "org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator", View.class, @@ -774,9 +856,6 @@ public void testConstructorsExistAndMatch() throws Exception { BraveLocationBarMediator.getOmniboxUmaClass(), BooleanSupplier.class, BraveLocationBarMediator.getOmniboxSuggestionsDropdownEmbedderImplClass(), ObservableSupplier.class)); - Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/IntentHandler", - "org/chromium/chrome/browser/BraveIntentHandler", Activity.class, - IntentHandler.IntentHandlerDelegate.class)); Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/AppHooksImpl", "org/chromium/chrome/browser/BraveAppHooks")); Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/flags/CachedFlag", @@ -788,10 +867,12 @@ public void testConstructorsExistAndMatch() throws Exception { "org/chromium/chrome/browser/logo/BraveLogoMediator", Context.class, Callback.class, PropertyModel.class, boolean.class, Callback.class, Runnable.class, boolean.class, LogoCoordinator.VisibilityObserver.class, CachedTintedBitmap.class)); - Assert.assertTrue(constructorsMatch( - "org/chromium/chrome/browser/notifications/permissions/NotificationPermissionRationaleDialogController", - "org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController", - Context.class, ModalDialogManager.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/chrome/browser/notifications/permissions/NotificationPermissionRationaleDialogController", + "org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController", + Context.class, + ModalDialogManager.class)); Assert.assertTrue(constructorsMatch( "org/chromium/chrome/browser/notifications/StandardNotificationBuilder", "org/chromium/chrome/browser/notifications/BraveNotificationBuilder", @@ -859,6 +940,11 @@ public void testConstructorsExistAndMatch() throws Exception { "org/chromium/chrome/browser/contextmenu/BraveChromeContextMenuPopulator", ContextMenuItemDelegate.class, Supplier.class, int.class, ExternalAuthUtils.class, Context.class, ContextMenuParams.class, ContextMenuNativeDelegate.class)); + Assert.assertTrue( + constructorsMatch( + "org/chromium/base/shared_preferences/StrictPreferenceKeyChecker", + "org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker", + PreferenceKeyRegistry.class)); } @Test @@ -1021,6 +1107,10 @@ public void testFieldsExist() throws Exception { Assert.assertTrue( fieldExists("org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator", "mDropdownViewInfoListManager")); + Assert.assertTrue( + fieldExists( + "org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator", + "mDropdownViewInfoListBuilder")); Assert.assertTrue( fieldExists("org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator", "mContext")); @@ -1032,8 +1122,9 @@ public void testFieldsExist() throws Exception { fieldExists("org/chromium/chrome/browser/dom_distiller/ReaderModeManager", "mTab")); Assert.assertTrue(fieldExists("org/chromium/chrome/browser/omnibox/LocationBarCoordinator", "mLocationBarMediator")); - Assert.assertTrue(fieldExists( - "org/chromium/chrome/browser/omnibox/LocationBarCoordinator", "mUrlBar")); + Assert.assertTrue( + fieldExists( + "org/chromium/chrome/browser/omnibox/LocationBarCoordinator", "mUrlBar")); Assert.assertTrue(fieldExists( "org/chromium/chrome/browser/omnibox/LocationBarMediator", "mNativeInitialized")); Assert.assertTrue(fieldExists( @@ -1092,9 +1183,10 @@ public void testSuperNames() throws Exception { Assert.assertTrue(checkSuperName( "org/chromium/chrome/browser/password_manager/settings/PasswordSettings", "org/chromium/chrome/browser/password_manager/settings/BravePasswordSettingsBase")); - Assert.assertTrue(checkSuperName( - "org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter", - "org/chromium/chrome/browser/search_engines/settings/BraveBaseSearchEngineAdapter")); + Assert.assertTrue( + checkSuperName( + "org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter", + "org/chromium/chrome/browser/search_engines/settings/BraveBaseSearchEngineAdapter")); Assert.assertTrue(checkSuperName( "org/chromium/components/browser_ui/site_settings/SingleCategorySettings", "org/chromium/components/browser_ui/site_settings/BraveSingleCategorySettings")); @@ -1124,12 +1216,14 @@ public void testSuperNames() throws Exception { "org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings")); Assert.assertTrue(checkSuperName("org/chromium/components/browser_ui/site_settings/Website", "org/chromium/components/browser_ui/site_settings/BraveWebsite")); - Assert.assertTrue(checkSuperName( - "org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference", - "org/chromium/components/browser_ui/site_settings/BraveFourStateCookieSettingsPreferenceBase")); - Assert.assertTrue(checkSuperName( - "org/chromium/components/browser_ui/site_settings/SiteSettings", - "org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase")); + Assert.assertTrue( + checkSuperName( + "org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference", + "org/chromium/components/browser_ui/site_settings/BraveFourStateCookieSettingsPreferenceBase")); + Assert.assertTrue( + checkSuperName( + "org/chromium/components/browser_ui/site_settings/SiteSettings", + "org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase")); Assert.assertTrue( checkSuperName("org/chromium/chrome/browser/infobar/TranslateCompactInfoBar", "org/chromium/chrome/browser/infobar/BraveTranslateCompactInfoBarBase")); @@ -1158,12 +1252,14 @@ public void testSuperNames() throws Exception { Assert.assertTrue( checkSuperName("org/chromium/chrome/browser/tracing/settings/DeveloperSettings", "org/chromium/chrome/browser/settings/BravePreferenceFragment")); - Assert.assertTrue(checkSuperName( - "org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthCoordinator", - "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); - Assert.assertTrue(checkSuperName( - "org/chromium/chrome/browser/incognito/reauth/FullScreenIncognitoReauthCoordinator", - "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); + Assert.assertTrue( + checkSuperName( + "org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthCoordinator", + "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); + Assert.assertTrue( + checkSuperName( + "org/chromium/chrome/browser/incognito/reauth/FullScreenIncognitoReauthCoordinator", + "org/chromium/chrome/browser/incognito/reauth/BravePrivateTabReauthCoordinatorBase")); Assert.assertTrue(checkSuperName("org/chromium/chrome/browser/bookmarks/BookmarkModel", "org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge")); Assert.assertTrue( diff --git a/android/javatests/org/chromium/chrome/browser/privacy/settings/BravePrivacySettingsTest.java b/android/javatests/org/chromium/chrome/browser/privacy/settings/BravePrivacySettingsTest.java index ea06580ca7c8..df0310984012 100644 --- a/android/javatests/org/chromium/chrome/browser/privacy/settings/BravePrivacySettingsTest.java +++ b/android/javatests/org/chromium/chrome/browser/privacy/settings/BravePrivacySettingsTest.java @@ -44,7 +44,7 @@ public class BravePrivacySettingsTest { private static final String PREF_INCOGNITO_LOCK = "incognito_lock"; private static final String PREF_PHONE_AS_A_SECURITY_KEY = "phone_as_a_security_key"; - private static final int BRAVE_PRIVACY_SETTINGS_NUMBER_OF_ITEMS = 29; + private static final int BRAVE_PRIVACY_SETTINGS_NUMBER_OF_ITEMS = 30; private int mItemsLeft; diff --git a/app/app_management_strings.grdp b/app/app_management_strings.grdp index 3d313dc47333..40840fd395e9 100644 --- a/app/app_management_strings.grdp +++ b/app/app_management_strings.grdp @@ -109,9 +109,6 @@ App details - - This app is preinstalled on your device - Android App @@ -136,6 +133,9 @@ $1Web App installed from <a href="#">$2Google Play Store</a> + + $1ChromeOS System App preinstalled on your $2Chromebook + Version: $117.2 @@ -213,8 +213,8 @@ Permissions that you allow for $1Citrix will also be allowed for its installed and streamed apps. - - Permissions that you allow for $1Citrix will also be allowed for this app. + + Permissions that you allow for $1Citrix will also be allowed for this app. <a href="#">Manage</a> diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index 5d1ded7cd76f..aa1e47107024 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -117,11 +117,16 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &android_webview::features::kWebViewMeasureScreenCoverage, #endif &apps::features::kLinkCapturingInfoBar, - &attribution_reporting::kAttributionReportingNullAggregatableReports, + &attribution_reporting::features:: + kAttributionReportingNullAggregatableReports, + &attribution_reporting::features::kConversionMeasurement, &autofill::features::kAutofillEnableOfferNotificationForPromoCodes, &autofill::features::kAutofillEnableRemadeDownstreamMetrics, &autofill::features::test::kAutofillServerCommunication, &autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains, +#if BUILDFLAG(IS_ANDROID) + &base::features::kCollectAndroidFrameTimelineMetrics, +#endif &blink::features::kAdAuctionReportingWithMacroApi, &blink::features::kAdInterestGroupAPI, &blink::features::kAllowURNsInIframes, @@ -132,7 +137,6 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &blink::features::kClientHintsFormFactor, &blink::features::kClientHintsMetaEquivDelegateCH, &blink::features::kComputePressure, - &blink::features::kConversionMeasurement, &blink::features::kCssSelectorFragmentAnchor, &blink::features::kEventTimingReportAllEarlyEntriesOnPaintedPresentation, &blink::features::kFencedFrames, @@ -163,8 +167,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &companion::features::internal::kSidePanelCompanion, &companion::features::internal::kSidePanelCompanion2, &companion::visual_search::features::kVisualSearchSuggestions, - &content::kServiceWorkerAutoPreload, - &content_settings::features::kThirdPartyCookieDeprecationCookieSettings, + &content_settings::features::kTrackingProtection3pcd, &content_settings::features::kUserBypassUI, &enterprise_connectors::kLocalContentAnalysisEnabled, #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) @@ -201,6 +204,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &features::kOmniboxTriggerForNoStatePrefetch, &features::kOmniboxTriggerForPrerender2, &features::kPerformanceSettingsPreloadingSubpage, + &features::kPowerBookmarksSidePanel, &features::kPrivacyGuide3, #if BUILDFLAG(IS_ANDROID) &features::kPrivacyGuideAndroidPostMVP, @@ -210,7 +214,9 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &features::kPrivacyGuidePreloadAndroid, #endif &features::kPrivacySandboxAdsAPIsOverride, + &features::kResourceTimingForCancelledNavigationInFrame, &features::kSCTAuditing, + &features::kServiceWorkerAutoPreload, &features::kSignedExchangeReportingForDistributors, &features::kSignedHTTPExchange, &features::kSupportSearchSuggestionForPrerender2, @@ -234,6 +240,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &history_clusters::internal::kJourneys, &history_clusters::internal::kJourneysImages, &history_clusters::internal::kJourneysNamedNewTabGroups, + &history_clusters::internal::kJourneysPersistCachesToPrefs, &history_clusters::internal::kJourneysZeroStateFiltering, &history_clusters::internal::kOmniboxAction, &history_clusters::internal::kOmniboxHistoryClusterProvider, @@ -249,9 +256,10 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &lens::features::kLensStandalone, &media::kLiveCaption, &net::features::kEnableWebTransportDraft07, - &net::features::kNoncedPartitionedCookies, &net::features::kPartitionedCookies, &net::features::kThirdPartyPartitionedStorageAllowedByDefault, + &net::features::kThirdPartyStoragePartitioning, + &net::features::kWaitForFirstPartySetsInit, &network::features::kFledgePst, &network::features::kPrivateStateTokens, &network_time::kNetworkTimeServiceQuerying, @@ -285,13 +293,15 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { #endif &permissions::features::kPermissionOnDeviceNotificationPredictions, &permissions::features::kPermissionStorageAccessAPI, - &privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting, &privacy_sandbox::kEnforcePrivacySandboxAttestations, + &privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting, + &privacy_sandbox::kPrivacySandboxFirstPartySetsUI, + &privacy_sandbox::kPrivacySandboxProactiveTopicsBlocking, &privacy_sandbox::kPrivacySandboxSettings3, &privacy_sandbox::kPrivacySandboxSettings4, + &privacy_sandbox::kTrackingProtectionOnboardingForceEligibility, &promos_features::kIOSPromoPasswordBubble, &safe_browsing::kExtensionTelemetry, - &safe_browsing::kExtensionTelemetryDeclarativeNetRequestSignal, &safe_browsing::kExtensionTelemetryDisableOffstoreExtensions, &safe_browsing::kExtensionTelemetryTabsApiSignal, &segmentation_platform::features::kSegmentationPlatformCollectTabRankData, diff --git a/app/brave_strings.grd b/app/brave_strings.grd index f4d0355dfa8c..6590a8ffea23 100644 --- a/app/brave_strings.grd +++ b/app/brave_strings.grd @@ -4,7 +4,7 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> - + @@ -712,6 +712,26 @@ Permissions you've already given to websites and apps may apply to this account. Brave recommends scanning this file because it may be dangerous. + + + Brave blocked this download because the file type isn't commonly downloaded and it may be dangerous + + + Brave blocked this download because the file is dangerous + + + Brave blocked this download because the file isn't commonly downloaded and it may be dangerous + + + Brave blocked this download because the file is deceptive and may make unexpected changes to your device + + + Brave blocked this download because the site isn't using a secure connection and the file may have been tampered with + + + Brave blocked this download because you turned Safe Browsing off and the file can't be verified + + @@ -744,7 +764,7 @@ Permissions you've already given to websites and apps may apply to this account. - Also clear data from Brave ($1www.google.com) + Also delete data from Brave ($1www.google.com) @@ -993,15 +1013,6 @@ Permissions you've already given to websites and apps may apply to this account. - - - - There's harmful software on your computer. Brave can remove it, restore your settings, and disable extensions to make your browser work normally again. - - - diff --git a/app/brave_strings_override.grd b/app/brave_strings_override.grd index 9636e8063965..07ef059bb88f 100644 --- a/app/brave_strings_override.grd +++ b/app/brave_strings_override.grd @@ -252,9 +252,6 @@ Permissions you've already given to websites and apps may apply to this account. - - - diff --git a/app/command_utils.cc.template b/app/command_utils.cc.template index 03105664ac4c..1771a89acdda 100644 --- a/app/command_utils.cc.template +++ b/app/command_utils.cc.template @@ -14,7 +14,7 @@ #include "brave/components/commander/common/buildflags/buildflags.h" #include "brave/components/commands/common/features.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #include "components/grit/brave_components_strings.h" #include "components/strings/grit/components_strings.h" diff --git a/app/extensions_strings.grdp b/app/extensions_strings.grdp index 2a53a2e49aae..86f4ca6ad868 100644 --- a/app/extensions_strings.grdp +++ b/app/extensions_strings.grdp @@ -585,7 +585,9 @@ Remove all - All done for now + {NUM_EXTENSIONS, plural, + =1 {1 extension reviewed} + other {{NUM_EXTENSIONS} extensions reviewed}} All Extensions diff --git a/app/generated_resources.grd b/app/generated_resources.grd index fa82645ede10..416c465fab03 100644 --- a/app/generated_resources.grd +++ b/app/generated_resources.grd @@ -760,12 +760,6 @@ are declared in tools/grit/grit_rule.gni. Extract text from PDF - - Always - - - Just once - Recognize visual layout semantics @@ -1050,12 +1044,6 @@ are declared in tools/grit/grit_rule.gni. Extract Text From PDF - - Always - - - Just once - Recognize Visual Layout Semantics @@ -2106,9 +2094,6 @@ are declared in tools/grit/grit_rule.gni. Scanning for malware... - - This file could let attackers steal your personal information. - This file might be a virus or malware. You can send it to Brave to check if it's unsafe. @@ -2307,6 +2292,21 @@ are declared in tools/grit/grit_rule.gni. Open anyway + + Download dangerous file + + + Download suspicious file + + + Download unverified file + + + Download insecure file + + + Delete from history + @@ -3617,6 +3617,15 @@ are declared in tools/grit/grit_rule.gni. See how + + Reminder: Tracking Protection is on + + + If a site you visit isn't working as expected, try temporarily allowing third-party cookies for that site. That will mean less protection but site features are more likely to work as expected. + + + If a site isn't working as expected, you can enable third-party cookies for it by selecting third-party cookie blocking in the search and address bar. + @@ -6436,6 +6445,15 @@ Keep your key file in a safe place. You will need it to create new versions of y Save username? + + Add username? + + + Add Username + + + To help Brave Password Manager save your sing-in info, add your username for this site + Update password? @@ -6459,12 +6477,6 @@ Keep your key file in a safe place. You will need it to create new versions of y Update password for $1example.com? - - Save it in your Brave sync chain, $1user@gmail.com - - - Update it in your Brave sync chain, $1user@gmail.com - Passwords are saved in your Brave sync chain so you can use them on any device @@ -7516,7 +7528,7 @@ Keep your key file in a safe place. You will need it to create new versions of y From your Google Drive - From Your Drive + From your Drive You’re seeing suggested files to help you easily get back to your most recent activity in Google Drive. @@ -7698,10 +7710,10 @@ Keep your key file in a safe place. You will need it to create new versions of y Following - - Resume your journey for $1Office Chairs + + Resume browsing - + Resume browsing for $1Office Chairs @@ -7710,13 +7722,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Bookmarked - - You’re seeing pages you've visited and suggested searches to help you easily get back to your most recent activity in Brave Journeys. - <br> - <br> - You can manage settings from the card menu or see more options in Customize Brave. - - + You’re seeing pages you've visited and suggested searches to help you easily get back to your most recent activity. <br> <br> @@ -7737,9 +7743,6 @@ Keep your key file in a safe place. You will need it to create new versions of y No longer interested - - Journeys card - this card @@ -7909,8 +7912,11 @@ Keep your key file in a safe place. You will need it to create new versions of y Brave Search side panel - - Get additional useful info as you explore this page + + Get a page summary, related searches, and other useful info about this page + + + To get a page summary, related searches, and other useful info about this page, select Brave Search side panel button in the toolbar Can't load this panel right now @@ -8193,8 +8199,14 @@ Keep your key file in a safe place. You will need it to create new versions of y Getting ready - - Back + + Reset + + + Turn off highlight + + + Turn on highlight To show a simplified view of this page, open the side panel and select Reading mode @@ -8297,6 +8309,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Extensions + + Hidden toolbar buttons + Extensions are blocked on this site @@ -8428,6 +8443,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Search tabs + + Organize tabs + + + Organize tabs? + @@ -8613,6 +8634,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Search tabs + + Organize tabs + Scroll towards the first tab @@ -9187,10 +9211,7 @@ Check your passwords anytime in $1Brave P Use a passkey on a different device - - Password will be saved in your Brave sync chain, $1user@gmail.com. You won’t have to remember it. - - + You won’t need to remember this password. It will be saved to Brave Password Manager for $1user@gmail.com. @@ -9489,55 +9510,6 @@ Check your passwords anytime in $1Brave P Report an issue - - - - Details - - - Remove - - - Remove harmful software? - - - To finish removing harmful software, restart your computer - - - Restart computer - - - Report details to Brave - - - - - - Restore default search engine? - - - Restore default startup page? - - - Restore default homepage? - - - Restore - - - - Your search engine was changed to $1www.some-domain.com. - - - Your startup page was changed to $1www.some-domain.com. - - - Your startup pages were changed to include $1www.some-domain.com. - - - Your homepage was changed to $1www.some-domain.com. - - Turn on autoupdate @@ -9605,6 +9577,9 @@ Check your passwords anytime in $1Brave P Next slide + + Enter picture-in-picture automatically, so you can use it on top of other tabs and windows. + @@ -9930,6 +9905,27 @@ Check your passwords anytime in $1Brave P Collapse recently closed + + All Tabs + + + Organize Tabs + + + Create group + + + Dismiss + + + Organize tabs + + + You can organize your tabs anytime + + + Organize tabs + @@ -10978,6 +10974,12 @@ Check your passwords anytime in $1Brave P Your <a href="$1">browser is managed</a> by your parent + + Browser managed by an organization, profile managed by $1bar.com + + + Browser managed by $1foo.com, profile managed by $2bar.com + @@ -13728,9 +13730,6 @@ Please help our engineers fix this problem. Tell us what happened right before y $1Virtual COM Port ($2COM1) - - $1COM1 - Connect @@ -14059,6 +14058,11 @@ Please help our engineers fix this problem. Tell us what happened right before y View files + + + View and edit files from the last time you visited this site: + + This page is allowed to edit files @@ -15197,10 +15201,52 @@ Please help our engineers fix this problem. Tell us what happened right before y You can use your $1idp.example account on this site. To continue, sign in to $1idp.example. - Cannot continue with $1idp.example. + Can't continue with $1idp.example - Something went wrong. + Something went wrong + + + $1rp.example can't continue using $2idp.example + + + This option is unavailable right now. + + + $1rp.example can't continue using $2idp.example + + + This option is unavailable right now. + + + Check that you chose the right account + + + Check if the selected account is supported. + + + Check your internet connection + + + If you're online but this issue keeps happening, you can try other ways to continue on $1rp.example. + + + Try again later + + + $1idp.example isn't available right now. + + + Got it + + + More details + + + If this issue keeps happening, choose "More details" below to get more information from $1idp.example. + + + If this issue keeps happening, you can try other ways to continue on $1rp.example. Sign in to $1rp.example @@ -15531,41 +15577,33 @@ Please help our engineers fix this problem. Tell us what happened right before y - - - - Lorem ipsum dolor sit amet - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut - - - labore - - - Lorem ipsum - - - Lorem ipsum dolor sit amet - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris. - - - <b>Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolorin reprehenderit in voluptate</b> velit esse cillum dolore eufugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,sunt in culpa qui officia deserunt mollit anim id est laborum. - - - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque. - - - Lorem ipsum - - - Protected Audiences Debugging is enabled. + + + + Lorem Ipsum + + + Lorem Ipsum + + + Lorem Ipsum or whatever + + + For $1test@example.test + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + + + Dolor + + + Sit + diff --git a/app/generated_resources_override.grd b/app/generated_resources_override.grd index 8f5235d403d2..3fd01c70e3bf 100644 --- a/app/generated_resources_override.grd +++ b/app/generated_resources_override.grd @@ -763,9 +763,6 @@ are declared in tools/grit/grit_rule.gni. - - - @@ -1236,9 +1233,6 @@ are declared in tools/grit/grit_rule.gni. - - - diff --git a/app/nearby_share_strings.grdp b/app/nearby_share_strings.grdp index 209985474b26..743b02dcbb47 100644 --- a/app/nearby_share_strings.grdp +++ b/app/nearby_share_strings.grdp @@ -305,6 +305,9 @@ Current visibility setting is your devices + + Visible to all contacts + Hidden diff --git a/app/os_settings_search_tag_strings.grdp b/app/os_settings_search_tag_strings.grdp index a1e42c090393..eb5fd03873da 100644 --- a/app/os_settings_search_tag_strings.grdp +++ b/app/os_settings_search_tag_strings.grdp @@ -283,12 +283,6 @@ Smart Lock - - Messages - - - Android messages - Smart Lock screen lock options @@ -1123,6 +1117,9 @@ Disconnect Google Drive account + + Remove Google Drive access + Network file shares @@ -1135,6 +1132,12 @@ Google Drive settings + + File sync + + + Offline + diff --git a/app/os_settings_strings.grdp b/app/os_settings_strings.grdp index c228fd5d924a..49fc8f599ad0 100644 --- a/app/os_settings_strings.grdp +++ b/app/os_settings_strings.grdp @@ -791,8 +791,8 @@ Manage user dictionaries - - Clear personalization data... + + Delete personalization data... Add your own words to the user dictionaries in order to customize the conversion candidates. @@ -898,6 +898,9 @@ Wallpaper and style + + Dark theme, screen saver + Set your wallpaper & style @@ -1130,7 +1133,7 @@ Signed in as <strong>$1john@google.com</strong> - + Add your Microsoft account @@ -1151,10 +1154,10 @@ Microsoft 365 files - + Ask before copying or moving Microsoft files to Google Drive - + Ask before copying or moving Microsoft files to Microsoft OneDrive @@ -1176,6 +1179,15 @@ Show large mouse cursor + + Face tracking + + + Control your cursor and keyboard with face movements + + + Face tracking settings + Cursor size @@ -2767,6 +2779,12 @@ Press an assigned switch or key to remove assignment. New button name + + Enter key combination + + + Click additional buttons on your $1MX Anywhere 2S to add or locate buttons. + @@ -3177,6 +3195,9 @@ Press an assigned switch or key to remove assignment. Scroll acceleration <a>Learn more</a> + + Controlled scrolling <a>Learn more</a> + Cursor speed @@ -3309,10 +3330,113 @@ Press an assigned switch or key to remove assignment. Disabled + + + F11 + + + F12 + + + search + shift + $1back + + + launcher + shift + $1refresh + + + search + alt + $1back + + + launcher + alt + $1refresh + + + search + ctrl + shift + $1back + + + launcher + ctrl + shift + $1refresh + + + shift + $1back + + + alt + $1back + + + ctrl + shift + $1refresh + + + back + + + forward + + + fullscreen + + + keyboard brightness down + + + keyboard backlight toggle + + + keyboard brightness up + + + microphone mute + + + mute + + + overview + + + play/pause + + + privacy screen toggle + + + refresh + + + screenshot + + + display brightness down + + + display brightness up + + + screen mirror + + + next track + + + previous track + + + volume down + + + volume up + + + all applications + + + emoji pciker + + + dictation + - Printers and Scanners + Printers and scanners Print server @@ -4375,6 +4499,9 @@ Press an assigned switch or key to remove assignment. Android phone + + + Android phone ($1Android phone) Enabled @@ -4382,6 +4509,9 @@ Press an assigned switch or key to remove assignment. Disabled + + Connect to your phone + Connected phone features enable. @@ -4391,11 +4521,17 @@ Press an assigned switch or key to remove assignment. Connect to the internet through your phone - - Messages + + Connected to internet through $1Android phone + + + Connecting to $1Android phone - - Send and receive text messages from your $1Chromebook. <a target="_blank" href="$2https://google.com/">Learn more</a> + + No network through $1Android phone + + + Connect to the internet through your phone Phone Hub @@ -5330,6 +5466,14 @@ Press an assigned switch or key to remove assignment. Confirm your PIN + + + Set device password + + + Internal error + + Set up your fingerprint @@ -5502,6 +5646,9 @@ Press an assigned switch or key to remove assignment. Keyboard + + Keyboard and inputs + Ctrl @@ -5625,6 +5772,15 @@ Press & hold keyboard keys to see accent marks and special characters. This Notifications + + Manage isolated web apps (beta) + + + Isolated web apps (beta) + + + Packaged web applications with enhanced capabilities. <a target="_blank" href="$1">Learn more</a> + Manage app notifications, Do not disturb, and app badging @@ -5652,6 +5808,9 @@ Press & hold keyboard keys to see accent marks and special characters. This Show dot on app icon for app alerts + + Turn on isolated web apps + Google Play Store @@ -5793,11 +5952,23 @@ Press & hold keyboard keys to see accent marks and special characters. This Help improve ChromeOS Flex features and performance + + Send crash reports and diagnostic and usage data to ChromeOS Flex + + + Help improve ChromeOS Flex features and performance. Data is aggregated and highly protected. + Help improve ChromeOS features and performance + + Send crash reports and diagnostic and usage data to ChromeOS + + + Help improve ChromeOS features and performance. Data is aggregated and highly protected. + Automatically sends crash reports as well as diagnostic and usage data to Brave @@ -5805,33 +5976,57 @@ Press & hold keyboard keys to see accent marks and special characters. This Suggest new content to explore + + Get content recommendations + Includes apps, webpages, and more. Sends statistics to improve suggestions only if you’ve chosen to share usage data. + + See suggestions for new apps and web content in Launcher and search results. Sends statistics to improve suggestions only if you have chosen to send crash reports and diagnostics and usage data to ChromeOS. + Enable Verified Access Data access protection for peripherals + + Block external accessories from accessing and sharing memory (RAM) + Some devices require you to disable data access protection to work properly or at full performance. + + Some Thunderbolt or USB4 accessories need memory access to work properly. + Disable data access protection for peripherals + + Allow external accessories to access memory? + Disabling can make your peripherals perform better, but may expose your personal data through unauthorized usage. - + + External accessories may be able to access or share personal data. + + Your displays and peripherals may reset briefly. For this change to take effect, unplug and replug your peripherals. + + For this change to take effect, reconnect your external accessories. + Cancel Disable + + Allow + Screen privacy @@ -5910,9 +6105,21 @@ Press & hold keyboard keys to see accent marks and special characters. This Let Brave use your hardware data to help improve $1ChromeOS Flex. If you decline, this data is still sent to Brave to determine proper updates, but is not stored or used otherwise. + + Websites + + + Manage site microphone permissions in Brave + + + No website is allowed to use your microphone + + + Startup + Restore apps on startup @@ -5934,7 +6141,7 @@ Press & hold keyboard keys to see accent marks and special characters. This - System Preferences + System preferences Storage and power diff --git a/app/password_manager_ui_strings.grdp b/app/password_manager_ui_strings.grdp index 86ef76ba75dd..a05bdd70c2b3 100644 --- a/app/password_manager_ui_strings.grdp +++ b/app/password_manager_ui_strings.grdp @@ -67,17 +67,20 @@ Password was not shared - + For now, you can only share passwords with family members. <a href="$1" target="_blank">Create a family group</a> with up to 6 members, and get more from your products and subscriptions across Brave. + + For now, you can only share passwords with family members. <a href="$1" target="_blank">Invite family members</a> to join your group, and get more from your products and subscriptions across Brave. + When you share a copy of your <b>username</b> and <b>password</b>, your family member can fill them using Brave Password Manager - <b>$1</b>John Doe can now use your username and password when they use Brave Password Manager to sign in to <b>$2</b>website.com. <a href="$3" target="_blank">Learn more</a> + <b>$1</b>John Doe can now use your username and password when they use Brave Password Manager. Tell them to go to <b>$2</b>website.com to sign in. <a href="$3" target="_blank">Learn more</a> - Your family members can now use your username and password when they use Brave Password Manager to sign in to <b>$1</b>website.com. <a href="$2" target="_blank">Learn more</a> + Your family members can now use your username and password when they use Brave Password Manager. Tell them to go to <b>$1</b>website.com to sign in. <a href="$2" target="_blank">Learn more</a> To stop others from using your password, change it on <a href="$1" target="_blank">$2</a>website.com @@ -85,8 +88,8 @@ To stop others from using your password, open the app to change your password - - Manage family + + View family Your family member can't receive passwords right now. Ask them to update Brave and sync their passwords. diff --git a/app/profiles_strings.grdp b/app/profiles_strings.grdp index 24f9c2705d1c..542c5632801d 100644 --- a/app/profiles_strings.grdp +++ b/app/profiles_strings.grdp @@ -596,6 +596,12 @@ Delete this profile and its data? + + Unable to unlock the Profile. + + + To unlock the profile you need to re-authenticate with your main account. + Browsing history diff --git a/app/settings_brave_strings.grdp b/app/settings_brave_strings.grdp index fbfbce9eb7b1..e25f4ed0fba6 100644 --- a/app/settings_brave_strings.grdp +++ b/app/settings_brave_strings.grdp @@ -116,16 +116,16 @@ - + Brave preloads pages you're likely to visit, so that they load more quickly when you visit them - + Brave preloads even more pages that you're likely to visit, so that they load more quickly when you visit them - + When a site asks to privately preload links on their page, Brave uses Brave servers. This hides your identity from the preloaded site, but Brave learns what sites get preloaded. - + If you allow cookies, Brave may use them when preloading @@ -261,13 +261,13 @@ - + Keeps you safe on Brave and may be used to improve your security in other Brave apps when you are signed in - + Checks URLs with a list of unsafe sites stored in Brave. If a site tries to steal your password, or when you download a harmful file, Brave may also send URLs, including bits of page content, to Safe Browsing. - + Warns you about dangerous sites, even ones Brave didn't know about before, by analyzing more data from sites than standard protection. You can choose to skip Brave warnings. @@ -325,6 +325,9 @@ When on, Brave conserves battery power by limiting background activity and visual effects, such as smooth scrolling and video frame rates. + + When on, Brave preloads pages which makes browsing and searching faster. + @@ -349,21 +352,39 @@ - - - Certificates managed by Brave - - - Information about how Brave manages its root certificates - - + + Certificates managed by Brave + + + Information about how Brave manages its root certificates + - Brave regularly checks to make sure your browser has the safest settings. We'll let you know if anything needs your review. - + + Brave found some safety recommendations for your review + + Brave will let you know if anything needs your review + + Brave can check your passwords when you save them + + + Learn how Brave keeps you safe + + + Brave's safety tools + + + With <a href="$1" target="_blank">tools from Brave</a>, you can browse safely and stay in control + + + Brave Private + + + <a href="$1" target="_blank">Brave warns you</a> about unsafe sites and downloads + diff --git a/app/settings_brave_strings_override.grdp b/app/settings_brave_strings_override.grdp index cb2facac4375..9940f57362d3 100644 --- a/app/settings_brave_strings_override.grdp +++ b/app/settings_brave_strings_override.grdp @@ -49,7 +49,7 @@ - - - + + Brave Private + diff --git a/app/settings_strings.grdp b/app/settings_strings.grdp index 07f6c9597874..216e1025a5c7 100644 --- a/app/settings_strings.grdp +++ b/app/settings_strings.grdp @@ -191,12 +191,12 @@ - Navigate back and forward with swipe gesture + Navigate back and forward with a swipe gesture - Turn on to navigate back and forward + Select the More Gestures tab, then turn on Swipe between pages to navigate back and forward @@ -459,8 +459,8 @@ Address deleted - - Clear copy + + Remove copy Edit card @@ -489,7 +489,7 @@ Right now, you have some cards that can only be used on this device - + Your payment methods in Google Pay @@ -1332,7 +1332,7 @@ Some of the pages you visit are preloaded - + Browsing and searching is faster @@ -1341,7 +1341,7 @@ More pages are preloaded. Pages may be preloaded through Brave servers when requested by other sites. - + Browsing and searching is faster than standard preloading @@ -1947,8 +1947,8 @@ {NUM_SITES, plural, - =1 {To protect your data, permissions were removed from a site you haven't visited in 2 months} - other {To protect your data, permissions were removed from sites you haven't visited in 2 months}} + =1 {To protect your data, permissions were removed from a site you haven't visited in recently} + other {To protect your data, permissions were removed from sites you haven't visited in recently}} {NUM_SITES, plural, @@ -1958,13 +1958,11 @@ Permissions allowed again for $1www.example.com - - + Automatically remove permissions from unused sites - - - To protect your data, remove permissions from sites you haven't visited in 2 months. Doesn't stop notifications. + + To protect your data, remove permissions from sites you haven't visited in recently. Doesn't stop notifications. Updates @@ -2031,8 +2029,8 @@ {NUM_EXTENSIONS, plural, - =1 {Review <b>1 extension</b> that was taken down from the Web Store} - other {Review <b>{NUM_EXTENSIONS} extensions</b> that were taken down from the Web Store}} + =1 {Review 1 extension that was taken down from the Web Store} + other {Review {NUM_EXTENSIONS} extensions that were taken down from the Web Store}} {NUM_SITES, plural, @@ -2131,43 +2129,43 @@ Show enhanced protection details - + Predicts and warns you about dangerous events before they happen - + Improves security for you and everyone on the web - + Warns you if passwords are exposed in a data breach - + Sends URLs to Safe Browsing to check them. Also sends a small sample of pages, downloads, extension activity, and system information to help discover new threats. Temporarily links this data to your Brave sync chain when you're signed in, to protect you across Brave apps. When on - + In-depth scans for suspicious downloads. - + When you're signed in, protects you across Brave services. - + Improves security for you and everyone on the web. - + Warns you if you use a password that has been compromised in a data breach. Things to consider - + Sends the URLs of sites you visit and a small sample of page content, downloads, extension activity, and system information to Google Safe Browsing to check if they're harmful. - + When you're signed in, this data is linked to your Brave sync chain to protect you across Brave services, for example increasing protection in Gmail after a security incident. - + Doesn't noticeably slow down your browser or device. @@ -2183,14 +2181,14 @@ Protects against sites, downloads, and extensions that are known to be dangerous. When you visit a site, Brave sends an obfuscated portion of the URL to Brave through a privacy server that hides your IP address. If a site does something suspicious, full URLs and bits of page content are also sent. - + Sends an obfuscated portion of the URL to Brave through a privacy server that hides your IP address. If a site tries to steal your password, or when you download a harmful file, Brave may also send URLs, including bits of page content, to Brave. Show standard protection details - + Detects and warns you about dangerous events when they happen @@ -2256,14 +2254,15 @@ Manage HTTPS/SSL certificates and settings - - - Manage device certificates - - - Manage HTTPS/SSL certificates on your device - - + + + + Manage device certificates + + + Manage HTTPS/SSL certificates on your device + + Manage @@ -2639,19 +2638,19 @@ Not allowed to automatically download multiple files - Sites might open a picture-in-picture window when you change to a different tab + Sites use this setting to enter picture-in-picture automatically. This lets you continue watching a video, while freeing up your screen for other tasks. - Sites can open a picture-in-picture window when you change to a different tab + Sites can enter picture-in-picture automatically - Don't allow sites to open a picture-in-picture window when you change to a different tab + Don't allow sites to enter picture-in-picture automatically - Allowed to open a picture-in-picture window when you change to a different tab + Allowed to enter picture-in-picture automatically - Not allowed to open a picture-in-picture window when you change to a different tab + Not allowed to enter picture-in-picture automatically After you leave a site, it can keep syncing to finish tasks, like uploading photos or sending a chat message @@ -2827,10 +2826,10 @@ Sites can ask for your location - + Don't allow sites to see your location - + Features that need your location won't work @@ -2858,19 +2857,19 @@ Not allowed to use your microphone - Sites usually connect to MIDI devices for creating and editing music + Sites usually use MIDI devices for features for creating and editing music - Sites can ask to connect to MIDI devices + Sites can ask to use your MIDI devices - Don't allow sites to connect to MIDI devices + Don't allow sites to use your MIDI devices - Allowed to connect to MIDI devices + Allowed to use your MIDI devices - Not allowed to connect to MIDI devices + Not allowed to use your MIDI devices Sites usually use your device's motion sensors for features like virtual reality or fitness tracking @@ -2902,6 +2901,18 @@ Sites are blocked from interrupting you when they ask to send notifications + + Sites can ask to send notifications + + + Collapse all requests in the address bar + + + Collapse unwanted requests (recommended) + + + Expand all requests + Don't allow sites to send notifications @@ -3214,6 +3225,48 @@ Sites that can never use cookies + + Tracking Protection + + + Manage third-party cookies and tracking protections + + + Tracking Protection + + + Brave limits the type of information sites can use to track you as you browse. You can change your settings to choose your own level of protection. + + + Brave automatically limits third-party cookies + + + Most sites can’t use third-party cookies to track you as you browse and sites can’t use third-party cookies in Private mode. + + + Most sites should work as expected + + + If a site isn’t working, you can try giving it temporary permission to use third-party cookies. <a target="_blank" href="$1">Learn more</a></a> + + + Advanced + + + Block all third-party cookies + + + Features on some sites may not work. + + + Sites use their discretion when responding to this request + + + Sites allowed to use third-party cookies + + + Affects the sites listed here and their subdomains. For example, adding “google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com. + Apps @@ -3696,11 +3749,6 @@ Site - - - Allows Android Messages to relay texts from your phone to your Chromebook - - @@ -3733,10 +3781,10 @@ Turn off sync and personalization? - Clear and continue + Delete and continue - - Clear bookmarks, history, passwords, and more from this device + + Remove bookmarks, history, passwords, and more from this device Settings saved. Sync started. @@ -3791,9 +3839,6 @@ Uses content on sites you visit, plus browser activity and interactions, for personalization - Encrypt synced data with your own <a href="$1" target="_blank"><a href="$1" target="_blank">sync passphrase</a></a>. This doesn't include payment methods and addresses from Google Pay. - - Encrypt synced data with your own <a href="$1" target="_blank"><a href="$1" target="_blank">sync passphrase</a></a>. Payment methods and addresses from Google Pay won’t be encrypted. Browsing history from Brave won’t sync. @@ -3857,6 +3902,32 @@ + + + Contextual help is on. These features can send open pages to Brave. + + + Contextual help is off + + + Contextual help in features + + + Get contextual help from some features + + + Some features can use the content of open pages and related recent pages to provide more useful information or suggestions + + + You'll see more useful information or suggestions in features like the Brave Search side panel + + + When you use some features, they can send parts of open pages, related recent pages, and their URLs to Brave + + + This setting doesn't change the availability of Brave Translate or Lens + + Page zoom @@ -4243,7 +4314,6 @@ - Safety Hub @@ -4256,10 +4326,7 @@ Safety recommendation - - Safety tips - - + Nothing else needs your attention right now @@ -4268,4 +4335,73 @@ Checked $12 days ago + + No weak or reused passwords + + + To check for compromised passwords, sign in to your Brave sync chain + + + To check for compromised passwords, go to Brave Password Manager + + + No saved passwords + + + Your organization turned off saving passwords + + + Enhanced Safe Browsing is on + + + You have Brave's strongest security + + + Safe Browsing is on + + + You're getting standard protection + + + Safe Browsing is off + + + Your organization turned off Safe Browsing + + + An extension turned off Safe Browsing + + + Turn on Safe Browsing to get protection against dangerous sites + + + Go to site settings + + + Go to notification settings + + + Private mode keeps <a href="$1" target="_blank">your browsing private from others</a> who use your device + + + Safe Browsing + + + {NUM_SITES, plural, + =1 {Permissions removed from 1 unused site} + other {Permissions removed from {NUM_SITES} sites}} + + + Relaunch to finish update. Your tabs will reopen. + + + {NUM_SITES, plural, + =1 {Review 1 website with lots of notifications} + other {Review {NUM_SITES} websites with lots of notifications}} + + + + + Lorem Ipsum + diff --git a/app/settings_strings_override.grdp b/app/settings_strings_override.grdp index 6c4ef4ba6117..2c188b12dcaa 100644 --- a/app/settings_strings_override.grdp +++ b/app/settings_strings_override.grdp @@ -138,13 +138,11 @@ {NUM_EXTENSIONS, plural, - =1 {Review <b>1 extension</b> that was taken down from the Web Store} - other {Review <b>{NUM_EXTENSIONS} extensions</b> that were taken down from the Web Store}} + =1 {Review 1 extension that was taken down from the Web Store} + other {Review {NUM_EXTENSIONS} extensions that were taken down from the Web Store}} - - @@ -183,6 +181,9 @@ + + Most sites can’t use third-party cookies to track you as you browse and sites can’t use third-party cookies in Private mode. + Third-party cookies are blocked in Private mode @@ -192,9 +193,6 @@ This custom setting will be removed when you close all your Private windows - - - @@ -211,4 +209,7 @@ + + Private mode keeps <a href="$1" target="_blank">your browsing private from others</a> who use your device + diff --git a/app/shared_settings_strings.grdp b/app/shared_settings_strings.grdp index 98a30354a7ca..f94721f21c1a 100644 --- a/app/shared_settings_strings.grdp +++ b/app/shared_settings_strings.grdp @@ -287,7 +287,7 @@ - Clear and Sign Out + Delete and Sign Out Sign out @@ -318,7 +318,7 @@ Apps - Apps sync is set in system Settings + Apps sync is set in device Settings Other Brave services diff --git a/app/support_tool_strings.grdp b/app/support_tool_strings.grdp index ea6f46e99684..472fd45d5063 100644 --- a/app/support_tool_strings.grdp +++ b/app/support_tool_strings.grdp @@ -155,7 +155,7 @@ ChromeOS Brave User Logs - ChromeOS Bluetooth Floss + ChromeOS Bluetooth ChromeOS Connected Input Devices @@ -175,6 +175,9 @@ Sign In State + + ChromeOS App Service + Android App Information diff --git a/base/android/java/src/org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker.java b/base/android/java/src/org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker.java new file mode 100644 index 000000000000..a123d77e9486 --- /dev/null +++ b/base/android/java/src/org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker.java @@ -0,0 +1,38 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package org.chromium.base.shared_preferences; + +import org.chromium.base.BravePreferenceKeys; +import org.chromium.base.Log; + +public class BraveStrictPreferenceKeyChecker extends StrictPreferenceKeyChecker { + private static String TAG = "BraveReflectionUtil"; + + BraveStrictPreferenceKeyChecker(PreferenceKeyRegistry registry) { + super(registry); + } + + @Override + public void checkIsKeyInUse(String key) { + if (!isKeyInUse(key) && !BravePreferenceKeys.isBraveKeyInUse(key)) { + Log.e( + TAG, + "Key " + + key + + " is not registered for Brave's use. Either add it to" + + " BravePreferenceKeys or remove it if it's not used."); + } + } + + /* + * Dummy method that will be deleted form the bytecode. {@link + * StrictPreferenceKeyChecker#isKeyInUse} will be used instead. + */ + private boolean isKeyInUse(String key) { + assert false : "This method should be deleted in bytecode!"; + return false; + } +} diff --git a/browser/preferences/brave_preferences_java_sources.gni b/base/brave_base_shared_preferences_java.gni similarity index 62% rename from browser/preferences/brave_preferences_java_sources.gni rename to base/brave_base_shared_preferences_java.gni index fd6946c56a98..9e58b4b08df2 100644 --- a/browser/preferences/brave_preferences_java_sources.gni +++ b/base/brave_base_shared_preferences_java.gni @@ -3,4 +3,4 @@ # 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_browser_preferences_java_sources = [ "//brave/android/java/org/chromium/chrome/browser/preferences/BravePreferenceKeyChecker.java" ] +brave_base_shared_preferences_java_sources = [ "//brave/base/android/java/src/org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker.java" ] diff --git a/browser/about_flags.cc b/browser/about_flags.cc index 63f323293a98..96a96daad11e 100644 --- a/browser/about_flags.cc +++ b/browser/about_flags.cc @@ -854,15 +854,6 @@ kOsDesktop | kOsAndroid, \ FEATURE_VALUE_TYPE(translate::kTranslate), \ }, \ - { \ - "brave-sync-history-diagnostics", \ - "Enable Brave Sync History Diagnostics", \ - "Brave Sync History Diagnostics flag displays additional sync " \ - "related information on History page", \ - kOsAll, \ - FEATURE_VALUE_TYPE( \ - brave_sync::features::kBraveSyncHistoryDiagnostics), \ - }, \ { \ "restrict-event-source-pool", \ "Restrict Event Source Pool", \ @@ -870,14 +861,6 @@ kOsAll, \ FEATURE_VALUE_TYPE(blink::features::kRestrictEventSourcePool), \ }, \ - { \ - "brave-sync-send-all-history", \ - "Send All History to Brave Sync", \ - "With Send All History flag all sync entries are sent to Sync " \ - "server including transitions of link, bookmark, reload, etc", \ - kOsAll, \ - FEATURE_VALUE_TYPE(brave_sync::features::kBraveSyncSendAllHistory), \ - }, \ { \ "brave-copy-clean-link-by-default", \ "Override default copy hotkey with copy clean link", \ diff --git a/browser/brave_ads/android/BUILD.gn b/browser/brave_ads/android/BUILD.gn index 2f51cc7cc8a7..5692b4838f26 100644 --- a/browser/brave_ads/android/BUILD.gn +++ b/browser/brave_ads/android/BUILD.gn @@ -5,6 +5,7 @@ import("//brave/build/config.gni") import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") generate_jni("jni_headers") { sources = [ diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index bd5ed26e7b26..d256551973fe 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -89,7 +89,7 @@ #include "chrome/browser/profiles/profile_io_data.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/common/url_constants.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/content_settings/browser/page_specific_content_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/embedder_support/switches.h" diff --git a/browser/brave_prefs_browsertest.cc b/browser/brave_prefs_browsertest.cc index b8c3303e5ce4..9639c9eca1cf 100644 --- a/browser/brave_prefs_browsertest.cc +++ b/browser/brave_prefs_browsertest.cc @@ -20,7 +20,7 @@ #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefetch/pref_names.h" -#include "chrome/browser/prefetch/prefetch_prefs.h" +#include "chrome/browser/preloading/preloading_prefs.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h" #include "chrome/common/pref_names.h" diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc index 98e6269239d0..37c94ffee31b 100644 --- a/browser/brave_profile_prefs.cc +++ b/browser/brave_profile_prefs.cc @@ -45,8 +45,8 @@ #include "brave/components/tor/buildflags/buildflags.h" #include "build/build_config.h" #include "chrome/browser/prefetch/pref_names.h" -#include "chrome/browser/prefetch/prefetch_prefs.h" #include "chrome/browser/prefs/session_startup_pref.h" +#include "chrome/browser/preloading/preloading_prefs.h" #include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h" #include "chrome/common/channel_info.h" #include "chrome/common/pref_names.h" diff --git a/browser/brave_resources_util_unittest.cc b/browser/brave_resources_util_unittest.cc index f3d8dec28497..11a944f950d0 100644 --- a/browser/brave_resources_util_unittest.cc +++ b/browser/brave_resources_util_unittest.cc @@ -13,7 +13,7 @@ #if BUILDFLAG(IS_WIN) #include "brave/common/resource_bundle_helper.h" #include "brave/components/l10n/common/localization_util.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #endif TEST(BraveResourcesUtil, CheckIds) { diff --git a/browser/brave_vpn/dns/brave_vpn_dns_observer_service_win.cc b/browser/brave_vpn/dns/brave_vpn_dns_observer_service_win.cc index 50032d52f1eb..061fab760de8 100644 --- a/browser/brave_vpn/dns/brave_vpn_dns_observer_service_win.cc +++ b/browser/brave_vpn/dns/brave_vpn_dns_observer_service_win.cc @@ -23,7 +23,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/simple_message_box.h" #include "chrome/common/pref_names.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/grit/brave_components_strings.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h" diff --git a/browser/brave_vpn/win/brave_vpn_wireguard_service/service/wireguard_tunnel_service.cc b/browser/brave_vpn/win/brave_vpn_wireguard_service/service/wireguard_tunnel_service.cc index 6915f2eeab08..0d909f871d79 100644 --- a/browser/brave_vpn/win/brave_vpn_wireguard_service/service/wireguard_tunnel_service.cc +++ b/browser/brave_vpn/win/brave_vpn_wireguard_service/service/wireguard_tunnel_service.cc @@ -13,6 +13,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/logging.h" +#include "base/memory/raw_ref.h" #include "base/path_service.h" #include "base/rand_util.h" #include "base/scoped_native_library.h" @@ -47,7 +48,7 @@ std::wstring GetWireguardConfigName(const std::wstring& prefix) { } struct SidAccessDescriptor { - const base::win::Sid& sid; + base::win::WellKnownSid well_known_sid; DWORD access_mask; base::win::SecurityAccessMode access_mode; }; @@ -66,8 +67,9 @@ bool AddACEToPath(const base::FilePath& path, std::vector entries; for (const auto& descriptor : descriptors) { - entries.emplace_back(descriptor.sid, descriptor.access_mode, - descriptor.access_mask, inheritance); + entries.emplace_back(base::win::Sid(descriptor.well_known_sid), + descriptor.access_mode, descriptor.access_mask, + inheritance); } if (!sd.SetDaclEntries(entries)) { @@ -90,26 +92,16 @@ bool AddACEToPath(const base::FilePath& path, } bool ConfigureConfigPermissions(const base::FilePath& config_path) { - const absl::optional service_sid = - base::win::Sid::FromKnownSid(base::win::WellKnownSid::kService); - const absl::optional administrators_sid = - base::win::Sid::FromKnownSid( - base::win::WellKnownSid::kBuiltinAdministrators); - if (!service_sid.has_value() || !administrators_sid.has_value()) { - VLOG(1) << "Failed to get Sids for service(" << service_sid.has_value() - << ") or administrators(" << administrators_sid.has_value() << ")"; - return false; - } - - return AddACEToPath(config_path, - // Let only windows services to read the config. - {{service_sid.value(), - GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | DELETE, - base::win::SecurityAccessMode::kGrant}, - // Let windows administrators only to remove the config. - {administrators_sid.value(), GENERIC_EXECUTE | DELETE, - base::win::SecurityAccessMode::kGrant}}, - 0, /*recursive=*/false); + return AddACEToPath( + config_path, + {// Let only windows services to read the config. + {base::win::WellKnownSid::kService, + GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | DELETE, + base::win::SecurityAccessMode::kGrant}, + // Let windows administrators only to remove the config. + {base::win::WellKnownSid::kBuiltinAdministrators, + GENERIC_EXECUTE | DELETE, base::win::SecurityAccessMode::kGrant}}, + 0, /*recursive=*/false); } absl::optional WriteConfigToFile(const std::string& config) { diff --git a/browser/brave_wallet/brave_wallet_prefs_unittest.cc b/browser/brave_wallet/brave_wallet_prefs_unittest.cc index ed351f29edcb..3db321e676b0 100644 --- a/browser/brave_wallet/brave_wallet_prefs_unittest.cc +++ b/browser/brave_wallet/brave_wallet_prefs_unittest.cc @@ -57,7 +57,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { // AskDeprecated changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::AskDeprecated)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -65,7 +65,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { // BraveWallet changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::BraveWallet)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -74,7 +74,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { GetPrefs()->SetInteger( kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::BraveWalletPreferExtension)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -82,7 +82,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { // Ask changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::AskDeprecated)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -90,7 +90,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { // CryptoWallets changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::CryptoWallets)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -98,7 +98,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateObsoleteProfilePrefsWeb3Provider) { // None remains None GetPrefs()->SetInteger(kBraveWalletWeb3ProviderDeprecated, static_cast(mojom::DefaultWallet::None)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::None, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -109,7 +109,7 @@ TEST_F(BraveWalletPrefsUnitTest, // AskDeprecated changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::AskDeprecated)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -117,7 +117,7 @@ TEST_F(BraveWalletPrefsUnitTest, // BraveWallet changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::BraveWallet)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -126,7 +126,7 @@ TEST_F(BraveWalletPrefsUnitTest, GetPrefs()->SetInteger( kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::BraveWalletPreferExtension)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -134,7 +134,7 @@ TEST_F(BraveWalletPrefsUnitTest, // Ask changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::AskDeprecated)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -142,7 +142,7 @@ TEST_F(BraveWalletPrefsUnitTest, // CryptoWallets changes to BraveWalletPreferExtension GetPrefs()->SetInteger(kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::CryptoWallets)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::BraveWalletPreferExtension, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -150,7 +150,7 @@ TEST_F(BraveWalletPrefsUnitTest, // None remains None GetPrefs()->SetInteger(kDefaultWalletDeprecated, static_cast(mojom::DefaultWallet::None)); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_EQ(mojom::DefaultWallet::None, static_cast( GetPrefs()->GetInteger(kDefaultEthereumWallet))); @@ -164,7 +164,7 @@ TEST_F(BraveWalletPrefsUnitTest, GetPrefs()->GetBoolean(kBraveWalletEthereumTransactionsCoinTypeMigrated)); auto* pref = GetPrefs()->FindPreference(kBraveWalletTransactions); ASSERT_TRUE(pref && pref->IsDefaultValue()); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_TRUE(pref && pref->IsDefaultValue()); EXPECT_TRUE( GetPrefs()->GetBoolean(kBraveWalletEthereumTransactionsCoinTypeMigrated)); @@ -190,7 +190,7 @@ TEST_F(BraveWalletPrefsUnitTest, update->SetByDottedPath("ropsten.meta3", tx1.Clone()); } - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); const auto& dict = GetPrefs()->GetDict(kBraveWalletTransactions); const auto* tx1_value = dict.FindDictByDottedPath("ethereum.mainnet.meta1"); const auto* tx2_value = dict.FindDictByDottedPath("ethereum.mainnet.meta2"); @@ -217,7 +217,7 @@ TEST_F(BraveWalletPrefsUnitTest, EXPECT_TRUE(pref && !pref->IsDefaultValue()); EXPECT_TRUE(GetPrefs()->GetDict(kBraveWalletTransactions).empty()); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_TRUE(pref && pref->IsDefaultValue()); EXPECT_TRUE( GetPrefs()->GetBoolean(kBraveWalletEthereumTransactionsCoinTypeMigrated)); @@ -241,7 +241,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateShowTestNetworksToggle) { ElementsAreArray({mojom::kSolanaDevnet, mojom::kSolanaTestnet, mojom::kLocalhostChainId})); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); // Still same when nothing to migrate. EXPECT_THAT(GetHiddenNetworks(GetPrefs(), mojom::CoinType::ETH), ElementsAreArray({mojom::kGoerliChainId, mojom::kSepoliaChainId, @@ -256,7 +256,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateShowTestNetworksToggle) { GetPrefs()->SetBoolean(kShowWalletTestNetworksDeprecated, false); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); // Still same when test networks toggle was explicitly off. EXPECT_THAT(GetHiddenNetworks(GetPrefs(), mojom::CoinType::ETH), ElementsAreArray({mojom::kGoerliChainId, mojom::kSepoliaChainId, @@ -272,7 +272,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateShowTestNetworksToggle) { GetPrefs()->SetBoolean(kShowWalletTestNetworksDeprecated, true); - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); // Test networks are removed from hidden list after successfull migration. EXPECT_THAT(GetHiddenNetworks(GetPrefs(), mojom::CoinType::ETH), SizeIs(0)); EXPECT_THAT(GetHiddenNetworks(GetPrefs(), mojom::CoinType::FIL), @@ -310,7 +310,7 @@ TEST_F(BraveWalletPrefsUnitTest, MigrateAddChainIdToTransactionInfo) { update->SetByDottedPath("solana", std::move(tx2)); update->SetByDottedPath("filecoin", std::move(tx3)); } - MigrateObsoleteProfilePrefs(GetPrefs()); + brave_wallet::MigrateObsoleteProfilePrefs(GetPrefs()); EXPECT_TRUE(GetPrefs()->HasPrefPath(kBraveWalletTransactionsChainIdMigrated)); EXPECT_TRUE(GetPrefs()->GetBoolean(kBraveWalletTransactionsChainIdMigrated)); diff --git a/browser/default_protocol_handler_utils_win.cc b/browser/default_protocol_handler_utils_win.cc index f29012fc655c..2421ba7b8c95 100644 --- a/browser/default_protocol_handler_utils_win.cc +++ b/browser/default_protocol_handler_utils_win.cc @@ -141,15 +141,11 @@ std::wstring FormatUserChoiceString(std::wstring_view ext, L"User Choice set via Windows User Experience " L"{D18B6DD5-6124-4341-9318-804003BAFA0B}"; - const wchar_t* user_choice_fmt = - L"%ls%ls%ls" - L"%08lx" - L"%08lx" - L"%ls"; - - const std::wstring user_choice = base::StringPrintf( - user_choice_fmt, ext.data(), sid.data(), prog_id.data(), - file_time.dwHighDateTime, file_time.dwLowDateTime, user_experience); + const std::wstring file_time_str = base::ASCIIToWide(base::StringPrintf( + "%08lx%08lx", file_time.dwHighDateTime, file_time.dwLowDateTime)); + + const std::wstring user_choice = + base::StrCat({ext, sid, prog_id, file_time_str, user_experience}); // For using CharLowerW instead of base::ToLowerASCII(). // Otherwise, hash test with non-ascii inputs are failed. std::vector buf(user_choice.begin(), user_choice.end()); @@ -202,18 +198,17 @@ bool CheckEqualMinutes(SYSTEMTIME system_time1, SYSTEMTIME system_time2) { } std::wstring GetAssociationKeyPath(std::wstring_view protocol) { - const wchar_t* key_path_fmt; + const wchar_t* key_path; if (protocol[0] == L'.') { - key_path_fmt = - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\%" - L"ls"; + key_path = + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"; } else { - key_path_fmt = + key_path = L"SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\" - L"UrlAssociations\\%ls"; + L"UrlAssociations\\"; } - return base::StringPrintf(key_path_fmt, protocol.data()); + return base::StrCat({key_path, protocol}); } bool SetUserChoice(std::wstring_view ext, diff --git a/browser/download/android/BUILD.gn b/browser/download/android/BUILD.gn index 9da41b9695ed..b7ce20ffc51c 100644 --- a/browser/download/android/BUILD.gn +++ b/browser/download/android/BUILD.gn @@ -4,6 +4,7 @@ # You can obtain one at https://mozilla.org/MPL/2.0/. import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") android_library("java") { sources = diff --git a/browser/download/bubble/download_display_controller_unittest.cc b/browser/download/bubble/download_display_controller_unittest.cc index 43e07c615bc0..67e7bef78967 100644 --- a/browser/download/bubble/download_display_controller_unittest.cc +++ b/browser/download/bubble/download_display_controller_unittest.cc @@ -12,13 +12,11 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/memory/raw_ptr.h" -#include "base/memory/raw_ptr_exclusion.h" #include "base/memory/raw_ref.h" #include "base/time/time.h" +#include "chrome/browser/download/bubble/download_bubble_display_info.h" #include "chrome/browser/download/bubble/download_bubble_ui_controller.h" #include "chrome/browser/download/bubble/download_bubble_utils.h" -#include "chrome/browser/download/bubble/download_display.h" -#include "chrome/browser/download/bubble/download_icon_state.h" #include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/download_core_service.h" #include "chrome/browser/download/download_core_service_factory.h" @@ -27,6 +25,7 @@ #include "chrome/browser/download/offline_item_model_manager_factory.h" #include "chrome/browser/offline_items_collection/offline_content_aggregator_factory.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/download/download_display.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/test_browser_window.h" #include "chrome/test/base/testing_browser_process.h" @@ -67,7 +66,8 @@ using ::testing::ReturnRef; using ::testing::ReturnRefOfCopy; using ::testing::StrictMock; using StrictMockDownloadItem = StrictMock; -using DownloadIconState = download::DownloadIconState; +using DownloadIconActive = DownloadDisplay::IconActive; +using DownloadIconState = DownloadDisplay::IconState; using DownloadState = download::DownloadItem::DownloadState; using DownloadUIModelPtr = DownloadUIModel::DownloadUIModelPtr; using OfflineItemList = @@ -80,15 +80,11 @@ class FakeDownloadDisplay : public DownloadDisplay { FakeDownloadDisplay(const FakeDownloadDisplay&) = delete; FakeDownloadDisplay& operator=(const FakeDownloadDisplay&) = delete; - void SetController(DownloadDisplayController* controller) { - controller_ = controller; - } - void ResetState() { shown_ = false; detail_shown_ = false; - icon_state_ = DownloadIconState::kComplete; - is_active_ = false; + state_ = DownloadIconState::kComplete; + active_ = DownloadIconActive::kInactive; } void Show() override { shown_ = true; } @@ -98,40 +94,59 @@ class FakeDownloadDisplay : public DownloadDisplay { detail_shown_ = false; } - bool IsShowing() override { return shown_; } + bool IsShowing() const override { return shown_; } void Enable() override { enabled_ = true; } void Disable() override { enabled_ = false; } - bool ShouldShowExclusiveAccessBubble() override { return true; } - - void UpdateDownloadIcon(bool show_animation) override { - icon_state_ = controller_->GetIconInfo().icon_state; - is_active_ = controller_->GetIconInfo().is_active; + void UpdateDownloadIcon(const IconUpdateInfo& updates) override { + if (updates.new_state) { + state_ = *updates.new_state; + } + if (updates.new_active) { + active_ = *updates.new_active; + } + if (updates.new_progress) { + progress_info_ = *updates.new_progress; + } } void ShowDetails() override { detail_shown_ = true; } void HideDetails() override { detail_shown_ = false; } - bool IsShowingDetails() override { return detail_shown_; } - bool IsFullscreenWithParentViewHidden() override { return is_fullscreen_; } + bool IsShowingDetails() const override { return detail_shown_; } + bool OpenMostSpecificDialog( + const offline_items_collection::ContentId& content_id) override { + detail_shown_ = true; + return true; + } + bool IsFullscreenWithParentViewHidden() const override { + return is_fullscreen_; + } + bool ShouldShowExclusiveAccessBubble() const override { + return IsFullscreenWithParentViewHidden() && + should_show_exclusive_access_bubble_; + } - DownloadIconState GetDownloadIconState() { return icon_state_; } - bool IsActive() { return is_active_; } + DownloadIconState GetIconState() const override { return state_; } + DownloadIconActive GetIconActive() const { return active_; } + ProgressInfo GetIconProgress() const { return progress_info_; } void SetIsFullscreen(bool is_fullscreen) { is_fullscreen_ = is_fullscreen; } + void SetShouldShowExclusiveAccessBubble(bool show) { + should_show_exclusive_access_bubble_ = show; + } void OpenSecuritySubpage( const offline_items_collection::ContentId&) override {} private: bool shown_ = false; bool enabled_ = false; - DownloadIconState icon_state_ = DownloadIconState::kComplete; - bool is_active_ = false; + DownloadIconState state_ = DownloadIconState::kComplete; + DownloadIconActive active_ = DownloadIconActive::kInactive; + ProgressInfo progress_info_; bool detail_shown_ = false; bool is_fullscreen_ = false; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #constexpr-ctor-field-initializer - RAW_PTR_EXCLUSION DownloadDisplayController* controller_ = nullptr; + bool should_show_exclusive_access_bubble_ = true; }; // TODO(chlily): Pull this and the very similar class in @@ -159,9 +174,8 @@ class MockDownloadBubbleUpdateService : public DownloadBubbleUpdateService { ~MockDownloadBubbleUpdateService() override = default; - void UpdateInfoForModel( - const DownloadUIModel& model, - DownloadDisplayController::AllDownloadUIModelsInfo& info) { + void UpdateInfoForModel(const DownloadUIModel& model, + DownloadBubbleDisplayInfo& info) { ++info.all_models_size; info.last_completed_time = std::max(info.last_completed_time, model.GetEndTime()); @@ -181,9 +195,9 @@ class MockDownloadBubbleUpdateService : public DownloadBubbleUpdateService { } } - const DownloadDisplayController::AllDownloadUIModelsInfo& GetAllModelsInfo( + const DownloadBubbleDisplayInfo& GetDisplayInfo( const web_app::AppId* web_app_id) override { - info_ = DownloadDisplayController::AllDownloadUIModelsInfo{}; + info_ = DownloadBubbleDisplayInfo{}; int download_item_index = 0, offline_item_index = 0; // Compose a list of models from the items stored in the test fixture. for (ModelType type : model_types_) { @@ -247,18 +261,19 @@ class MockDownloadBubbleUpdateService : public DownloadBubbleUpdateService { bool IsInitialized() const override { return true; } - MOCK_METHOD(DownloadDisplayController::ProgressInfo, + MOCK_METHOD(DownloadDisplay::ProgressInfo, GetProgressInfo, (const web_app::AppId*), (const override)); private: raw_ptr profile_; - DownloadDisplayController::AllDownloadUIModelsInfo info_; + DownloadBubbleDisplayInfo info_; std::vector model_types_; - const raw_ref>> + const raw_ref>, + ExperimentalAsh> download_items_; - const raw_ref offline_items_; + const raw_ref offline_items_; }; class MockDownloadCoreService : public DownloadCoreService { @@ -312,6 +327,9 @@ class DownloadDisplayControllerTest : public testing::Test { mock_update_service_ = std::make_unique>( profile_, items_, offline_items_); + // Will be called when the DownloadDisplayController is constructed. + EXPECT_CALL(*mock_update_service_, GetProgressInfo(_)) + .WillRepeatedly(Return(DownloadDisplay::ProgressInfo())); display_ = std::make_unique(); window_ = std::make_unique(); Browser::CreateParams params(profile_, true); @@ -322,7 +340,6 @@ class DownloadDisplayControllerTest : public testing::Test { browser_.get(), mock_update_service_.get()); controller_ = std::make_unique( display_.get(), browser_.get(), bubble_controller_.get()); - display_->SetController(controller_.get()); } void TearDown() override { @@ -397,7 +414,7 @@ class DownloadDisplayControllerTest : public testing::Test { nullptr); mock_update_service_->AddModel( MockDownloadBubbleUpdateService::ModelType::kDownloadItem); - DownloadDisplayController::ProgressInfo progress_info; + DownloadDisplay::ProgressInfo progress_info; progress_info.download_count = in_progress_count_; progress_info.progress_percentage = in_progress_count_ > 0 ? 50 : 0; EXPECT_CALL(*mock_update_service_, GetProgressInfo(_)) @@ -412,7 +429,7 @@ class DownloadDisplayControllerTest : public testing::Test { if (state == OfflineItemState::IN_PROGRESS) { ++in_progress_count_; } - DownloadDisplayController::ProgressInfo progress_info; + DownloadDisplay::ProgressInfo progress_info; progress_info.download_count = in_progress_count_; progress_info.progress_percentage = in_progress_count_ > 0 ? 50 : 0; progress_info.progress_certain = false; @@ -480,16 +497,19 @@ class DownloadDisplayControllerTest : public testing::Test { << detail_shown << ", but found " << display().IsShowingDetails(); } - if (icon_state != display().GetDownloadIconState()) { + if (icon_state != display().GetIconState()) { success = false; ADD_FAILURE() << "Display should have detailed icon state " << static_cast(icon_state) << ", but found " - << static_cast(display().GetDownloadIconState()); + << static_cast(display().GetIconState()); } - if (is_active != display().IsActive()) { + if (is_active != + (display().GetIconActive() == DownloadIconActive::kActive)) { success = false; ADD_FAILURE() << "Display should have is_active set to " << is_active - << ", but found " << display().IsActive(); + << ", but found " + << (display().GetIconActive() == + DownloadIconActive::kActive); } return success; } diff --git a/browser/gcm_driver/brave_gcm_utils.cc b/browser/gcm_driver/brave_gcm_utils.cc index b6885d62ff50..b965debf1dbc 100644 --- a/browser/gcm_driver/brave_gcm_utils.cc +++ b/browser/gcm_driver/brave_gcm_utils.cc @@ -7,7 +7,6 @@ #include "base/values.h" #include "brave/components/constants/pref_names.h" -#include "chrome/browser/profiles/profile.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" @@ -23,8 +22,7 @@ void RegisterGCMProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref(kBraveGCMChannelStatus, false); } -void MigrateGCMPrefs(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); +void MigrateGCMPrefs(PrefService* prefs) { // The default was false (see above). auto* pref = prefs->FindPreference(kGCMChannelStatus); if (pref && !pref->IsDefaultValue()) diff --git a/browser/gcm_driver/brave_gcm_utils.h b/browser/gcm_driver/brave_gcm_utils.h index eaa5d9c49b88..31821fed9e20 100644 --- a/browser/gcm_driver/brave_gcm_utils.h +++ b/browser/gcm_driver/brave_gcm_utils.h @@ -6,7 +6,7 @@ #ifndef BRAVE_BROWSER_GCM_DRIVER_BRAVE_GCM_UTILS_H_ #define BRAVE_BROWSER_GCM_DRIVER_BRAVE_GCM_UTILS_H_ -class Profile; +class PrefService; namespace user_prefs { class PrefRegistrySyncable; @@ -15,7 +15,7 @@ class PrefRegistrySyncable; namespace gcm { void RegisterGCMProfilePrefs(user_prefs::PrefRegistrySyncable* registry); -void MigrateGCMPrefs(Profile* profile); +void MigrateGCMPrefs(PrefService* prefs); } // namespace gcm diff --git a/browser/infobars/brave_confirm_p3a_infobar_delegate.cc b/browser/infobars/brave_confirm_p3a_infobar_delegate.cc index 47ab9cb2849f..7bb4040a63e1 100644 --- a/browser/infobars/brave_confirm_p3a_infobar_delegate.cc +++ b/browser/infobars/brave_confirm_p3a_infobar_delegate.cc @@ -14,7 +14,7 @@ #include "brave/components/p3a/pref_names.h" #include "brave/grit/brave_generated_resources.h" #include "chrome/browser/infobars/confirm_infobar_creator.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/infobars/content/content_infobar_manager.h" #include "components/infobars/core/infobar.h" #include "components/prefs/pref_service.h" diff --git a/browser/infobars/sources.gni b/browser/infobars/sources.gni index 47a3f7c868be..0212d007a062 100644 --- a/browser/infobars/sources.gni +++ b/browser/infobars/sources.gni @@ -34,7 +34,7 @@ if (!is_android) { "//brave/components/brave_sync:prefs", "//brave/components/constants", "//brave/components/p3a", - "//chrome/app:chromium_strings", + "//chrome/app:branded_strings", "//components/infobars/content", "//components/infobars/core", "//components/prefs", diff --git a/browser/ipfs/test/ipfs_service_browsertest.cc b/browser/ipfs/test/ipfs_service_browsertest.cc index a0a045d52fc8..f1553d8c0d4f 100644 --- a/browser/ipfs/test/ipfs_service_browsertest.cc +++ b/browser/ipfs/test/ipfs_service_browsertest.cc @@ -7,6 +7,7 @@ #include #include "base/base64.h" +#include "base/hash/hash.h" #include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "base/run_loop.h" diff --git a/browser/renderer_context_menu/brave_mock_render_view_context_menu.cc b/browser/renderer_context_menu/brave_mock_render_view_context_menu.cc index e8f755dda1f0..4f273ab0c7e7 100644 --- a/browser/renderer_context_menu/brave_mock_render_view_context_menu.cc +++ b/browser/renderer_context_menu/brave_mock_render_view_context_menu.cc @@ -223,7 +223,7 @@ void BraveMockRenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) { void BraveMockRenderViewContextMenu::AddAccessibilityLabelsServiceItem( bool is_checked) {} -void BraveMockRenderViewContextMenu::AddPdfOcrMenuItem(bool is_checked) {} +void BraveMockRenderViewContextMenu::AddPdfOcrMenuItem() {} content::RenderViewHost* BraveMockRenderViewContextMenu::GetRenderViewHost() const { diff --git a/browser/renderer_context_menu/brave_mock_render_view_context_menu.h b/browser/renderer_context_menu/brave_mock_render_view_context_menu.h index e3c29afb6699..3b6ea9fb9e18 100644 --- a/browser/renderer_context_menu/brave_mock_render_view_context_menu.h +++ b/browser/renderer_context_menu/brave_mock_render_view_context_menu.h @@ -82,7 +82,7 @@ class BraveMockRenderViewContextMenu : public ui::SimpleMenuModel::Delegate, void RemoveSeparatorBeforeMenuItem(int command_id) override; void AddSpellCheckServiceItem(bool is_checked) override; void AddAccessibilityLabelsServiceItem(bool is_checked) override; - void AddPdfOcrMenuItem(bool is_checked) override; + void AddPdfOcrMenuItem() override; content::RenderViewHost* GetRenderViewHost() const override; content::WebContents* GetWebContents() const override; content::BrowserContext* GetBrowserContext() const override; diff --git a/browser/resources/settings/brave_overrides/cookies_page.ts b/browser/resources/settings/brave_overrides/cookies_page.ts index 9eed76f14fca..7ed7832a4f70 100644 --- a/browser/resources/settings/brave_overrides/cookies_page.ts +++ b/browser/resources/settings/brave_overrides/cookies_page.ts @@ -8,11 +8,13 @@ import {RegisterPolymerTemplateModifications} from 'chrome://resources/brave/pol RegisterPolymerTemplateModifications({ 'settings-cookies-page': (templateContent) => { const privacySandboxSettings4Template = templateContent. - querySelector(`template[if*='!isPrivacySandboxSettings4_']`) + querySelector( + 'template[if*="isPrivacySandboxSettings3CookieSettingsEnabled_"]' + ) if (!privacySandboxSettings4Template) { console.error( '[Brave Settings Overrides] Could not find template with ' + - 'if*=isPrivacySandboxSettings4_ on cookies page.') + 'if*=isPrivacySandboxSettings3CookieSettingsEnabled_ on cookies page.') } else { const clearOnExitToggle = privacySandboxSettings4Template.content.getElementById('clearOnExit') diff --git a/browser/search/ntp_utils.cc b/browser/search/ntp_utils.cc index b1ea10b0cdcb..0d3dc5d67f69 100644 --- a/browser/search/ntp_utils.cc +++ b/browser/search/ntp_utils.cc @@ -15,8 +15,7 @@ namespace { -void ClearNewTabPageProfilePrefs(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); +void ClearNewTabPageProfilePrefs(PrefService* prefs) { prefs->ClearPref(kNewTabPageShowTopSites); } @@ -27,10 +26,9 @@ const char* const kWidgetPrefNames[] = {kNewTabPageShowRewards, namespace new_tab_page { -void MigrateNewTabPagePrefs(Profile* profile) { +void MigrateNewTabPagePrefs(PrefService* prefs) { // Migrate over to the Chromium setting for shortcuts visible // Only sets the value if user has changed it - auto* prefs = profile->GetPrefs(); const PrefService::Preference* top_sites_pref = prefs->FindPreference(kNewTabPageShowTopSites); if (top_sites_pref->HasUserSetting()) { @@ -79,7 +77,7 @@ void MigrateNewTabPagePrefs(Profile* profile) { } // Clear deprecated prefs. - ClearNewTabPageProfilePrefs(profile); + ClearNewTabPageProfilePrefs(prefs); } void RegisterNewTabPagePrefsForMigration( diff --git a/browser/search/ntp_utils.h b/browser/search/ntp_utils.h index ca54cd8a4ce2..54d4c6978bc3 100644 --- a/browser/search/ntp_utils.h +++ b/browser/search/ntp_utils.h @@ -6,7 +6,7 @@ #ifndef BRAVE_BROWSER_SEARCH_NTP_UTILS_H_ #define BRAVE_BROWSER_SEARCH_NTP_UTILS_H_ -class Profile; +class PrefService; namespace user_prefs { class PrefRegistrySyncable; @@ -15,7 +15,7 @@ class PrefRegistrySyncable; namespace new_tab_page { // APIs for prefs. -void MigrateNewTabPagePrefs(Profile* profile); +void MigrateNewTabPagePrefs(PrefService* prefs); void RegisterNewTabPagePrefsForMigration( user_prefs::PrefRegistrySyncable* registry); diff --git a/browser/search/ntp_utils_unittest.cc b/browser/search/ntp_utils_unittest.cc index a4f2ac165121..a3a68b8e08b9 100644 --- a/browser/search/ntp_utils_unittest.cc +++ b/browser/search/ntp_utils_unittest.cc @@ -25,6 +25,8 @@ class NTPUtilsTest : public ::testing::Test { Profile* profile() { return profile_.get(); } + PrefService* GetPrefs() { return profile_->GetPrefs(); } + protected: // BrowserTaskEnvironment is needed before TestingProfile content::BrowserTaskEnvironment task_environment_; @@ -34,22 +36,22 @@ class NTPUtilsTest : public ::testing::Test { TEST_F(NTPUtilsTest, MigratesHideWidgetTrue) { // Manually turn all off - auto* prefs = profile()->GetPrefs(); + auto* prefs = GetPrefs(); prefs->SetBoolean(kNewTabPageShowRewards, false); prefs->SetBoolean(kNewTabPageShowBraveTalk, false); // Migrate - new_tab_page::MigrateNewTabPagePrefs(profile()); + new_tab_page::MigrateNewTabPagePrefs(GetPrefs()); // Expect migrated to off EXPECT_TRUE(prefs->GetBoolean(kNewTabPageHideAllWidgets)); } TEST_F(NTPUtilsTest, MigratesHideWidgetFalse) { // Manually turn some off - auto* prefs = profile()->GetPrefs(); + auto* prefs = GetPrefs(); prefs->SetBoolean(kNewTabPageShowRewards, false); prefs->SetBoolean(kNewTabPageShowBraveTalk, true); // Migrate - new_tab_page::MigrateNewTabPagePrefs(profile()); + new_tab_page::MigrateNewTabPagePrefs(GetPrefs()); // Expect not migrated EXPECT_FALSE(prefs->GetBoolean(kNewTabPageHideAllWidgets)); } @@ -57,8 +59,8 @@ TEST_F(NTPUtilsTest, MigratesHideWidgetFalse) { TEST_F(NTPUtilsTest, MigratesHideWidgetFalseDefault) { // Don't manually change any settings // Migrate - new_tab_page::MigrateNewTabPagePrefs(profile()); + new_tab_page::MigrateNewTabPagePrefs(GetPrefs()); // Expect not migrated - auto* prefs = profile()->GetPrefs(); + auto* prefs = GetPrefs(); EXPECT_FALSE(prefs->GetBoolean(kNewTabPageHideAllWidgets)); } diff --git a/browser/search_engines/search_engine_provider_util.cc b/browser/search_engines/search_engine_provider_util.cc index 6e42e2ea5eaa..9d75139b66f8 100644 --- a/browser/search_engines/search_engine_provider_util.cc +++ b/browser/search_engines/search_engine_provider_util.cc @@ -48,8 +48,7 @@ void RegisterSearchEngineProviderPrefsForMigration( kShowAlternativePrivateSearchEngineProviderToggle, false); } -void MigrateSearchEngineProviderPrefs(Profile* profile) { - auto* prefs = profile->GetPrefs(); +void MigrateSearchEngineProviderPrefs(PrefService* prefs) { const bool need_migrate = prefs->GetBoolean(kShowAlternativePrivateSearchEngineProviderToggle) && prefs->GetBoolean(kUseAlternativePrivateSearchEngineProvider); diff --git a/browser/search_engines/search_engine_provider_util.h b/browser/search_engines/search_engine_provider_util.h index 004ea4a2b754..a82c734debd4 100644 --- a/browser/search_engines/search_engine_provider_util.h +++ b/browser/search_engines/search_engine_provider_util.h @@ -21,7 +21,7 @@ void SetBraveAsDefaultPrivateSearchProvider(PrefService* prefs); // For prefs migration. void RegisterSearchEngineProviderPrefsForMigration( user_prefs::PrefRegistrySyncable* registry); -void MigrateSearchEngineProviderPrefs(Profile* profile); +void MigrateSearchEngineProviderPrefs(PrefService* prefs); // Initialize default provider for private profile. void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile* profile); diff --git a/browser/search_engines/search_engine_tracker.cc b/browser/search_engines/search_engine_tracker.cc index 14f315df0823..379f6a259a79 100644 --- a/browser/search_engines/search_engine_tracker.cc +++ b/browser/search_engines/search_engine_tracker.cc @@ -50,6 +50,8 @@ SearchEngineP3A GetSearchEngineProvider(const GURL& search_engine_url, result = SearchEngineP3A::kDaum; } else if (type == SEARCH_ENGINE_NAVER) { result = SearchEngineP3A::kNaver; + } else if (type == SEARCH_ENGINE_BRAVE) { + result = SearchEngineP3A::kBrave; } else if (type == SEARCH_ENGINE_OTHER) { if (base::EndsWith(search_engine_url.host(), "startpage.com", base::CompareCase::INSENSITIVE_ASCII)) { diff --git a/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/BraveTabGroupModelFilter.java b/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/BraveTabGroupModelFilter.java index c4cad9631a72..dfe2413fd4b0 100644 --- a/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/BraveTabGroupModelFilter.java +++ b/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/BraveTabGroupModelFilter.java @@ -12,7 +12,6 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabLaunchType; -import org.chromium.chrome.browser.tab.state.CriticalPersistedTabData; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelFilter; import org.chromium.chrome.browser.tabmodel.TabModelUtils; @@ -39,8 +38,7 @@ public int getParentId(Tab tab) { && SharedPreferencesManager.getInstance().readBoolean( BravePreferenceKeys.BRAVE_TAB_GROUPS_ENABLED, true) && isTabModelRestored() && !mIsResetting) { - Tab parentTab = TabModelUtils.getTabById( - getTabModel(), CriticalPersistedTabData.from(tab).getParentId()); + Tab parentTab = TabModelUtils.getTabById(getTabModel(), tab.getParentId()); if (parentTab != null) { return (int) BraveReflectionUtil.InvokeMethod( TabGroupModelFilter.class, this, "getRootId", Tab.class, parentTab); diff --git a/browser/themes/brave_dark_mode_prefs_migration_browsertest.cc b/browser/themes/brave_dark_mode_prefs_migration_browsertest.cc index 463d0caafac0..1eb98cb0da88 100644 --- a/browser/themes/brave_dark_mode_prefs_migration_browsertest.cc +++ b/browser/themes/brave_dark_mode_prefs_migration_browsertest.cc @@ -24,7 +24,7 @@ IN_PROC_BROWSER_TEST_F(DarkModePrefsMigrationTest, PrefMigrationTest) { browser()->profile()->GetPrefs()->SetInteger(kBraveThemeType, dark_mode_type); // Migrate and check it's done properly with previous profile prefs value. - dark_mode::MigrateBraveDarkModePrefs(browser()->profile()); + dark_mode::MigrateBraveDarkModePrefs(browser()->profile()->GetPrefs()); EXPECT_FALSE(g_browser_process->local_state()-> FindPreference(kBraveDarkMode)->IsDefaultValue()); EXPECT_EQ(dark_mode_type, diff --git a/browser/themes/brave_dark_mode_utils.cc b/browser/themes/brave_dark_mode_utils.cc index 565508a23785..c58e5df8ed34 100644 --- a/browser/themes/brave_dark_mode_utils.cc +++ b/browser/themes/brave_dark_mode_utils.cc @@ -16,7 +16,6 @@ #include "brave/components/l10n/common/localization_util.h" #include "brave/grit/brave_generated_resources.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/profiles/profile.h" #include "chrome/common/channel_info.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_registry_simple.h" @@ -29,8 +28,7 @@ namespace { bool g_is_test_ = false; bool g_system_dark_mode_enabled_in_test_ = false; -void ClearBraveDarkModeProfilePrefs(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); +void ClearBraveDarkModeProfilePrefs(PrefService* prefs) { prefs->ClearPref(kBraveThemeType); prefs->ClearPref(kUseOverriddenBraveThemeType); } @@ -69,19 +67,18 @@ dark_mode::BraveDarkModeType GetDarkModeSwitchValue( namespace dark_mode { -void MigrateBraveDarkModePrefs(Profile* profile) { +void MigrateBraveDarkModePrefs(PrefService* prefs) { auto* local_state = g_browser_process->local_state(); // If migration is done, local state doesn't have default value because // they were explicitly set by primary prefs' value. After that, we don't // need to try migration again and prefs from profiles are already cleared. if (local_state->FindPreference(kBraveDarkMode)->IsDefaultValue()) { - PrefService* prefs = profile->GetPrefs(); local_state->SetInteger(kBraveDarkMode, prefs->GetInteger(kBraveThemeType)); } // Clear deprecated prefs. - ClearBraveDarkModeProfilePrefs(profile); + ClearBraveDarkModeProfilePrefs(prefs); } void RegisterBraveDarkModeLocalStatePrefs(PrefRegistrySimple* registry) { diff --git a/browser/themes/brave_dark_mode_utils.h b/browser/themes/brave_dark_mode_utils.h index 91353ad33302..8e598f958ce2 100644 --- a/browser/themes/brave_dark_mode_utils.h +++ b/browser/themes/brave_dark_mode_utils.h @@ -12,7 +12,7 @@ #include "build/build_config.h" class PrefRegistrySimple; -class Profile; +class PrefService; namespace user_prefs { class PrefRegistrySyncable; @@ -32,7 +32,7 @@ enum class BraveDarkModeType { }; // APIs for prefs. -void MigrateBraveDarkModePrefs(Profile* profile); +void MigrateBraveDarkModePrefs(PrefService* prefs); void RegisterBraveDarkModePrefsForMigration( user_prefs::PrefRegistrySyncable* registry); void RegisterBraveDarkModeLocalStatePrefs(PrefRegistrySimple* registry); diff --git a/browser/themes/brave_dark_mode_utils_android.cc b/browser/themes/brave_dark_mode_utils_android.cc index 8325cd7f21ae..675d3a22aa76 100644 --- a/browser/themes/brave_dark_mode_utils_android.cc +++ b/browser/themes/brave_dark_mode_utils_android.cc @@ -7,8 +7,7 @@ namespace dark_mode { -void MigrateBraveDarkModePrefs(Profile* profile) { -} +void MigrateBraveDarkModePrefs(PrefService* prefs) {} void RegisterBraveDarkModeLocalStatePrefs(PrefRegistrySimple* registry) { } diff --git a/browser/themes/brave_theme_service_browsertest.cc b/browser/themes/brave_theme_service_browsertest.cc index 85c7bfb9bb79..98f012aae636 100644 --- a/browser/themes/brave_theme_service_browsertest.cc +++ b/browser/themes/brave_theme_service_browsertest.cc @@ -100,13 +100,11 @@ class TestNativeThemeObserver : public ui::NativeThemeObserver { #if BUILDFLAG(IS_WIN) void RunLoopRunWithTimeout(base::TimeDelta timeout) { - // ScopedRunLoopTimeout causes a FATAL failure on timeout though, but for us - // the timeout means success, so turn the FATAL failure into success. + // ScopedRunLoopTimeout causes a non-fatal failure on timeout but for us the + // timeout means success, so turn the failure into success. base::RunLoop run_loop; base::test::ScopedRunLoopTimeout run_timeout(FROM_HERE, timeout); - // EXPECT_FATAL_FAILURE() can only reference globals and statics. - static base::RunLoop& static_loop = run_loop; - EXPECT_FATAL_FAILURE(static_loop.Run(), "Run() timed out."); + EXPECT_NONFATAL_FAILURE(run_loop.Run(), "Run() timed out."); } #endif diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index c3d81e5092c3..fdb62f78a921 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -778,7 +778,7 @@ source_set("ui") { "//brave/components/speedreader/common:mojom", "//brave/components/speedreader/resources/panel:generated_resources", "//brave/components/version_info", - "//chrome/app:chromium_strings", + "//chrome/app:branded_strings", "//chrome/browser/ui/tabs:tab_enums", "//components/sync_device_info", "//mojo/public/cpp/bindings", diff --git a/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder.java b/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder.java index 92d0b44dd92b..dc92b4cf2b7c 100644 --- a/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder.java +++ b/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/BraveDropdownItemViewInfoListBuilder.java @@ -42,6 +42,7 @@ class BraveDropdownItemViewInfoListBuilder extends DropdownItemViewInfoListBuild private static final int DROPDOWN_HEIGHT_UNKNOWN = -1; private static final int DEFAULT_SIZE_OF_VISIBLE_GROUP = 5; private Context mContext; + private AutocompleteDelegate mAutocompleteDelegate; BraveDropdownItemViewInfoListBuilder(@NonNull Supplier tabSupplier, BookmarkState bookmarkState, OpenHistoryClustersDelegate openHistoryClustersDelegate) { @@ -50,15 +51,23 @@ class BraveDropdownItemViewInfoListBuilder extends DropdownItemViewInfoListBuild mActivityTabSupplier = tabSupplier; } + public void setAutocompleteDelegate(AutocompleteDelegate autocompleteDelegate) { + mAutocompleteDelegate = autocompleteDelegate; + } + @Override - void initDefaultProcessors(Context context, SuggestionHost host, AutocompleteDelegate delegate, - UrlBarEditingTextStateProvider textProvider) { + void initDefaultProcessors( + Context context, SuggestionHost host, UrlBarEditingTextStateProvider textProvider) { mContext = context; mUrlBarEditingTextProvider = textProvider; - super.initDefaultProcessors(context, host, delegate, textProvider); + super.initDefaultProcessors(context, host, textProvider); if (host instanceof BraveSuggestionHost) { - mBraveSearchBannerProcessor = new BraveSearchBannerProcessor( - context, (BraveSuggestionHost) host, textProvider, delegate); + mBraveSearchBannerProcessor = + new BraveSearchBannerProcessor( + context, + (BraveSuggestionHost) host, + textProvider, + mAutocompleteDelegate); } } diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd index 362cbb9bb108..da209ab3c455 100644 --- a/browser/ui/android/strings/android_chrome_strings.grd +++ b/browser/ui/android/strings/android_chrome_strings.grd @@ -346,6 +346,18 @@ CHAR_LIMIT guidelines: Preload Pages + + Choose whether to preload pages + + + Browsing and searching is faster + + + Brave preloads pages you're likely to visit, so that they load more quickly when you visit them + + + If you allow cookies, Brave may use them when preloading + Preload pages @@ -470,6 +482,17 @@ CHAR_LIMIT guidelines: You can choose your search engine + + + *Title* + + + *Subtitle* + + + *Primary Action* + + Payment apps @@ -1390,6 +1413,9 @@ Your Brave account may have other forms of browsing history like searches and ac To sign out of your Brave sync chain on all websites, <link1>sign out of Brave</link1>. + + Clearing your browsing data doesn't sign you out of your Brave sync chain. To do so, <link1>sign out of Brave</link1>. + Your search engine is %1$sBing. See their instructions for deleting your search history, if applicable. @@ -1633,6 +1659,15 @@ Your Brave account may have other forms of browsing history like searches and ac Depending on your settings, Brave may also send cookies and your current URL + + + + Tracking protection + + + Protection from trackers (third-party cookies, IP tracking, invasive scripts, and more) + + Safety check @@ -1953,6 +1988,11 @@ Your Brave account may have other forms of browsing history like searches and ac Never translate sites + + + Page translated to %1$sEnglish + + Download anyway @@ -2309,9 +2349,6 @@ Your Brave account may have other forms of browsing history like searches and ac Brave sync chain - - Passphrase encryption doesn’t include payment methods and addresses from Google Pay. Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting you'll need to reset sync. <learnmore>Learn more</learnmore> - Payment methods and addresses from Google Pay won’t be encrypted. Browsing history from Brave won’t sync. Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting, you’ll need to reset sync. <learnmore>Learn more</learnmore> @@ -3178,38 +3215,41 @@ To change this setting, <resetlink>reset sync

- Create a profile lock for your car + Create a car profile lock Your info is secured with a profile lock - To sync your Brave info and keep your data secure in the car, you must create a profile lock. You’ll use a code or password every time you enter the car. - - - To sync your Brave info and keep your data secure in the car, you must create a profile lock in your security settings. You’ll use a code or password every time you enter the car. + 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. + + You’ll unlock your screen every time you use the car + - Your saved data will be erased if the profile lock is removed later. + Turning off your profile lock will remove your saved info - Create a profile lock + Create a car profile lock + + + Not now - + Continue without a car profile lock? - - Opening Brave without a profile lock will remove your your saved passwords and payment methods from the car. Using a profile lock keeps this data secure. + + Opening Brave without a profile lock will remove your saved passwords and payment methods from the car. Using a profile lock keeps this data secure. - + Also clear bookmarks, history, and more from this car - + Delete & continue @@ -3774,7 +3814,7 @@ To change this setting, <resetlink>reset sync

- View page insights + View Page Insights Follow @@ -4177,6 +4217,12 @@ To change this setting, <resetlink>reset sync

Request desktop sites by default? + + Brave will request the mobile site when the screen is narrow + + + Go to Settings + Brave will remember your choice @@ -4479,7 +4525,7 @@ To change this setting, <resetlink>reset sync

- Related Insights + Page Insights Page insights back button @@ -4487,6 +4533,15 @@ To change this setting, <resetlink>reset sync

Page insights Loading Indicator + + Your activity is saved in your <link>Brave sync chain</link>. + + + Logo of privacy notice for page insights hub which redirects to my activity page. + + + Close button to close privacy notice of page insights hub. + @@ -5684,6 +5739,18 @@ To change this setting, <resetlink>reset sync

Continue + + Got it + + + More details + + + Can't continue with %1$sidp.example + + + Something went wrong + Signing you in… @@ -5848,6 +5915,9 @@ To change this setting, <resetlink>reset sync

More options + + More options to clear browsing data + Calculating... @@ -5933,6 +6003,35 @@ To change this setting, <resetlink>reset sync

More options + + Playback is unavailable for this page. + + + Loading… + + + + + No passkeys sheet + + + No passkeys sheet opened at full height + + + No passkeys sheet was closed + + + No passkeys available + + + There aren't any passkeys for %1$sexample.com on this device + + + OK + + + Use another device + diff --git a/browser/ui/bookmark/bookmark_tab_helper_browsertest.cc b/browser/ui/bookmark/bookmark_tab_helper_browsertest.cc index 15458a2faacc..35a40d59dd39 100644 --- a/browser/ui/bookmark/bookmark_tab_helper_browsertest.cc +++ b/browser/ui/bookmark/bookmark_tab_helper_browsertest.cc @@ -44,15 +44,15 @@ void AddBookmarkNode(Profile* profile) { bookmarks::BookmarkModel* bookmark_model = BookmarkModelFactory::GetForBrowserContext(profile); - std::vector nodes; - bookmark_model->GetNodesByURL(url, &nodes); + std::vector nodes = + bookmark_model->GetNodesByURL(url); EXPECT_EQ(0UL, nodes.size()); // We need to pass a non-empty title when creating a bookmark so that an // accessible name is also available, otherwise we'll hit a CHECK() and // the test will crash (see accessibility_paint_checks.cc). bookmarks::AddIfNotBookmarked(bookmark_model, url, u"brave"); - bookmark_model->GetNodesByURL(url, &nodes); + nodes = bookmark_model->GetNodesByURL(url); EXPECT_EQ(1UL, nodes.size()); } diff --git a/browser/ui/brave_tab_strip_model_delegate.cc b/browser/ui/brave_tab_strip_model_delegate.cc index 5b3d264b29bf..2e9ab59e4288 100644 --- a/browser/ui/brave_tab_strip_model_delegate.cc +++ b/browser/ui/brave_tab_strip_model_delegate.cc @@ -25,8 +25,7 @@ bool BraveTabStripModelDelegate::CanMoveTabsToWindow( } void BraveTabStripModelDelegate::CacheWebContents( - const std::vector>& - web_contents) { + const std::vector>& web_contents) { BrowserTabStripModelDelegate::CacheWebContents(web_contents); if (!base::FeatureList::IsEnabled(tabs::features::kBraveSharedPinnedTabs)) { return; diff --git a/browser/ui/brave_tab_strip_model_delegate.h b/browser/ui/brave_tab_strip_model_delegate.h index e6923aa578fc..a2f8f387d447 100644 --- a/browser/ui/brave_tab_strip_model_delegate.h +++ b/browser/ui/brave_tab_strip_model_delegate.h @@ -25,9 +25,8 @@ class BraveTabStripModelDelegate : public BrowserTabStripModelDelegate { // BrowserTabStripModelDelegate: bool CanMoveTabsToWindow(const std::vector& indices) override; - void CacheWebContents( - const std::vector>& - web_contents) override; + void CacheWebContents(const std::vector>& + web_contents) override; }; } // namespace chrome diff --git a/browser/ui/tabs/shared_pinned_tab_service.cc b/browser/ui/tabs/shared_pinned_tab_service.cc index 17ea538a67ba..08e67a0bfe1d 100644 --- a/browser/ui/tabs/shared_pinned_tab_service.cc +++ b/browser/ui/tabs/shared_pinned_tab_service.cc @@ -130,8 +130,7 @@ SharedPinnedTabService::GetTabRendererDataForDummyContents( void SharedPinnedTabService::CacheWebContentsIfNeeded( Browser* browser, - const std::vector>& - web_contents) { + const std::vector>& web_contents) { DVLOG(2) << __FUNCTION__; DCHECK(!profile_will_be_destroyed_); diff --git a/browser/ui/tabs/shared_pinned_tab_service.h b/browser/ui/tabs/shared_pinned_tab_service.h index 2267445bd89d..702f19685638 100644 --- a/browser/ui/tabs/shared_pinned_tab_service.h +++ b/browser/ui/tabs/shared_pinned_tab_service.h @@ -57,8 +57,7 @@ class SharedPinnedTabService : public KeyedService, void CacheWebContentsIfNeeded( Browser* browser, - const std::vector>& - web_contents); + const std::vector>& web_contents); // KeyedService: void Shutdown() override; diff --git a/browser/ui/toolbar/brave_app_menu_model.cc b/browser/ui/toolbar/brave_app_menu_model.cc index 8c4b4ce9f83f..650fb9ec9365 100644 --- a/browser/ui/toolbar/brave_app_menu_model.cc +++ b/browser/ui/toolbar/brave_app_menu_model.cc @@ -18,7 +18,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/ui_features.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #include "ui/base/ui_base_features.h" diff --git a/browser/ui/views/bookmarks/bookmark_bar_browsertest.cc b/browser/ui/views/bookmarks/bookmark_bar_browsertest.cc index e637b200a25b..8014c899ba07 100644 --- a/browser/ui/views/bookmarks/bookmark_bar_browsertest.cc +++ b/browser/ui/views/bookmarks/bookmark_bar_browsertest.cc @@ -1,20 +1,23 @@ -/* Copyright 2020 The Brave Authors. All rights reserved. +/* 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 "brave/browser/ui/brave_view_ids.h" #include "brave/browser/ui/views/bookmarks/bookmark_bar_instructions_view.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/in_process_browser_test.h" +#include "components/bookmarks/browser/bookmark_model.h" +#include "components/bookmarks/browser/bookmark_utils.h" #include "components/bookmarks/common/bookmark_pref_names.h" #include "content/public/test/browser_test.h" +#include "url/gurl.h" class BookmarkBarTest : public InProcessBrowserTest { public: @@ -43,6 +46,10 @@ class BookmarkBarTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(BookmarkBarTest, InstructionsViewTest) { EXPECT_TRUE(GetInstructionView()->GetVisible()); - chrome::ExecuteCommand(browser(), IDC_BOOKMARK_THIS_TAB); + bookmarks::BookmarkModel* model = + BookmarkModelFactory::GetForBrowserContext(browser()->profile()); + bookmarks::AddIfNotBookmarked(model, GURL("http://example.com/"), u"bookmark", + model->bookmark_bar_node()); + EXPECT_FALSE(GetInstructionView()->GetVisible()); } diff --git a/browser/ui/views/brave_first_run_dialog.cc b/browser/ui/views/brave_first_run_dialog.cc index d95af919cbd9..278d16271780 100644 --- a/browser/ui/views/brave_first_run_dialog.cc +++ b/browser/ui/views/brave_first_run_dialog.cc @@ -16,7 +16,7 @@ #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/first_run/first_run_dialog.h" #include "chrome/browser/ui/ui_features.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/gfx/geometry/insets.h" diff --git a/browser/ui/views/frame/brave_browser_non_client_frame_view_mac.mm b/browser/ui/views/frame/brave_browser_non_client_frame_view_mac.mm index 56e4e684001a..925154dece06 100644 --- a/browser/ui/views/frame/brave_browser_non_client_frame_view_mac.mm +++ b/browser/ui/views/frame/brave_browser_non_client_frame_view_mac.mm @@ -62,9 +62,15 @@ } int BraveBrowserNonClientFrameViewMac::GetTopInset(bool restored) const { - if (ShouldShowWindowTitleForVerticalTabs()) { - // Set minimum top inset to show caption buttons on frame. - return 30; + if (tabs::utils::ShouldShowVerticalTabs(browser_view()->browser())) { + if (ShouldShowWindowTitleForVerticalTabs()) { + // Set minimum top inset to show caption buttons on frame. + return 30; + } + + // Bypassing BrowserNonClientFrameViewMac's implementation so that we don't + // have any inset when hiding title bar. + return 0; } if (!tabs::features::HorizontalTabsUpdateEnabled()) { diff --git a/browser/ui/views/frame/brave_browser_view.cc b/browser/ui/views/frame/brave_browser_view.cc index fc91a5449787..60e8c3d5db6a 100644 --- a/browser/ui/views/frame/brave_browser_view.cc +++ b/browser/ui/views/frame/brave_browser_view.cc @@ -269,8 +269,9 @@ void BraveBrowserView::UpdateSideBarHorizontalAlignment() { } void BraveBrowserView::UpdateSearchTabsButtonState() { - if (auto* button = tab_strip_region_view()->tab_search_button()) { - if (button) { + if (auto* tab_search_container = + tab_strip_region_view()->tab_search_container()) { + if (auto* button = tab_search_container->tab_search_button()) { auto is_tab_search_visible = GetProfile()->GetPrefs()->GetBoolean(kTabsSearchShow); button->SetVisible(is_tab_search_visible); 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 06101bdd71ac..20170e1a8cb7 100644 --- a/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc +++ b/browser/ui/views/frame/brave_tabs_search_button_browsertest.cc @@ -43,7 +43,14 @@ IN_PROC_BROWSER_TEST_F(BraveTabsSearchButtonTest, HideShowSettingTest) { button = tab_search_bubble_host->button(); } else { auto* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); - button = browser_view->tab_strip_region_view()->tab_search_button(); + auto* tab_search_container = + browser_view->tab_strip_region_view()->tab_search_container(); + if (!tab_search_container) { + return; + } + button = browser_view->tab_strip_region_view() + ->tab_search_container() + ->tab_search_button(); } ASSERT_NE(nullptr, button); EXPECT_TRUE(button->GetVisible()); diff --git a/browser/ui/views/frame/vertical_tab_strip_region_view.cc b/browser/ui/views/frame/vertical_tab_strip_region_view.cc index cc25c88d873d..606df7839097 100644 --- a/browser/ui/views/frame/vertical_tab_strip_region_view.cc +++ b/browser/ui/views/frame/vertical_tab_strip_region_view.cc @@ -196,8 +196,8 @@ class VerticalTabSearchButton : public BraveTabSearchButton { public: METADATA_HEADER(VerticalTabSearchButton); - explicit VerticalTabSearchButton(TabStrip* tab_strip) - : BraveTabSearchButton(tab_strip) { + explicit VerticalTabSearchButton(TabStrip* tab_strip, Edge flat_edge) + : BraveTabSearchButton(tab_strip, flat_edge) { SetPreferredSize( gfx::Size{ToggleButton::GetIconWidth(), ToggleButton::GetIconWidth()}); SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_SEARCH)); @@ -499,8 +499,8 @@ class VerticalTabStripRegionView::HeaderView : public views::View { // We layout the search button at the end, because there's no // way to change its bubble arrow from TOP_RIGHT at the moment. - tab_search_button_ = AddChildView( - std::make_unique(region_view->tab_strip())); + tab_search_button_ = AddChildView(std::make_unique( + region_view->tab_strip(), Edge::kNone)); UpdateTabSearchButtonVisibility(); } ~HeaderView() override = default; @@ -1145,8 +1145,11 @@ void VerticalTabStripRegionView::UpdateOriginalTabSearchButtonVisibility() { const bool is_vertical_tabs = tabs::utils::ShouldShowVerticalTabs(browser_); const bool use_search_button = browser_->profile()->GetPrefs()->GetBoolean(kTabsSearchShow); - if (auto* tab_search_button = original_region_view_->tab_search_button()) { - tab_search_button->SetVisible(!is_vertical_tabs && use_search_button); + if (auto* tab_search_container = + original_region_view_->tab_search_container()) { + if (auto* tab_search_button = tab_search_container->tab_search_button()) { + tab_search_button->SetVisible(!is_vertical_tabs && use_search_button); + } } } diff --git a/browser/ui/views/location_bar/brave_location_bar_view.cc b/browser/ui/views/location_bar/brave_location_bar_view.cc index c59d9b705e6b..80ad87d30263 100644 --- a/browser/ui/views/location_bar/brave_location_bar_view.cc +++ b/browser/ui/views/location_bar/brave_location_bar_view.cc @@ -29,12 +29,13 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" #include "chrome/browser/ui/views/page_action/page_action_icon_controller.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/grit/brave_components_strings.h" #include "components/omnibox/browser/omnibox_edit_model.h" #include "components/version_info/channel.h" #include "content/public/browser/navigation_entry.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/skia_conversions.h" @@ -348,3 +349,6 @@ BraveLocationBarView::GetContentSettingsImageViewForTesting(size_t idx) { DCHECK(idx < content_setting_views_.size()); return content_setting_views_[idx]; } + +BEGIN_METADATA(BraveLocationBarView, LocationBarView) +END_METADATA diff --git a/browser/ui/views/location_bar/brave_location_bar_view.h b/browser/ui/views/location_bar/brave_location_bar_view.h index a191c06d45a2..d032feb0d41a 100644 --- a/browser/ui/views/location_bar/brave_location_bar_view.h +++ b/browser/ui/views/location_bar/brave_location_bar_view.h @@ -13,6 +13,7 @@ #include "brave/components/ipfs/buildflags/buildflags.h" #include "brave/components/tor/buildflags/buildflags.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" +#include "ui/base/metadata/metadata_header_macros.h" class BraveActionsContainer; class BraveActionsContainerTest; @@ -36,6 +37,7 @@ FORWARD_DECLARE_TEST(BraveRewardsPolicyTest, RewardsIconIsHidden); // - Add the BraveActionsContainer to the location bar class BraveLocationBarView : public LocationBarView { public: + METADATA_HEADER(BraveLocationBarView); using LocationBarView::LocationBarView; BraveLocationBarView(const BraveLocationBarView&) = delete; diff --git a/browser/ui/views/tabs/brave_tab_search_button.cc b/browser/ui/views/tabs/brave_tab_search_button.cc index 195a55aa5b15..7f0ddc5b63da 100644 --- a/browser/ui/views/tabs/brave_tab_search_button.cc +++ b/browser/ui/views/tabs/brave_tab_search_button.cc @@ -21,8 +21,8 @@ #include "ui/gfx/geometry/skia_conversions.h" #include "ui/views/layout/layout_provider.h" -BraveTabSearchButton::BraveTabSearchButton(TabStrip* tab_strip) - : TabSearchButton(tab_strip) { +BraveTabSearchButton::BraveTabSearchButton(TabStrip* tab_strip, Edge flat_edge) + : TabSearchButton(tab_strip, flat_edge) { tab_search_bubble_host_ = std::make_unique( this, tab_strip->controller()->GetProfile()); } diff --git a/browser/ui/views/tabs/brave_tab_search_button.h b/browser/ui/views/tabs/brave_tab_search_button.h index 39479abe7941..abed41ffe513 100644 --- a/browser/ui/views/tabs/brave_tab_search_button.h +++ b/browser/ui/views/tabs/brave_tab_search_button.h @@ -14,7 +14,7 @@ class BraveTabSearchButton : public TabSearchButton { public: METADATA_HEADER(BraveTabSearchButton); - explicit BraveTabSearchButton(TabStrip* tab_strip); + explicit BraveTabSearchButton(TabStrip* tab_strip, Edge flat_edge); ~BraveTabSearchButton() override; BraveTabSearchButton(const BraveTabSearchButton&) = delete; BraveTabSearchButton& operator=(const BraveTabSearchButton&) = delete; diff --git a/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc b/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc index 960c69ccaeb0..406c8a5142d3 100644 --- a/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc +++ b/browser/ui/views/tabs/vertical_tab_strip_browsertest.cc @@ -560,8 +560,13 @@ IN_PROC_BROWSER_TEST_F(VerticalTabStripBrowserTest, OriginalTabSearchButton) { auto* region_view = widget_delegate_view->vertical_tab_strip_region_view(); ASSERT_TRUE(region_view); - auto* original_tab_search_button = - region_view->original_region_view_->tab_search_button(); + auto* tab_search_container = + region_view->original_region_view_->tab_search_container(); + if (!tab_search_container) { + return; + } + + auto* original_tab_search_button = tab_search_container->tab_search_button(); if (!original_tab_search_button) { // On Windows 10, the button is on the window frame and vertical tab strip // does nothing to it. diff --git a/browser/ui/views/window_closing_confirm_dialog_view.cc b/browser/ui/views/window_closing_confirm_dialog_view.cc index 07efde2f676a..08347b3337f4 100644 --- a/browser/ui/views/window_closing_confirm_dialog_view.cc +++ b/browser/ui/views/window_closing_confirm_dialog_view.cc @@ -20,7 +20,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/constrained_window/constrained_window_views.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" diff --git a/browser/ui/wallet_bubble_manager_delegate_impl.cc b/browser/ui/wallet_bubble_manager_delegate_impl.cc index 730a3eba2f79..8968c083ee68 100644 --- a/browser/ui/wallet_bubble_manager_delegate_impl.cc +++ b/browser/ui/wallet_bubble_manager_delegate_impl.cc @@ -22,6 +22,8 @@ #include "chrome/browser/ui/views/frame/top_container_view.h" #include "components/grit/brave_components_strings.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "url/gurl.h" @@ -29,6 +31,8 @@ namespace brave_wallet { class WalletWebUIBubbleDialogView : public WebUIBubbleDialogView { public: + METADATA_HEADER(WalletWebUIBubbleDialogView); + WalletWebUIBubbleDialogView( views::View* anchor_view, BubbleContentsWrapper* contents_wrapper, @@ -51,6 +55,9 @@ class WalletWebUIBubbleDialogView : public WebUIBubbleDialogView { } }; +BEGIN_METADATA(WalletWebUIBubbleDialogView, WebUIBubbleDialogView) +END_METADATA + class WalletWebUIBubbleManager : public BraveWebUIBubbleManager, public views::ViewObserver { public: diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc index 5abab83e33cd..778656e120dd 100644 --- a/browser/ui/webui/brave_webui_source.cc +++ b/browser/ui/webui/brave_webui_source.cc @@ -29,7 +29,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/color/chrome_color_id.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/color/color_provider.h" diff --git a/browser/ui/webui/brave_welcome_ui.cc b/browser/ui/webui/brave_welcome_ui.cc index d015e8bfe2ca..2584457c3bea 100644 --- a/browser/ui/webui/brave_welcome_ui.cc +++ b/browser/ui/webui/brave_welcome_ui.cc @@ -33,7 +33,7 @@ #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h" #include "chrome/common/pref_names.h" #include "chrome/common/webui_url_constants.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/country_codes/country_codes.h" #include "components/grit/brave_components_resources.h" #include "components/grit/brave_components_strings.h" diff --git a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc index ccf99e7d58e6..9b0e4a365120 100644 --- a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc +++ b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc @@ -27,7 +27,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "chrome/common/webui_url_constants.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #include "components/google/core/common/google_util.h" #include "components/grit/brave_components_strings.h" diff --git a/browser/ui/webui/settings/brave_sync_handler.cc b/browser/ui/webui/settings/brave_sync_handler.cc index 8d9be6248292..7230c2e2c78b 100644 --- a/browser/ui/webui/settings/brave_sync_handler.cc +++ b/browser/ui/webui/settings/brave_sync_handler.cc @@ -23,7 +23,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/device_info_sync_service_factory.h" #include "chrome/browser/sync/sync_service_factory.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/service/sync_user_settings.h" #include "components/sync_device_info/device_info_sync_service.h" #include "components/sync_device_info/device_info_tracker.h" diff --git a/browser/ui/webui/settings/brave_sync_handler.h b/browser/ui/webui/settings/brave_sync_handler.h index 9f326b6a8d15..03422d0030be 100644 --- a/browser/ui/webui/settings/brave_sync_handler.h +++ b/browser/ui/webui/settings/brave_sync_handler.h @@ -15,7 +15,7 @@ #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "chrome/services/qrcode_generator/public/cpp/qrcode_generator_service.h" #include "chrome/services/qrcode_generator/public/mojom/qrcode_generator.mojom.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync_device_info/device_info_tracker.h" namespace syncer { diff --git a/browser/ui/webui/welcome_page/brave_welcome_ui.cc b/browser/ui/webui/welcome_page/brave_welcome_ui.cc index 2ce0a0565006..102f1910945b 100644 --- a/browser/ui/webui/welcome_page/brave_welcome_ui.cc +++ b/browser/ui/webui/welcome_page/brave_welcome_ui.cc @@ -27,7 +27,7 @@ #include "chrome/browser/ui/webui/settings/privacy_sandbox_handler.h" #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h" #include "chrome/common/pref_names.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/country_codes/country_codes.h" #include "components/grit/brave_components_resources.h" #include "components/grit/brave_components_strings.h" diff --git a/browser/ui/webui/welcome_page/welcome_dom_handler.cc b/browser/ui/webui/welcome_page/welcome_dom_handler.cc index c80b19d6db71..087372855ab5 100644 --- a/browser/ui/webui/welcome_page/welcome_dom_handler.cc +++ b/browser/ui/webui/welcome_page/welcome_dom_handler.cc @@ -17,7 +17,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/common/webui_url_constants.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" diff --git a/browser/widevine/widevine_prefs_migration_browsertest.cc b/browser/widevine/widevine_prefs_migration_browsertest.cc index 52ca758d5b68..31d73c455d0b 100644 --- a/browser/widevine/widevine_prefs_migration_browsertest.cc +++ b/browser/widevine/widevine_prefs_migration_browsertest.cc @@ -29,7 +29,7 @@ IN_PROC_BROWSER_TEST_F(WidevinePrefsMigrationTest, PrefMigrationTest) { kWidevineEnabledTestValue); // Migrate and check it's done properly with previous profile prefs value. - MigrateWidevinePrefs(browser()->profile()); + MigrateWidevinePrefs(browser()->profile()->GetPrefs()); EXPECT_FALSE(g_browser_process->local_state() ->FindPreference(kWidevineEnabled) ->IsDefaultValue()); diff --git a/browser/widevine/widevine_utils.cc b/browser/widevine/widevine_utils.cc index c1faa40f0337..6079cd9857ed 100644 --- a/browser/widevine/widevine_utils.cc +++ b/browser/widevine/widevine_utils.cc @@ -20,7 +20,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/component_updater/component_updater_utils.h" #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" -#include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" #include "components/component_updater/component_updater_service.h" #include "components/permissions/permission_request_manager.h" @@ -72,8 +71,7 @@ void DeleteOldWidevineBinary() { } #endif -void ClearWidevinePrefs(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); +void ClearWidevinePrefs(PrefService* prefs) { prefs->ClearPref(kWidevineEnabled); } @@ -143,7 +141,7 @@ void SetWidevineEnabled(bool opted_in) { g_browser_process->local_state()->SetBoolean(kWidevineEnabled, opted_in); } -void MigrateWidevinePrefs(Profile* profile) { +void MigrateWidevinePrefs(PrefService* prefs) { DCHECK_CURRENTLY_ON(BrowserThread::UI); auto* local_state = g_browser_process->local_state(); @@ -151,13 +149,12 @@ void MigrateWidevinePrefs(Profile* profile) { // they were explicitly set by primary prefs' value. After that, we don't // need to try migration again and prefs from profiles are already cleared. if (local_state->FindPreference(kWidevineEnabled)->IsDefaultValue()) { - PrefService* prefs = profile->GetPrefs(); local_state->SetBoolean(kWidevineEnabled, prefs->GetBoolean(kWidevineEnabled)); } // Clear deprecated prefs. - ClearWidevinePrefs(profile); + ClearWidevinePrefs(prefs); } void RegisterWidevineLocalstatePrefsForMigration(PrefRegistrySimple* registry) { diff --git a/browser/widevine/widevine_utils.h b/browser/widevine/widevine_utils.h index 136cafd9a475..0f34633afe11 100644 --- a/browser/widevine/widevine_utils.h +++ b/browser/widevine/widevine_utils.h @@ -16,7 +16,6 @@ class PrefRegistrySyncable; class PrefRegistrySimple; class PrefService; -class Profile; // On Android, kWidevineEnabled is written through EnableWidevineCdm() for the // permission prompt, but r/w through BraveLocalState.java on preference screen @@ -31,7 +30,7 @@ void RegisterWidevineLocalstatePrefs(PrefRegistrySimple* registry); void RegisterWidevineLocalstatePrefsForMigration(PrefRegistrySimple* registry); bool IsWidevineEnabled(); void SetWidevineEnabled(bool opted_in); -void MigrateWidevinePrefs(Profile* profile); +void MigrateWidevinePrefs(PrefService* prefs); void MigrateObsoleteWidevineLocalStatePrefs(PrefService* local_state); #endif // BRAVE_BROWSER_WIDEVINE_WIDEVINE_UTILS_H_ diff --git a/build/android/BUILD.gn b/build/android/BUILD.gn index 4b14fef7b5e8..0f8a10e6d121 100644 --- a/build/android/BUILD.gn +++ b/build/android/BUILD.gn @@ -6,6 +6,7 @@ import("//brave/android/brave_xml_preprocessor.gni") import("//brave/build/config.gni") import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") import("//tools/grit/grit_rule.gni") _apksigner = "$android_sdk_build_tools/apksigner" diff --git a/build/android/bytecode/BUILD.gn b/build/android/bytecode/BUILD.gn index c41dc441f275..84e2802f9ff5 100644 --- a/build/android/bytecode/BUILD.gn +++ b/build/android/bytecode/BUILD.gn @@ -71,7 +71,6 @@ java_binary("java_bytecode_rewriter") { "//brave/build/android/bytecode/java/org/brave/bytecode/BravePermissionDialogDelegateClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BravePermissionDialogModelClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BravePreferenceFragmentClassAdapter.java", - "//brave/build/android/bytecode/java/org/brave/bytecode/BravePreferenceKeyCheckerClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BravePrivateTabReauthCoordinatorBaseClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BravePureJavaExceptionReporterClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveQueryTileSectionClassAdapter.java", @@ -86,8 +85,8 @@ java_binary("java_bytecode_rewriter") { "//brave/build/android/bytecode/java/org/brave/bytecode/BraveSiteSettingsCategoryClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveSiteSettingsDelegateClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveSiteSettingsPreferencesBaseClassAdapter.java", - "//brave/build/android/bytecode/java/org/brave/bytecode/BraveStartupPaintPreviewHelperClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveStatusMediatorClassAdapter.java", + "//brave/build/android/bytecode/java/org/brave/bytecode/BraveStrictPreferenceKeyCheckerClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabGroupModelFilterClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabGroupUiCoordinatorClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabHelpersClassAdapter.java", diff --git a/build/android/bytecode/bytecode_rewriter.gni b/build/android/bytecode/bytecode_rewriter.gni index c4413bd40106..0aa0001f01a9 100644 --- a/build/android/bytecode/bytecode_rewriter.gni +++ b/build/android/bytecode/bytecode_rewriter.gni @@ -6,6 +6,7 @@ import("//build/config/python.gni") brave_bytecode_jars = [ + "obj/base/base_shared_preferences_java.javac.jar", "obj/brave/android/features/tab_ui/java.javac.jar", "obj/brave/android/java/org/chromium/chrome/browser/search_engines/java.javac.jar", "obj/brave/browser/notifications/java.javac.jar", diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveAutocompleteMediatorClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveAutocompleteMediatorClassAdapter.java index 5439373d3744..8688e8cc6033 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveAutocompleteMediatorClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveAutocompleteMediatorClassAdapter.java @@ -23,5 +23,8 @@ public BraveAutocompleteMediatorClassAdapter(ClassVisitor visitor) { deleteField(sBraveAutocompleteMediator, "mDropdownViewInfoListManager"); makeProtectedField(sAutocompleteMediator, "mDropdownViewInfoListManager"); + + deleteField(sBraveAutocompleteMediator, "mDropdownViewInfoListBuilder"); + makeProtectedField(sAutocompleteMediator, "mDropdownViewInfoListBuilder"); } } diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java index 8031e87fde29..33909195e754 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java @@ -70,7 +70,6 @@ public static ClassVisitor createAdapter(ClassVisitor chain) { chain = new BravePermissionDialogDelegateClassAdapter(chain); chain = new BravePermissionDialogModelClassAdapter(chain); chain = new BravePreferenceFragmentClassAdapter(chain); - chain = new BravePreferenceKeyCheckerClassAdapter(chain); chain = new BravePrivateTabReauthCoordinatorBaseClassAdapter(chain); chain = new BravePureJavaExceptionReporterClassAdapter(chain); chain = new BraveQueryTileSectionClassAdapter(chain); @@ -85,8 +84,8 @@ public static ClassVisitor createAdapter(ClassVisitor chain) { chain = new BraveSiteSettingsCategoryClassAdapter(chain); chain = new BraveSiteSettingsDelegateClassAdapter(chain); chain = new BraveSiteSettingsPreferencesBaseClassAdapter(chain); - chain = new BraveStartupPaintPreviewHelperClassAdapter(chain); chain = new BraveStatusMediatorClassAdapter(chain); + chain = new BraveStrictPreferenceKeyCheckerClassAdapter(chain); chain = new BraveTabGroupUiCoordinatorClassAdapter(chain); chain = new BraveTabHelpersClassAdapter(chain); chain = new BraveTabSwitcherModeTTCoordinatorClassAdapter(chain); diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveFeedSurfaceMediatorClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveFeedSurfaceMediatorClassAdapter.java index 5529fc7d12a7..9e7be28a2415 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveFeedSurfaceMediatorClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveFeedSurfaceMediatorClassAdapter.java @@ -18,9 +18,6 @@ public BraveFeedSurfaceMediatorClassAdapter(ClassVisitor visitor) { redirectConstructor(sFeedSurfaceMediatorClassName, sBraveFeedSurfaceMediatorClassName); - deleteMethod(sBraveFeedSurfaceMediatorClassName, "destroyPropertiesForStream"); - makePublicMethod(sFeedSurfaceMediatorClassName, "destroyPropertiesForStream"); - deleteField(sBraveFeedSurfaceMediatorClassName, "mCoordinator"); makeProtectedField(sFeedSurfaceMediatorClassName, "mCoordinator"); diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveIntentHandlerClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveIntentHandlerClassAdapter.java index fe81a9ed8b1e..a1dcc39ab430 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveIntentHandlerClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveIntentHandlerClassAdapter.java @@ -14,8 +14,6 @@ public class BraveIntentHandlerClassAdapter extends BraveClassVisitor { public BraveIntentHandlerClassAdapter(ClassVisitor visitor) { super(visitor); - redirectConstructor(sIntentHandlerClassName, sBraveIntentHandlerClassName); - makePublicMethod(sIntentHandlerClassName, "getUrlForCustomTab"); changeMethodOwner( sBraveIntentHandlerClassName, "getUrlForCustomTab", sIntentHandlerClassName); diff --git a/build/android/bytecode/java/org/brave/bytecode/BravePreferenceKeyCheckerClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BravePreferenceKeyCheckerClassAdapter.java deleted file mode 100644 index 8632ed646795..000000000000 --- a/build/android/bytecode/java/org/brave/bytecode/BravePreferenceKeyCheckerClassAdapter.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (c) 2023 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at https://mozilla.org/MPL/2.0/. */ - -package org.brave.bytecode; - -import org.objectweb.asm.ClassVisitor; - -public class BravePreferenceKeyCheckerClassAdapter extends BraveClassVisitor { - static String sChromePreferenceKeyCheckerClassName = - "org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker"; - - static String sBravePreferenceKeyCheckerClassName = - "org/chromium/chrome/browser/preferences/BravePreferenceKeyChecker"; - - public BravePreferenceKeyCheckerClassAdapter(ClassVisitor visitor) { - super(visitor); - changeMethodOwner(sChromePreferenceKeyCheckerClassName, "getInstance", - sBravePreferenceKeyCheckerClassName); - } -} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveStartupPaintPreviewHelperClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveStartupPaintPreviewHelperClassAdapter.java deleted file mode 100644 index d314e49470c2..000000000000 --- a/build/android/bytecode/java/org/brave/bytecode/BraveStartupPaintPreviewHelperClassAdapter.java +++ /dev/null @@ -1,22 +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/. */ - -package org.brave.bytecode; - -import org.objectweb.asm.ClassVisitor; - -public class BraveStartupPaintPreviewHelperClassAdapter extends BraveClassVisitor { - static String sStartupPaintPreviewHelperClassName = - "org/chromium/chrome/browser/paint_preview/StartupPaintPreviewHelper"; - static String sBraveStartupPaintPreviewHelperClassName = - "org/chromium/chrome/browser/paint_preview/BraveStartupPaintPreviewHelper"; - - public BraveStartupPaintPreviewHelperClassAdapter(ClassVisitor visitor) { - super(visitor); - - changeMethodOwner(sStartupPaintPreviewHelperClassName, "isEnabled", - sBraveStartupPaintPreviewHelperClassName); - } -} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveStrictPreferenceKeyCheckerClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveStrictPreferenceKeyCheckerClassAdapter.java new file mode 100644 index 000000000000..5e0c36d084f7 --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveStrictPreferenceKeyCheckerClassAdapter.java @@ -0,0 +1,26 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package org.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveStrictPreferenceKeyCheckerClassAdapter extends BraveClassVisitor { + static String sStrictPreferenceKeyCheckerClassName = + "org/chromium/base/shared_preferences/StrictPreferenceKeyChecker"; + + static String sBraveStrictPreferenceKeyCheckerClassName = + "org/chromium/base/shared_preferences/BraveStrictPreferenceKeyChecker"; + + public BraveStrictPreferenceKeyCheckerClassAdapter(ClassVisitor visitor) { + super(visitor); + + redirectConstructor( + sStrictPreferenceKeyCheckerClassName, sBraveStrictPreferenceKeyCheckerClassName); + + deleteMethod(sBraveStrictPreferenceKeyCheckerClassName, "isKeyInUse"); + makePublicMethod(sStrictPreferenceKeyCheckerClassName, "isKeyInUse"); + } +} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveTabbedActivityClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveTabbedActivityClassAdapter.java index aee6a83f85bb..e8011028c2fa 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveTabbedActivityClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveTabbedActivityClassAdapter.java @@ -50,5 +50,9 @@ public BraveTabbedActivityClassAdapter(ClassVisitor visitor) { makePublicMethod(sChromeTabbedActivityClassName, "hideOverview"); deleteMethod(sChromeTabbedActivityClassName, "supportsDynamicColors"); + + makePublicMethod(sChromeTabbedActivityClassName, "maybeHandleUrlIntent"); + changeMethodOwner( + sChromeTabbedActivityClassName, "maybeHandleUrlIntent", sBraveActivityClassName); } } diff --git a/build/commands/scripts/lint.py b/build/commands/scripts/lint.py index 6c96e43ec8e5..905c59331405 100755 --- a/build/commands/scripts/lint.py +++ b/build/commands/scripts/lint.py @@ -22,8 +22,7 @@ def HasFormatErrors(): # For more options, see vendor/depot_tools/git_cl.py - # Temporarily disable java until we get necessary DEPS in C119. - cmd = ['cl', 'format', '--diff', '--no-java'] + cmd = ['cl', 'format', '--diff'] diff = git_cl.RunGit(cmd).encode('utf-8') if diff: # Verify that git cl format generates a diff diff --git a/build/config/brave_build.gni b/build/config/brave_build.gni index b6809a89fc69..0d2e07fd90eb 100644 --- a/build/config/brave_build.gni +++ b/build/config/brave_build.gni @@ -20,7 +20,6 @@ import("//brave/components/content_settings/core/browser/sources.gni") import("//brave/components/omnibox/browser/sources.gni") import("//brave/components/search_engines/sources.gni") import("//brave/components/sync/service/sources.gni") -import("//brave/components/sync/sources.gni") import("//brave/components/sync_device_info/sources.gni") import("//brave/components/update_client/sources.gni") import("//brave/installer/linux/sources.gni") diff --git a/build/mac/download_hermetic_xcode.py b/build/mac/download_hermetic_xcode.py index 92a826c5cae6..daa96f38eff1 100755 --- a/build/mac/download_hermetic_xcode.py +++ b/build/mac/download_hermetic_xcode.py @@ -22,11 +22,11 @@ def LoadPList(path): return plistlib.load(f) # This contains binaries from Xcode 14.3, along with the macOS 13.3 SDK -XCODE_VERSION = '14.3' +XCODE_VERSION = '15.0' HERMETIC_XCODE_BINARY = ( DEPS_PACKAGES_URL + '/xcode-hermetic-toolchain/xcode-hermetic-toolchain-xcode-' + - XCODE_VERSION + '-sdk-13.3-13.0.tar.gz') + XCODE_VERSION + '-sdk-14.0-13.3.tar.gz') # The toolchain will not be downloaded if the minimum OS version is not met. 19 # is the major version number for macOS 10.15. Xcode 13.2 13C90 only runs on diff --git a/chromium_src/android_webview/common/aw_features.cc b/chromium_src/android_webview/common/aw_features.cc index 0c798b68b7ee..f79a9ff79115 100644 --- a/chromium_src/android_webview/common/aw_features.cc +++ b/chromium_src/android_webview/common/aw_features.cc @@ -13,8 +13,6 @@ namespace android_webview { namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ - {kWebViewAppsPackageNamesServerSideAllowlist, - base::FEATURE_DISABLED_BY_DEFAULT}, {kWebViewEnumerateDevicesCache, base::FEATURE_DISABLED_BY_DEFAULT}, {kWebViewMetricsFiltering, base::FEATURE_DISABLED_BY_DEFAULT}, }}); diff --git a/chromium_src/components/sync/base/features.cc b/chromium_src/base/features.cc similarity index 63% rename from chromium_src/components/sync/base/features.cc rename to chromium_src/base/features.cc index b71d4996d54a..83ae39d85944 100644 --- a/chromium_src/components/sync/base/features.cc +++ b/chromium_src/base/features.cc @@ -3,14 +3,16 @@ * 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/sync/base/features.cc" +#include "src/base/features.cc" #include "base/feature_override.h" -namespace syncer { +namespace base::features { OVERRIDE_FEATURE_DEFAULT_STATES({{ - {kSyncEnableHistoryDataType, base::FEATURE_DISABLED_BY_DEFAULT}, +#if BUILDFLAG(IS_ANDROID) + {kCollectAndroidFrameTimelineMetrics, base::FEATURE_DISABLED_BY_DEFAULT}, +#endif }}); -} // namespace syncer +} // namespace base::features diff --git a/chromium_src/chrome/browser/download/bubble/download_display_controller.cc b/chromium_src/chrome/browser/download/bubble/download_display_controller.cc index 7479dd80bf26..70f02bd85ee7 100644 --- a/chromium_src/chrome/browser/download/bubble/download_display_controller.cc +++ b/chromium_src/chrome/browser/download/bubble/download_display_controller.cc @@ -7,14 +7,17 @@ #define DownloadDisplayController DownloadDisplayControllerChromium +#include "chrome/browser/download/bubble/download_bubble_display_info.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "src/chrome/browser/download/bubble/download_display_controller.cc" #undef DownloadDisplayController void DownloadDisplayController::UpdateToolbarButtonState( - const DownloadDisplayController::AllDownloadUIModelsInfo& info) { - DownloadDisplayControllerChromium::UpdateToolbarButtonState(info); + const DownloadBubbleDisplayInfo& info, + const DownloadDisplay::ProgressInfo& progress_info) { + DownloadDisplayControllerChromium::UpdateToolbarButtonState(info, + progress_info); if (info.all_models_size == 0) { return; @@ -26,7 +29,7 @@ void DownloadDisplayController::UpdateToolbarButtonState( // Show toolbar if there's at least one in-progress download item. // Upstream doesn't show toolbar button when only dangerous files are - // in-progress. We cannot use AllDownloadUIModelsInfo's in_progress_count + // in-progress. We cannot use DownloadBubbleDisplayInfo's in_progress_count // here because it doesn't include dangerous files. std::vector all_models; bubble_controller_->update_service()->GetAllModelsToDisplay( diff --git a/chromium_src/chrome/browser/download/bubble/download_display_controller.h b/chromium_src/chrome/browser/download/bubble/download_display_controller.h index a3967f3e3260..1ed504a44d7c 100644 --- a/chromium_src/chrome/browser/download/bubble/download_display_controller.h +++ b/chromium_src/chrome/browser/download/bubble/download_display_controller.h @@ -28,7 +28,9 @@ class DownloadDisplayController : public DownloadDisplayControllerChromium { using DownloadDisplayControllerChromium::DownloadDisplayControllerChromium; private: - void UpdateToolbarButtonState(const AllDownloadUIModelsInfo& info) override; + void UpdateToolbarButtonState( + const DownloadBubbleDisplayInfo& info, + const DownloadDisplay::ProgressInfo& progress_info) override; }; #endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_DOWNLOAD_BUBBLE_DOWNLOAD_DISPLAY_CONTROLLER_H_ diff --git a/chromium_src/chrome/browser/prefs/browser_prefs.cc b/chromium_src/chrome/browser/prefs/browser_prefs.cc index 72169f24349d..28a84c764cdc 100644 --- a/chromium_src/chrome/browser/prefs/browser_prefs.cc +++ b/chromium_src/chrome/browser/prefs/browser_prefs.cc @@ -70,97 +70,96 @@ #endif // This method should be periodically pruned of year+ old migrations. -void MigrateObsoleteProfilePrefs(Profile* profile) { +void MigrateObsoleteProfilePrefs(PrefService* profile_prefs) { + DCHECK(profile_prefs); // BEGIN_MIGRATE_OBSOLETE_PROFILE_PREFS #if !BUILDFLAG(USE_GCM_FROM_PLATFORM) // Added 02/2020. // Must be called before ChromiumImpl because it's migrating a Chromium pref // to Brave pref. - gcm::MigrateGCMPrefs(profile); + gcm::MigrateGCMPrefs(profile_prefs); #endif - MigrateObsoleteProfilePrefs_ChromiumImpl(profile); + MigrateObsoleteProfilePrefs_ChromiumImpl(profile_prefs); #if BUILDFLAG(ENABLE_WIDEVINE) // Added 11/2019. - MigrateWidevinePrefs(profile); + MigrateWidevinePrefs(profile_prefs); #endif - brave_sync::MigrateBraveSyncPrefs(profile->GetPrefs()); + brave_sync::MigrateBraveSyncPrefs(profile_prefs); // Added 12/2019. - dark_mode::MigrateBraveDarkModePrefs(profile); + dark_mode::MigrateBraveDarkModePrefs(profile_prefs); #if !BUILDFLAG(IS_ANDROID) // Added 9/2020 - new_tab_page::MigrateNewTabPagePrefs(profile); + new_tab_page::MigrateNewTabPagePrefs(profile_prefs); // Added 06/2022 - brave::MigrateSearchEngineProviderPrefs(profile); + brave::MigrateSearchEngineProviderPrefs(profile_prefs); // Added 10/2022 - profile->GetPrefs()->ClearPref(kDefaultBrowserLaunchingCount); + profile_prefs->ClearPref(kDefaultBrowserLaunchingCount); #endif #if BUILDFLAG(ENABLE_EXTENSIONS) // Added 11/2022 - profile->GetPrefs()->ClearPref(kDontAskEnableWebDiscovery); - profile->GetPrefs()->ClearPref(kBraveSearchVisitCount); + profile_prefs->ClearPref(kDontAskEnableWebDiscovery); + profile_prefs->ClearPref(kBraveSearchVisitCount); #endif - brave_wallet::KeyringService::MigrateObsoleteProfilePrefs( - profile->GetPrefs()); - brave_wallet::MigrateObsoleteProfilePrefs(profile->GetPrefs()); + brave_wallet::KeyringService::MigrateObsoleteProfilePrefs(profile_prefs); + brave_wallet::MigrateObsoleteProfilePrefs(profile_prefs); // Added 05/2021 - profile->GetPrefs()->ClearPref(kBraveNewsIntroDismissed); + profile_prefs->ClearPref(kBraveNewsIntroDismissed); // Added 07/2021 - profile->GetPrefs()->ClearPref(prefs::kNetworkPredictionOptions); + profile_prefs->ClearPref(prefs::kNetworkPredictionOptions); // Added 01/2022 - brave_rewards::MigrateObsoleteProfilePrefs(profile->GetPrefs()); + brave_rewards::MigrateObsoleteProfilePrefs(profile_prefs); // Added 05/2022 - translate::ClearMigrationBraveProfilePrefs(profile->GetPrefs()); + translate::ClearMigrationBraveProfilePrefs(profile_prefs); // Added 06/2022 #if BUILDFLAG(ENABLE_CUSTOM_BACKGROUND) - NTPBackgroundPrefs(profile->GetPrefs()).MigrateOldPref(); + NTPBackgroundPrefs(profile_prefs).MigrateOldPref(); #endif // Added 24/11/2022: https://github.com/brave/brave-core/pull/16027 #if !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID) - profile->GetPrefs()->ClearPref(kFTXAccessToken); - profile->GetPrefs()->ClearPref(kFTXOauthHost); - profile->GetPrefs()->ClearPref(kFTXNewTabPageShowFTX); - profile->GetPrefs()->ClearPref(kCryptoDotComNewTabPageShowCryptoDotCom); - profile->GetPrefs()->ClearPref(kCryptoDotComHasBoughtCrypto); - profile->GetPrefs()->ClearPref(kCryptoDotComHasInteracted); - profile->GetPrefs()->ClearPref(kGeminiAccessToken); - profile->GetPrefs()->ClearPref(kGeminiRefreshToken); - profile->GetPrefs()->ClearPref(kNewTabPageShowGemini); + profile_prefs->ClearPref(kFTXAccessToken); + profile_prefs->ClearPref(kFTXOauthHost); + profile_prefs->ClearPref(kFTXNewTabPageShowFTX); + profile_prefs->ClearPref(kCryptoDotComNewTabPageShowCryptoDotCom); + profile_prefs->ClearPref(kCryptoDotComHasBoughtCrypto); + profile_prefs->ClearPref(kCryptoDotComHasInteracted); + profile_prefs->ClearPref(kGeminiAccessToken); + profile_prefs->ClearPref(kGeminiRefreshToken); + profile_prefs->ClearPref(kNewTabPageShowGemini); #endif // Added 24/11/2022: https://github.com/brave/brave-core/pull/16027 #if !BUILDFLAG(IS_IOS) - profile->GetPrefs()->ClearPref(kBinanceAccessToken); - profile->GetPrefs()->ClearPref(kBinanceRefreshToken); - profile->GetPrefs()->ClearPref(kNewTabPageShowBinance); - profile->GetPrefs()->ClearPref(kBraveSuggestedSiteSuggestionsEnabled); + profile_prefs->ClearPref(kBinanceAccessToken); + profile_prefs->ClearPref(kBinanceRefreshToken); + profile_prefs->ClearPref(kNewTabPageShowBinance); + profile_prefs->ClearPref(kBraveSuggestedSiteSuggestionsEnabled); #endif #if defined(TOOLKIT_VIEWS) // Added May 2023 - if (profile->GetPrefs()->GetBoolean( - sidebar::kSidebarAlignmentChangedTemporarily)) { + if (profile_prefs->GetBoolean(sidebar::kSidebarAlignmentChangedTemporarily)) { // If temporarily changed, it means sidebar is set to right. // Just clear alignment prefs as default alignment is changed to right. - profile->GetPrefs()->ClearPref(prefs::kSidePanelHorizontalAlignment); + profile_prefs->ClearPref(prefs::kSidePanelHorizontalAlignment); } - profile->GetPrefs()->ClearPref(sidebar::kSidebarAlignmentChangedTemporarily); + profile_prefs->ClearPref(sidebar::kSidebarAlignmentChangedTemporarily); #endif - brave_news::p3a::MigrateObsoleteProfilePrefs(profile->GetPrefs()); + brave_news::p3a::MigrateObsoleteProfilePrefs(profile_prefs); // Added September 2023 #if !BUILDFLAG(IS_IOS) @@ -228,13 +227,13 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { "Brave.P2A.AdImpressionsPerSegment.weather", "Brave.P2A.AdImpressionsPerSegment.untargeted"}; for (const char* const pref : kLegacyBraveP2AAdPrefs) { - profile->GetPrefs()->ClearPref(pref); + profile_prefs->ClearPref(pref); } #endif // Added 2023-09 ntp_background_images::ViewCounterService::MigrateObsoleteProfilePrefs( - profile->GetPrefs()); + profile_prefs); // END_MIGRATE_OBSOLETE_PROFILE_PREFS } diff --git a/chromium_src/chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.cc b/chromium_src/chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.cc index 9eca51e7a657..2d8f219c541b 100644 --- a/chromium_src/chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.cc +++ b/chromium_src/chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.cc @@ -6,6 +6,8 @@ #include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h" #include "brave/components/privacy_sandbox/brave_privacy_sandbox_settings.h" +#include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h" +#include "chrome/browser/tpcd/experiment/experiment_manager_impl.h" #define BuildServiceInstanceForBrowserContext \ BuildServiceInstanceForBrowserContext_ChromiumImpl @@ -18,7 +20,11 @@ PrivacySandboxSettingsFactory::BuildServiceInstanceForBrowserContext( Profile* profile = Profile::FromBrowserContext(context); return std::make_unique( - std::make_unique(profile), + std::make_unique( + profile, + tpcd::experiment::ExperimentManagerImpl::GetForProfile(profile)), HostContentSettingsMapFactory::GetForProfile(profile), - CookieSettingsFactory::GetForProfile(profile).get(), profile->GetPrefs()); + CookieSettingsFactory::GetForProfile(profile).get(), + TrackingProtectionSettingsFactory::GetForProfile(profile), + profile->GetPrefs()); } diff --git a/chromium_src/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc b/chromium_src/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc index 064b238f246f..f9bd9ee05a8d 100644 --- a/chromium_src/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc +++ b/chromium_src/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc @@ -44,77 +44,97 @@ const auto& BraveSyncablePreferences() { std::string_view, sync_preferences::SyncablePrefMetadata>({ {"profile.content_settings.exceptions.shieldsAds", {brave_syncable_prefs_ids::kProfileContentSettingsExceptionsShieldsAds, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.trackers", {brave_syncable_prefs_ids::kProfileContentSettingsExceptionsTrackers, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.httpsUpgrades", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsHttpsUpgrades, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.httpUpgradableResources", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsHttpUpgradableResources, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.referrers", {brave_syncable_prefs_ids::kProfileContentSettingsExceptionsReferrers, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.shieldsCookiesV3", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsShieldsCookiesV3, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.cosmeticFiltering", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsCosmeticFiltering, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.fingerprintingV2", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsFingerprintingV2, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.braveShields", {brave_syncable_prefs_ids::kProfileContentSettingsExceptionsBraveShields, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.content_settings.exceptions.braveSpeedreader", {brave_syncable_prefs_ids:: kProfileContentSettingsExceptionsBraveSpeedreader, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kMergeableDict}}, {"profile.default_content_setting_values.shieldsAds", {brave_syncable_prefs_ids::kProfileDefaultContentSettingValuesShieldsAds, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.trackers", {brave_syncable_prefs_ids::kProfileDefaultContentSettingValuesTrackers, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.httpsUpgrades", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesHttpsUpgrades, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.httpUpgradableResources", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesHttpUpgradableResources, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.referrers", {brave_syncable_prefs_ids::kProfileDefaultContentSettingValuesReferrers, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.shieldsCookiesV3", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesShieldsCookiesV3, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.cosmeticFiltering", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesCosmeticFiltering, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.fingerprintingV2", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesFingerprintingV2, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.braveShields", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesBraveShields, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, {"profile.default_content_setting_values.braveSpeedreader", {brave_syncable_prefs_ids:: kProfileDefaultContentSettingValuesBraveSpeedreader, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + sync_preferences::MergeBehavior::kNone}}, }); return kBraveSyncablePrefsAllowList; } diff --git a/chromium_src/chrome/browser/ui/cocoa/first_run_dialog_controller.mm b/chromium_src/chrome/browser/ui/cocoa/first_run_dialog_controller.mm index 67cab73bdf9a..3b4748bacc2b 100644 --- a/chromium_src/chrome/browser/ui/cocoa/first_run_dialog_controller.mm +++ b/chromium_src/chrome/browser/ui/cocoa/first_run_dialog_controller.mm @@ -13,7 +13,7 @@ #include "brave/browser/metrics/metrics_reporting_util.h" #include "brave/components/l10n/common/localization_util.h" #include "brave/grit/brave_generated_resources.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h" #include "ui/base/l10n/l10n_util_mac.h" diff --git a/chromium_src/chrome/browser/ui/ui_features.cc b/chromium_src/chrome/browser/ui/ui_features.cc index c5cdbde485b5..9fa636925a8a 100644 --- a/chromium_src/chrome/browser/ui/ui_features.cc +++ b/chromium_src/chrome/browser/ui/ui_features.cc @@ -12,11 +12,12 @@ namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kChromeLabs, base::FEATURE_DISABLED_BY_DEFAULT}, + {kExtensionsMenuInAppMenu, base::FEATURE_DISABLED_BY_DEFAULT}, #if !BUILDFLAG(IS_ANDROID) {kHaTSWebUI, base::FEATURE_DISABLED_BY_DEFAULT}, #endif + {kPowerBookmarksSidePanel, base::FEATURE_DISABLED_BY_DEFAULT}, {kTabHoverCardImages, base::FEATURE_DISABLED_BY_DEFAULT}, - {kExtensionsMenuInAppMenu, base::FEATURE_DISABLED_BY_DEFAULT}, }}); } // namespace features diff --git a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc index ea32f7dfd6e1..2c57c4cbba77 100644 --- a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc +++ b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc @@ -42,12 +42,10 @@ SkRect AdjustRingBounds(const gfx::RectF& ring_bounds) { } // namespace gfx SkColor DownloadToolbarButtonView::GetIconColor() const { - const DownloadDisplayController::IconInfo icon_info = GetIconInfo(); - // Apply active color only when download is completed and user doesn't // interact with this button. - if (icon_info.icon_state == download::DownloadIconState::kComplete && - icon_info.is_active) { + if (GetIconState() == DownloadDisplay::IconState::kComplete && + active_ == DownloadDisplay::IconActive::kActive) { return GetColorProvider()->GetColor(kColorBraveDownloadToolbarButtonActive); } diff --git a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h index 2789690ffa62..ffb5a0c8f6c0 100644 --- a/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h +++ b/chromium_src/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h @@ -16,9 +16,6 @@ PaintButtonContents_UnUsed() {} \ \ protected: \ - DownloadDisplayController::IconInfo GetIconInfo() const { \ - return controller_->GetIconInfo(); \ - } \ void PaintButtonContents #define GetIconColor virtual GetIconColor @@ -34,9 +31,9 @@ class DownloadToolbarButtonView : public DownloadToolbarButtonViewChromium { using DownloadToolbarButtonViewChromium::DownloadToolbarButtonViewChromium; // DownloadToolbarButtonViewChromium overrides: - SkColor GetIconColor() const override; void PaintButtonContents(gfx::Canvas* canvas) override; void UpdateIcon() override; + SkColor GetIconColor() const override; private: bool HasInsecureDownloads(); diff --git a/chromium_src/chrome/browser/ui/views/frame/browser_view_layout.cc b/chromium_src/chrome/browser/ui/views/frame/browser_view_layout.cc index b70a40cb980f..7337707db18f 100644 --- a/chromium_src/chrome/browser/ui/views/frame/browser_view_layout.cc +++ b/chromium_src/chrome/browser/ui/views/frame/browser_view_layout.cc @@ -14,9 +14,15 @@ // Double check if the tab strip is actually visible to calculate constraints. #define SupportsWindowFeature(FEATURE) \ SupportsWindowFeature(FEATURE) && (FEATURE != Browser::FEATURE_TABSTRIP || \ - delegate_->IsTabStripVisible()); + delegate_->ShouldDrawTabStrip()); + +#define BRAVE_BROWSER_VIEW_LAYOUT_CONVERTED_HIT_TEST \ + if (dst->GetWidget() != src->GetWidget()) { \ + return false; \ + } #define SidePanel BraveSidePanel #include "src/chrome/browser/ui/views/frame/browser_view_layout.cc" #undef SidePanel +#undef BRAVE_BROWSER_VIEW_LAYOUT_CONVERTED_HIT_TEST #undef SupportsWindowFeature diff --git a/chromium_src/chrome/browser/ui/views/frame/tab_strip_region_view.cc b/chromium_src/chrome/browser/ui/views/frame/tab_strip_region_view.cc index 844e43a854a7..07aeed426dcc 100644 --- a/chromium_src/chrome/browser/ui/views/frame/tab_strip_region_view.cc +++ b/chromium_src/chrome/browser/ui/views/frame/tab_strip_region_view.cc @@ -13,10 +13,8 @@ #define kButtonSize GetButtonSize() #define NewTabButton BraveNewTabButton -#define TabSearchButton BraveTabSearchButton #include "src/chrome/browser/ui/views/frame/tab_strip_region_view.cc" -#undef TabSearchButton #undef NewTabButton #undef kButtonSize diff --git a/chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc b/chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc index 61fe0251170d..6c6b3ee78f62 100644 --- a/chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc +++ b/chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc @@ -244,9 +244,5 @@ void AddFootnoteViewIfNeeded( set_should_ignore_snapping(true); \ } -// undef upstream one first then define it with our one. -#undef IDS_PERMISSIONS_BUBBLE_PROMPT -#define IDS_PERMISSIONS_BUBBLE_PROMPT IDS_BRAVE_PERMISSIONS_BUBBLE_PROMPT #include "src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc" #undef BRAVE_PERMISSION_PROMPT_BUBBLE_BASE_VIEW -#undef IDS_PERMISSIONS_BUBBLE_PROMPT diff --git a/android/java/org/chromium/chrome/browser/preferences/BravePreferenceKeyChecker.java b/chromium_src/chrome/browser/ui/views/tabs/tab_search_container.cc similarity index 50% rename from android/java/org/chromium/chrome/browser/preferences/BravePreferenceKeyChecker.java rename to chromium_src/chrome/browser/ui/views/tabs/tab_search_container.cc index 14a844d893c6..51836eb1525c 100644 --- a/android/java/org/chromium/chrome/browser/preferences/BravePreferenceKeyChecker.java +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_search_container.cc @@ -3,10 +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/. */ -package org.chromium.chrome.browser.preferences; +#include "brave/browser/ui/views/tabs/brave_new_tab_button.h" +#include "brave/browser/ui/views/tabs/brave_tab_search_button.h" -public class BravePreferenceKeyChecker { - public static ChromePreferenceKeyChecker getInstance() { - return null; - } -} +#define TabSearchButton BraveTabSearchButton + +#include "src/chrome/browser/ui/views/tabs/tab_search_container.cc" + +#undef TabSearchButton diff --git a/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.cc index 0da9f811adc3..84f832bdf19b 100644 --- a/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.cc @@ -14,3 +14,6 @@ std::unique_ptr TranslateBubbleView::CreateTranslateIcon() { #define TranslateBubbleView TranslateBubbleView_ChromiumImpl #include "src/chrome/browser/ui/views/translate/translate_bubble_view.cc" #undef TranslateBubbleView + +BEGIN_METADATA(TranslateBubbleView, TranslateBubbleView_ChromiumImpl) +END_METADATA diff --git a/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.h b/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.h index dd47479b16eb..bbcf46153a42 100644 --- a/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.h +++ b/chromium_src/chrome/browser/ui/views/translate/translate_bubble_view.h @@ -24,6 +24,8 @@ using BraveTranslateBubbleView = TranslateBubbleView; class TranslateBubbleView : public TranslateBubbleView_ChromiumImpl { public: + METADATA_HEADER(TranslateBubbleView); + template explicit TranslateBubbleView(Args&&... args) : TranslateBubbleView_ChromiumImpl(std::forward(args)...) { diff --git a/chromium_src/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc b/chromium_src/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc deleted file mode 100644 index 1f97810d1c59..000000000000 --- a/chromium_src/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2023 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 "ui/base/models/image_model.h" - -#define FromVectorIcon(icon, color) FromVectorIcon(icon, color, 16) - -#include "src/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc" - -#undef FromVectorIcon diff --git a/chromium_src/chrome/browser/ui/webui/help/version_updater_mac.mm b/chromium_src/chrome/browser/ui/webui/help/version_updater_mac.mm index d8c8e210615f..d3e17be8ecd8 100644 --- a/chromium_src/chrome/browser/ui/webui/help/version_updater_mac.mm +++ b/chromium_src/chrome/browser/ui/webui/help/version_updater_mac.mm @@ -14,7 +14,7 @@ #include "brave/components/l10n/common/localization_util.h" #include "chrome/browser/mac/keystone_glue.h" #include "chrome/browser/obsolete_system/obsolete_system.h" -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 0f2bafcd2b50..be80575c987e 100644 --- a/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc @@ -10,7 +10,7 @@ #include "brave/grit/brave_generated_resources.h" // Override some chromium strings -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #undef IDS_SETTINGS_SEARCH_EXPLANATION diff --git a/chromium_src/chrome/common/chrome_features.cc b/chromium_src/chrome/common/chrome_features.cc index f1567add3646..1b5fa1463bf7 100644 --- a/chromium_src/chrome/common/chrome_features.cc +++ b/chromium_src/chrome/common/chrome_features.cc @@ -20,6 +20,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ #endif {kPrivacyGuide3, base::FEATURE_DISABLED_BY_DEFAULT}, #if BUILDFLAG(IS_ANDROID) + {kPrivacyGuideAndroid, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrivacyGuideAndroidPostMVP, base::FEATURE_DISABLED_BY_DEFAULT}, #endif {kPrivacyGuidePreload, base::FEATURE_DISABLED_BY_DEFAULT}, diff --git a/chromium_src/chrome/common/url_constants.cc b/chromium_src/chrome/common/url_constants.cc index 149d3ec91734..6a1fc70e8a32 100644 --- a/chromium_src/chrome/common/url_constants.cc +++ b/chromium_src/chrome/common/url_constants.cc @@ -67,6 +67,8 @@ const char kIsolatedAppScheme[] = "isolated-app"; const char kChromeNativeScheme[] = "chrome-native"; +const char kChromeSafePageURL[] = "https://support.brave.com/"; + const char kChromeSearchLocalNtpHost[] = "local-ntp"; const char kChromeSearchMostVisitedHost[] = "most-visited"; @@ -125,7 +127,8 @@ const char kExtensionControlledSettingLearnMoreURL[] = const char kExtensionInvalidRequestURL[] = "chrome-extension://invalid/"; -const char kFamilyGroupSiteURL[] = "https://support.brave.com/"; +const char kFamilyGroupCreateURL[] = "https://support.brave.com/"; +const char kFamilyGroupViewURL[] = "https://support.brave.com/"; const char kFlashDeprecationLearnMoreURL[] = "https://blog.chromium.org/2017/07/so-long-and-thanks-for-all-flash.html"; @@ -148,12 +151,20 @@ const char kLearnMoreReportingURL[] = "https://support.brave.com/hc/en-us/articles/" "360017905872-How-do-I-enable-or-disable-automatic-crash-reporting-"; +const char kManage3pcHelpCenterURL[] = "https://support.brave.com/"; + const char kHighEfficiencyModeLearnMoreUrl[] = "https://support.brave.com/hc/en-us/articles/13383683902733"; const char kHighEfficiencyModeTabDiscardingHelpUrl[] = "https://support.brave.com/"; +const char kIncognitoHelpCenterURL[] = "https://support.brave.com"; + +const char kTrackingProtectionHelpCenterURL[] = "https://support.brave.com/"; + +const char kUserBypassHelpCenterURL[] = "https://support.brave.com/"; + const char kManagedUiLearnMoreUrl[] = "https://support.brave.com/"; const char kInsecureDownloadBlockingLearnMoreUrl[] = @@ -178,6 +189,10 @@ const char kPasswordManagerLearnMoreURL[] = "https://support.brave.com/hc/en-us/articles/" "360018185951-How-do-I-use-the-built-in-password-manager-"; +const char kPasswordSharingLearnMoreURL[] = "https://support.brave.com/"; + +const char kPasswordSharingTroubleshootURL[] = "https://support.brave.com/"; + const char kPaymentMethodsURL[] = "https://support.brave.com"; const char kPrivacyLearnMoreURL[] = @@ -200,6 +215,8 @@ const char kSafeBrowsingHelpCenterUpdatedURL[] = "https://support.brave.com/"; const char kSafeBrowsingInChromeHelpCenterURL[] = "https://support.brave.com/"; +const char kSafeBrowsingPTourURL[] = "https://support.brave.com/"; + const char kSafetyTipHelpCenterURL[] = "https://support.brave.com/hc/en-us/articles/17550072876045-Lookalike-URLs"; diff --git a/chromium_src/chrome/grit/generated_resources.h b/chromium_src/chrome/grit/generated_resources.h index 720f53a0a9e0..8b9ea0aae69b 100644 --- a/chromium_src/chrome/grit/generated_resources.h +++ b/chromium_src/chrome/grit/generated_resources.h @@ -10,4 +10,7 @@ #include "../gen/chrome/grit/generated_resources.h" // IWYU pragma: export +#undef IDS_PERMISSIONS_BUBBLE_PROMPT +#define IDS_PERMISSIONS_BUBBLE_PROMPT IDS_BRAVE_PERMISSIONS_BUBBLE_PROMPT + #endif // BRAVE_CHROMIUM_SRC_CHROME_GRIT_GENERATED_RESOURCES_H_ diff --git a/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc b/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc index fbf6b1f56d78..b242ea6cb6ac 100644 --- a/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc +++ b/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc @@ -8,7 +8,7 @@ #include "base/files/file_path.h" #include "base/i18n/case_conversion.h" #include "base/path_service.h" -#include "base/strings/stringprintf.h" +#include "base/strings/strcat.h" #include "base/test/test_reg_util_win.h" #include "base/win/registry.h" #include "base/win/windows_version.h" @@ -27,21 +27,36 @@ namespace install_static { namespace { TEST(ProductInstallDetailsTest, GetInstallSuffix) { - std::wstring suffix; - const std::pair kData[] = { - {L"%ls\\Application", L""}, - {L"%ls\\Application\\", L""}, - {L"\\%ls\\Application", L""}, - {L"\\%ls\\Application\\", L""}, - {L"C:\\foo\\%ls\\Application\\foo.exe", L""}, - {L"%ls-Blorf\\Application", L"-Blorf"}, - {L"%ls-Blorf\\Application\\", L"-Blorf"}, - {L"\\%ls-Blorf\\Application", L"-Blorf"}, - {L"\\%ls-Blorf\\Application\\", L"-Blorf"}, - {L"C:\\foo\\%ls-Blorf\\Application\\foo.exe", L"-Blorf"}, + const std::pair kData1[] = { + {L"\\Application", L""}, + {L"\\Application\\", L""}, + {L"-Blorf\\Application", L"-Blorf"}, + {L"-Blorf\\Application\\", L"-Blorf"}, }; - for (const auto& data : kData) { - const std::wstring path = base::StringPrintf(data.first, kProductPathName); + for (const auto& data : kData1) { + const std::wstring path = base::StrCat({kProductPathName, data.first}); + EXPECT_EQ(std::wstring(data.second), GetInstallSuffix(path)) << path; + } + + const std::pair kData2[] = { + {L"\\Application", L""}, + {L"\\Application\\", L""}, + {L"-Blorf\\Application", L"-Blorf"}, + {L"-Blorf\\Application\\", L"-Blorf"}, + }; + for (const auto& data : kData2) { + const std::wstring path = + base::StrCat({L"\\", kProductPathName, data.first}); + EXPECT_EQ(std::wstring(data.second), GetInstallSuffix(path)) << path; + } + + const std::pair kData3[] = { + {L"-Blorf\\Application\\foo.exe", L"-Blorf"}, + {L"\\Application\\foo.exe", L""}, + }; + for (const auto& data : kData3) { + const std::wstring path = + base::StrCat({L"C:\\foo\\", kProductPathName, data.first}); EXPECT_EQ(std::wstring(data.second), GetInstallSuffix(path)) << path; } } diff --git a/chromium_src/chrome/installer/setup/brave_behaviors.cc b/chromium_src/chrome/installer/setup/brave_behaviors.cc index e3f9eb65df07..b696b66785d1 100644 --- a/chromium_src/chrome/installer/setup/brave_behaviors.cc +++ b/chromium_src/chrome/installer/setup/brave_behaviors.cc @@ -7,6 +7,10 @@ #include +#include "base/strings/strcat.h" +#include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" + #define DoPostUninstallOperations DoPostUninstallOperations_UNUSED #include "src/chrome/installer/setup/google_chrome_behaviors.cc" #undef DoPostUninstallOperations @@ -38,9 +42,9 @@ void DoPostUninstallOperations(const base::Version& version, // string before using it in a URL. const base::win::OSInfo* os_info = base::win::OSInfo::GetInstance(); base::win::OSInfo::VersionNumber version_number = os_info->version_number(); - std::wstring os_version = - base::StringPrintf(L"%d.%d.%d", version_number.major, - version_number.minor, version_number.build); + const std::wstring os_version = base::ASCIIToWide( + base::StringPrintf("%d.%d.%d", version_number.major, version_number.minor, + version_number.build)); const std::wstring survey_url = std::wstring(kBraveUninstallSurveyUrl); #if DCHECK_IS_ON() @@ -50,9 +54,9 @@ void DoPostUninstallOperations(const base::Version& version, DCHECK_EQ(survey_url.find(L'?', pos + 1), std::wstring::npos); DCHECK_NE(survey_url.back(), L'&'); #endif - auto url = base::StringPrintf(L"%ls&crversion=%ls&os=%ls", survey_url.c_str(), - base::ASCIIToWide(version.GetString()).c_str(), - os_version.c_str()); + auto url = base::StrCat({survey_url, L"&crversion=", + base::ASCIIToWide(version.GetString()), L"&os=", + os_version}); if (os_info->version() < base::win::Version::WIN10 || !NavigateToUrlWithEdge(url)) { NavigateToUrlWithIExplore(url); diff --git a/chromium_src/components/attribution_reporting/features.cc b/chromium_src/components/attribution_reporting/features.cc index 0ac55bb6f2ed..2a22ac7c7fcf 100644 --- a/chromium_src/components/attribution_reporting/features.cc +++ b/chromium_src/components/attribution_reporting/features.cc @@ -7,11 +7,12 @@ #include "base/feature_override.h" -namespace attribution_reporting { +namespace attribution_reporting::features { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kAttributionReportingNullAggregatableReports, base::FEATURE_DISABLED_BY_DEFAULT}, + {kConversionMeasurement, base::FEATURE_DISABLED_BY_DEFAULT}, }}); -} // namespace attribution_reporting +} // namespace attribution_reporting::features diff --git a/chromium_src/components/browser_sync/DEPS b/chromium_src/components/browser_sync/DEPS new file mode 100644 index 000000000000..425a4aee5661 --- /dev/null +++ b/chromium_src/components/browser_sync/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "+brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h", + "+brave/components/history/core/browser/sync/brave_history_model_type_controller.h", +] diff --git a/chromium_src/components/browser_sync/sync_api_component_factory_impl.cc b/chromium_src/components/browser_sync/sync_api_component_factory_impl.cc new file mode 100644 index 000000000000..9816d86c7c9a --- /dev/null +++ b/chromium_src/components/browser_sync/sync_api_component_factory_impl.cc @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 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 "brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h" +#include "brave/components/history/core/browser/sync/brave_history_model_type_controller.h" + +#define HistoryDeleteDirectivesModelTypeController \ + BraveHistoryDeleteDirectivesModelTypeController + +#define HistoryModelTypeController BraveHistoryModelTypeController + +#include "src/components/browser_sync/sync_api_component_factory_impl.cc" + +#undef HistoryModelTypeController +#undef HistoryDeleteDirectivesModelTypeController diff --git a/chromium_src/components/content_settings/core/common/features.cc b/chromium_src/components/content_settings/core/common/features.cc index 327c22b19b0c..e9daa93b8818 100644 --- a/chromium_src/components/content_settings/core/common/features.cc +++ b/chromium_src/components/content_settings/core/common/features.cc @@ -11,8 +11,7 @@ namespace content_settings { namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ - {kThirdPartyCookieDeprecationCookieSettings, - base::FEATURE_DISABLED_BY_DEFAULT}, + {kTrackingProtection3pcd, base::FEATURE_DISABLED_BY_DEFAULT}, {kUserBypassUI, base::FEATURE_DISABLED_BY_DEFAULT}, }}); diff --git a/chromium_src/components/feed/feed_feature_list.cc b/chromium_src/components/feed/feed_feature_list.cc index c1a0d11929a2..4e722bc11d73 100644 --- a/chromium_src/components/feed/feed_feature_list.cc +++ b/chromium_src/components/feed/feed_feature_list.cc @@ -12,7 +12,6 @@ namespace feed { OVERRIDE_FEATURE_DEFAULT_STATES({{ #if BUILDFLAG(IS_ANDROID) - {kInterestFeedContentSuggestions, base::FEATURE_DISABLED_BY_DEFAULT}, {kInterestFeedV2, base::FEATURE_DISABLED_BY_DEFAULT}, #endif }}); diff --git a/chromium_src/components/history/core/browser/history_backend.cc b/chromium_src/components/history/core/browser/history_backend.cc deleted file mode 100644 index 93beb77ef4ef..000000000000 --- a/chromium_src/components/history/core/browser/history_backend.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (c) 2023 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 - -#include "base/check.h" -#include "base/feature_list.h" -#include "base/strings/strcat.h" -#include "brave/components/brave_sync/features.h" -#include "brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.h" -// Forward include to avoid re-define of URLResult::set_blocked_visit -#include "components/history/core/browser/history_types.h" -#include "components/history/core/browser/url_row.h" -#include "ui/base/page_transition_types.h" - -namespace { - -std::u16string GetTransitionString(ui::PageTransition transition_flags) { - std::u16string transition; - switch (transition_flags & ui::PAGE_TRANSITION_CORE_MASK) { -#define TRANSITION_CASE(FLAG) \ - case ui::FLAG: \ - transition = u## #FLAG; \ - break; - - TRANSITION_CASE(PAGE_TRANSITION_LINK) - TRANSITION_CASE(PAGE_TRANSITION_TYPED) - TRANSITION_CASE(PAGE_TRANSITION_AUTO_BOOKMARK) - TRANSITION_CASE(PAGE_TRANSITION_AUTO_SUBFRAME) - TRANSITION_CASE(PAGE_TRANSITION_MANUAL_SUBFRAME) - TRANSITION_CASE(PAGE_TRANSITION_GENERATED) - TRANSITION_CASE(PAGE_TRANSITION_AUTO_TOPLEVEL) - TRANSITION_CASE(PAGE_TRANSITION_FORM_SUBMIT) - TRANSITION_CASE(PAGE_TRANSITION_RELOAD) - TRANSITION_CASE(PAGE_TRANSITION_KEYWORD) - TRANSITION_CASE(PAGE_TRANSITION_KEYWORD_GENERATED) - -#undef TRANSITION_CASE - - default: - DCHECK(false); - } - - return transition; -} - -// Taken from TypedURLSyncBridge::ShouldSyncVisit, it's not static, so can't be -// used directly -bool ShouldSyncVisit(int typed_count, ui::PageTransition transition) { - static const int kTypedUrlVisitThrottleThreshold = 10; - static const int kTypedUrlVisitThrottleMultiple = 10; - - return (ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED) && - (typed_count < kTypedUrlVisitThrottleThreshold || - (typed_count % kTypedUrlVisitThrottleMultiple) == 0)); -} - -std::u16string GetDiagnosticTitle(const history::URLResult& url_result, - const history::VisitRow& visit) { - if (base::FeatureList::IsEnabled( - brave_sync::features::kBraveSyncHistoryDiagnostics)) { - return base::StrCat( - {u"ShouldSync:", - ShouldSyncVisit(url_result.typed_count(), visit.transition) ? u"1" - : u"0", - u" ", std::u16string(u"TypedCount:"), - base::NumberToString16(url_result.typed_count()), u" ", - GetTransitionString(visit.transition), u" ", url_result.title()}); - } else { - return url_result.title(); - } -} - -} // namespace - -// It's possible to redefine set_blocked_visit because it appears only once at -// history_backend.cc -#define set_blocked_visit \ - set_title(GetDiagnosticTitle(url_result, visit)); \ - url_result.set_blocked_visit - -#define TypedURLSyncBridge BraveTypedURLSyncBridge - -#include "src/components/history/core/browser/history_backend.cc" - -#undef TypedURLSyncBridge -#undef set_blocked_visit diff --git a/chromium_src/components/history/core/browser/history_backend.h b/chromium_src/components/history/core/browser/history_backend.h deleted file mode 100644 index 7daa9c1f93ff..000000000000 --- a/chromium_src/components/history/core/browser/history_backend.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (c) 2023 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_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ -#define BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ - -#define TypedURLSyncBridge BraveTypedURLSyncBridge -#include "src/components/history/core/browser/history_backend.h" // IWYU pragma: export -#undef TypedURLSyncBridge - -#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ diff --git a/chromium_src/components/history/core/browser/sync/DEPS b/chromium_src/components/history/core/browser/sync/DEPS new file mode 100644 index 000000000000..f7b30ce80708 --- /dev/null +++ b/chromium_src/components/history/core/browser/sync/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+src/components/history/core/browser/sync/delete_directive_handler_unittest.cc", +] diff --git a/chromium_src/components/history/core/browser/sync/brave_typed_url_sync_bridge_unittest.cc b/chromium_src/components/history/core/browser/sync/brave_typed_url_sync_bridge_unittest.cc deleted file mode 100644 index 86f295ffd1ad..000000000000 --- a/chromium_src/components/history/core/browser/sync/brave_typed_url_sync_bridge_unittest.cc +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2023 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/. */ - -// Run all TypedURLSyncBridgeTest again but with kBraveSyncSendAllHistory -// feature enabled - -#include "brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.h" -#include "base/test/scoped_feature_list.h" -#include "brave/components/brave_sync/features.h" - -#define BRAVE_TEST_MEMBERS_DECLARE \ - base::test::ScopedFeatureList scoped_feature_list_; \ - int kVisitThrottleThreshold; \ - int kVisitThrottleMultiple; - -#define BRAVE_TEST_MEMBERS_INIT \ - scoped_feature_list_.InitWithFeatures( \ - {brave_sync::features::kBraveSyncSendAllHistory}, {}); \ - /* Need these overrides only for */ \ - /* BraveTypedURLSyncBridgeTest.ThrottleVisitLocalTypedUrl only */ \ - kVisitThrottleThreshold = \ - typed_url_sync_bridge_->GetSendAllFlagVisitThrottleThreshold(); \ - kVisitThrottleMultiple = \ - typed_url_sync_bridge_->GetSendAllFlagVisitThrottleMultiple(); - -#define TypedURLSyncBridge BraveTypedURLSyncBridge -#define TypedURLSyncBridgeTest BraveTypedURLSyncBridgeTest -#include "src/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc" -#undef TypedURLSyncBridgeTest -#undef TypedURLSyncBridge -#undef BRAVE_TEST_MEMBERS_INIT -#undef BRAVE_TEST_MEMBERS_DECLARE - -namespace { - -bool IsSendAllHistoryEnabled() { - return base::FeatureList::IsEnabled( - brave_sync::features::kBraveSyncSendAllHistory); -} - -} // namespace - -namespace history { - -URLRow MakeUrlRow(int visit_count, int typed_count) { - URLRow urlRow; - urlRow.set_visit_count(visit_count); - urlRow.set_typed_count(typed_count); - return urlRow; -} - -TEST_F(BraveTypedURLSyncBridgeTest, BraveShouldSyncVisit) { - ASSERT_TRUE(IsSendAllHistoryEnabled()); - - EXPECT_TRUE( - bridge()->ShouldSyncVisit(MakeUrlRow(1, 0), ui::PAGE_TRANSITION_LINK)); - EXPECT_TRUE( - bridge()->ShouldSyncVisit(MakeUrlRow(1, 0), ui::PAGE_TRANSITION_TYPED)); - EXPECT_TRUE( - bridge()->ShouldSyncVisit(MakeUrlRow(20, 0), ui::PAGE_TRANSITION_LINK)); - EXPECT_FALSE( - bridge()->ShouldSyncVisit(MakeUrlRow(21, 0), ui::PAGE_TRANSITION_LINK)); - EXPECT_TRUE( - bridge()->ShouldSyncVisit(MakeUrlRow(30, 0), ui::PAGE_TRANSITION_LINK)); - - { - base::test::ScopedFeatureList scoped_feature_list2; - scoped_feature_list2.InitWithFeatures( - {}, {brave_sync::features::kBraveSyncSendAllHistory}); - EXPECT_FALSE( - bridge()->ShouldSyncVisit(MakeUrlRow(1, 0), ui::PAGE_TRANSITION_LINK)); - EXPECT_TRUE( - bridge()->ShouldSyncVisit(MakeUrlRow(1, 1), ui::PAGE_TRANSITION_TYPED)); - EXPECT_FALSE(bridge()->ShouldSyncVisit(MakeUrlRow(20, 20), - ui::PAGE_TRANSITION_LINK)); - EXPECT_TRUE(bridge()->ShouldSyncVisit(MakeUrlRow(20, 20), - ui::PAGE_TRANSITION_TYPED)); - } -} - -} // namespace history diff --git a/chromium_src/components/history/core/browser/sync/chromium_typed_url_sync_bridge_unittest.cc b/chromium_src/components/history/core/browser/sync/chromium_typed_url_sync_bridge_unittest.cc deleted file mode 100644 index 239d758979bd..000000000000 --- a/chromium_src/components/history/core/browser/sync/chromium_typed_url_sync_bridge_unittest.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2023 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 - -#include "base/test/scoped_feature_list.h" -#include "brave/components/brave_sync/features.h" -#include "brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.h" -#include "components/history/core/browser/sync/typed_url_sync_bridge.h" -#include "components/sync/model/model_type_sync_bridge.h" - -#define BRAVE_TEST_MEMBERS_DECLARE \ - base::test::ScopedFeatureList scoped_feature_list_; - -#define BRAVE_TEST_MEMBERS_INIT \ - scoped_feature_list_.InitWithFeatures( \ - {}, {brave_sync::features::kBraveSyncSendAllHistory}); - -#define TypedURLSyncBridge BraveTypedURLSyncBridge - -#include "src/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc" - -#undef TypedURLSyncBridge - -#undef BRAVE_TEST_MEMBERS_INIT -#undef BRAVE_TEST_MEMBERS_DECLARE diff --git a/chromium_src/components/history/core/browser/sync/delete_directive_handler.cc b/chromium_src/components/history/core/browser/sync/delete_directive_handler.cc new file mode 100644 index 000000000000..3cd07b2061b5 --- /dev/null +++ b/chromium_src/components/history/core/browser/sync/delete_directive_handler.cc @@ -0,0 +1,18 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "components/history/core/browser/sync/delete_directive_handler.h" + +#define CreateUrlDeleteDirective CreateUrlDeleteDirective_ChromiumImpl +#include "src/components/history/core/browser/sync/delete_directive_handler.cc" +#undef CreateUrlDeleteDirective + +namespace history { + +bool DeleteDirectiveHandler::CreateUrlDeleteDirective(const GURL& url) { + return false; +} + +} // namespace history diff --git a/chromium_src/components/history/core/browser/sync/delete_directive_handler.h b/chromium_src/components/history/core/browser/sync/delete_directive_handler.h new file mode 100644 index 000000000000..83c48554e52f --- /dev/null +++ b/chromium_src/components/history/core/browser/sync/delete_directive_handler.h @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 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_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ +#define BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ + +#define CreateTimeRangeDeleteDirective \ + CreateUrlDeleteDirective_ChromiumImpl(const GURL& url); \ + bool CreateTimeRangeDeleteDirective + +#include "src/components/history/core/browser/sync/delete_directive_handler.h" // IWYU pragma: export + +#undef CreateTimeRangeDeleteDirective + +#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ diff --git a/chromium_src/components/history/core/browser/sync/delete_directive_handler_unittest.cc b/chromium_src/components/history/core/browser/sync/delete_directive_handler_unittest.cc new file mode 100644 index 000000000000..565c8fe49d43 --- /dev/null +++ b/chromium_src/components/history/core/browser/sync/delete_directive_handler_unittest.cc @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 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/history/core/browser/sync/delete_directive_handler_unittest.cc" + +namespace history { +namespace { + +TEST_F(HistoryDeleteDirectiveHandlerTest, + BraveCreateUrlDeleteDirectiveReturnsFalse) { + EXPECT_FALSE(handler()->CreateUrlDeleteDirective(GURL("https://brave.com"))); +} + +} // namespace +} // namespace history diff --git a/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.cc b/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.cc deleted file mode 100644 index d1209469b526..000000000000 --- a/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2023 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at https://mozilla.org/MPL/2.0/. */ - -#include "components/history/core/browser/sync/typed_url_sync_bridge.h" - -#include "brave/components/brave_sync/features.h" -#include "ui/base/page_transition_types.h" - -namespace { - -bool IsSendAllHistoryEnabled() { - return base::FeatureList::IsEnabled( - brave_sync::features::kBraveSyncSendAllHistory); -} - -} // namespace - -// } // namespace ui - -#define BRAVE_TYPED_URL_SYNC_BRIDGE_ON_URL_VISITED_REPLACE_SHOULD_SYNC_VISIT \ - if (!ShouldSyncVisit(url_row, visit_row.transition)) { \ - return; \ - } \ - /* Suppress cpplint error: (cpplint) If/else bodies with multiple */ \ - /* statements require braces [readability/braces] [4] */ \ - /* NOLINTNEXTLINE */ \ - if (false) - -#include "src/components/history/core/browser/sync/typed_url_sync_bridge.cc" - -#undef BRAVE_TYPED_URL_SYNC_BRIDGE_ON_URL_VISITED_REPLACE_SHOULD_SYNC_VISIT - -namespace history { - -// static -bool TypedURLSyncBridge::HasTypedUrl(const std::vector& visits) { - if (IsSendAllHistoryEnabled()) { - // We are ignoring only reload transitions, so any other like typed, - // link, bookmark - are accepted as worth to be synced. - return base::ranges::any_of(visits, [](const VisitRow& visit) { - return !ui::PageTransitionCoreTypeIs(visit.transition, - ui::PAGE_TRANSITION_RELOAD); - }); - } - return ::history::HasTypedUrl(visits); -} - -} // namespace history diff --git a/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.h b/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.h deleted file mode 100644 index ebe52b14940f..000000000000 --- a/chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (c) 2023 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_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_ -#define BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_ - -#define ShouldSyncVisit \ - ShouldSyncVisitUnused(); \ - static bool HasTypedUrl(const std::vector& visits); \ - virtual bool ShouldSyncVisit(const URLRow& url_row, \ - ui::PageTransition transition) = 0; \ - friend class BraveTypedURLSyncBridge; \ - friend class BraveTypedURLSyncBridgeTest; \ - bool ShouldSyncVisit - -#include "src/components/history/core/browser/sync/typed_url_sync_bridge.h" // IWYU pragma: export - -#undef ShouldSyncVisit - -#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_ diff --git a/chromium_src/components/history_clusters/core/features.cc b/chromium_src/components/history_clusters/core/features.cc index d8dc01dad859..e84505e01c12 100644 --- a/chromium_src/components/history_clusters/core/features.cc +++ b/chromium_src/components/history_clusters/core/features.cc @@ -16,6 +16,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {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}, diff --git a/chromium_src/components/omnibox/browser/autocomplete_controller.cc b/chromium_src/components/omnibox/browser/autocomplete_controller.cc index ae1318cfa02a..5806705a282b 100644 --- a/chromium_src/components/omnibox/browser/autocomplete_controller.cc +++ b/chromium_src/components/omnibox/browser/autocomplete_controller.cc @@ -134,9 +134,9 @@ void MaybeShowLeoMatch(AutocompleteResult* result) { // the AutocompleteController::SortCullAndAnnotateResult() to make our sorting // run last but before notifying. #define BRAVE_AUTOCOMPLETE_CONTROLLER_UPDATE_RESULT \ - MaybeShowLeoMatch(&result_); \ - SortBraveSearchPromotionMatch(&result_); \ - MaybeShowCommands(&result_, input_); + MaybeShowLeoMatch(&internal_result_); \ + SortBraveSearchPromotionMatch(&internal_result_); \ + MaybeShowCommands(&internal_result_, input_); #include "src/components/omnibox/browser/autocomplete_controller.cc" diff --git a/chromium_src/components/privacy_sandbox/BUILD.gn b/chromium_src/components/privacy_sandbox/BUILD.gn index fa94eb9b995c..fcb669244ede 100644 --- a/chromium_src/components/privacy_sandbox/BUILD.gn +++ b/chromium_src/components/privacy_sandbox/BUILD.gn @@ -17,6 +17,7 @@ source_set("unit_tests") { "//components/privacy_sandbox:privacy_sandbox", "//components/privacy_sandbox:privacy_sandbox_prefs", "//components/privacy_sandbox:test_support", + "//components/privacy_sandbox:tracking_protection_settings", "//components/sync_preferences:test_support", "//content/public/common", "//content/test:test_support", diff --git a/chromium_src/components/privacy_sandbox/privacy_sandbox_features.cc b/chromium_src/components/privacy_sandbox/privacy_sandbox_features.cc index b2d4fca35a40..5f6c80b8dd27 100644 --- a/chromium_src/components/privacy_sandbox/privacy_sandbox_features.cc +++ b/chromium_src/components/privacy_sandbox/privacy_sandbox_features.cc @@ -11,9 +11,13 @@ namespace privacy_sandbox { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kEnforcePrivacySandboxAttestations, base::FEATURE_DISABLED_BY_DEFAULT}, + {kOverridePrivacySandboxSettingsLocalTesting, + base::FEATURE_DISABLED_BY_DEFAULT}, + {kPrivacySandboxFirstPartySetsUI, base::FEATURE_DISABLED_BY_DEFAULT}, + {kPrivacySandboxProactiveTopicsBlocking, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrivacySandboxSettings3, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrivacySandboxSettings4, base::FEATURE_DISABLED_BY_DEFAULT}, - {kOverridePrivacySandboxSettingsLocalTesting, + {kTrackingProtectionOnboardingForceEligibility, base::FEATURE_DISABLED_BY_DEFAULT}, }}); diff --git a/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc b/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc index 73b02c339970..f5c8ba6ddf8d 100644 --- a/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc +++ b/chromium_src/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc @@ -16,6 +16,7 @@ #include "components/content_settings/core/test/content_settings_test_utils.h" #include "components/privacy_sandbox/privacy_sandbox_prefs.h" #include "components/privacy_sandbox/privacy_sandbox_test_util.h" +#include "components/privacy_sandbox/tracking_protection_settings.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "content/public/browser/content_browser_client.h" #include "content/public/test/browser_task_environment.h" @@ -39,6 +40,14 @@ class MockPrivacySandboxDelegate : public PrivacySandboxSettings::Delegate { IsPrivacySandboxCurrentlyUnrestricted, (), (const, override)); + MOCK_METHOD(bool, + IsCookieDeprecationExperimentEligible, + (), + (const, override)); + MOCK_METHOD(bool, + IsCookieDeprecationExperimentCurrentlyEligible, + (), + (const, override)); }; class PrivacySandboxSettingsTest : public testing::Test { @@ -55,6 +64,9 @@ class PrivacySandboxSettingsTest : public testing::Test { false /* restore_session */, false /* should_record_metrics */); cookie_settings_ = new content_settings::CookieSettings( host_content_settings_map_.get(), &prefs_, false, "chrome-extension"); + tracking_protection_settings_ = + std::make_unique(&prefs_, + nullptr); } ~PrivacySandboxSettingsTest() override { host_content_settings_map()->ShutdownOnUIThread(); @@ -68,7 +80,7 @@ class PrivacySandboxSettingsTest : public testing::Test { privacy_sandbox_settings_ = std::make_unique( std::move(mock_delegate), host_content_settings_map(), - cookie_settings(), prefs()); + cookie_settings(), tracking_protection_settings_.get(), prefs()); } virtual void InitializePrefsBeforeStart() {} @@ -93,6 +105,8 @@ class PrivacySandboxSettingsTest : public testing::Test { sync_preferences::TestingPrefServiceSyncable prefs_; scoped_refptr host_content_settings_map_; scoped_refptr cookie_settings_; + std::unique_ptr + tracking_protection_settings_; std::unique_ptr privacy_sandbox_settings_; raw_ptr mock_delegate_; diff --git a/chromium_src/components/safe_browsing/core/common/features.cc b/chromium_src/components/safe_browsing/core/common/features.cc index 056086db8f42..3b8e64799e28 100644 --- a/chromium_src/components/safe_browsing/core/common/features.cc +++ b/chromium_src/components/safe_browsing/core/common/features.cc @@ -17,8 +17,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kDownloadBubbleV2, base::FEATURE_ENABLED_BY_DEFAULT}, #endif {kExtensionTelemetry, base::FEATURE_DISABLED_BY_DEFAULT}, - {kExtensionTelemetryDeclarativeNetRequestSignal, - base::FEATURE_DISABLED_BY_DEFAULT}, {kExtensionTelemetryDisableOffstoreExtensions, base::FEATURE_DISABLED_BY_DEFAULT}, {kExtensionTelemetryTabsApiSignal, base::FEATURE_DISABLED_BY_DEFAULT}, diff --git a/chromium_src/components/search_engines/template_url_prepopulate_data.cc b/chromium_src/components/search_engines/template_url_prepopulate_data.cc index 2b5c66d00421..3156f660c086 100644 --- a/chromium_src/components/search_engines/template_url_prepopulate_data.cc +++ b/chromium_src/components/search_engines/template_url_prepopulate_data.cc @@ -18,6 +18,20 @@ #include "components/country_codes/country_codes.h" #include "components/search_engines/search_engines_pref_names.h" +namespace TemplateURLPrepopulateData { + +// This redeclaration of the upstream prototype for `GetPrepopulatedEngines` is +// necessary, otherwise the translation unit fails to compile on calls for +// `GetPrepopulatedEngines` where there's an expectation for the use of the +// default value of the last two arguents. +std::vector> GetPrepopulatedEngines_Unused( + PrefService* prefs, + size_t* default_search_provider_index, + bool include_current_default = false, + TemplateURLService* template_url_service = nullptr); + +} // namespace TemplateURLPrepopulateData + #define GetDataVersion GetDataVersion_ChromiumImpl #if BUILDFLAG(IS_ANDROID) #define GetLocalPrepopulatedEngines GetLocalPrepopulatedEngines_Unused @@ -595,13 +609,15 @@ int GetDataVersion(PrefService* prefs) { // get search engines defined by Brave. std::vector> GetPrepopulatedEngines( PrefService* prefs, - size_t* default_search_provider_index) { + size_t* default_search_provider_index, + bool include_current_default, + TemplateURLService* template_url_service) { // If there is a set of search engines in the preferences file, it overrides // the built-in set. if (default_search_provider_index) *default_search_provider_index = 0; std::vector> t_urls = - GetPrepopulatedTemplateURLData(prefs); + GetOverriddenTemplateURLData(prefs); if (!t_urls.empty()) return t_urls; diff --git a/chromium_src/components/sync/base/model_type.cc b/chromium_src/components/sync/base/model_type.cc index 42544fa0e299..5507e43be820 100644 --- a/chromium_src/components/sync/base/model_type.cc +++ b/chromium_src/components/sync/base/model_type.cc @@ -14,6 +14,7 @@ ModelTypeSet EncryptableUserTypes() { ModelTypeSet encryptable_user_types = EncryptableUserTypes_ChromiumImpl(); // Brave sync has encryption setup ready when sync chain created encryptable_user_types.Put(DEVICE_INFO); + encryptable_user_types.Put(HISTORY); return encryptable_user_types; } diff --git a/chromium_src/components/sync/base/model_type.h b/chromium_src/components/sync/base/model_type.h new file mode 100644 index 000000000000..8cf19a3bfe0e --- /dev/null +++ b/chromium_src/components/sync/base/model_type.h @@ -0,0 +1,32 @@ +/* Copyright (c) 2023 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_SYNC_BASE_MODEL_TYPE_H_ +#define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_BASE_MODEL_TYPE_H_ + +#define LowPriorityUserTypes LowPriorityUserTypes_ChromiumImpl + +#include "src/components/sync/base/model_type.h" // IWYU pragma: export + +#undef LowPriorityUserTypes + +namespace syncer { + +constexpr ModelTypeSet LowPriorityUserTypes() { + auto low_priority_user_types = LowPriorityUserTypes_ChromiumImpl(); + // Directives must be synced after history entities. If + // history delete directives are processed before retrieving history upon + // initial sync, relevant entries will not be deleted. + // This override must be reverted when + // https://github.com/brave/go-sync/issues/178 will be solved. + low_priority_user_types.Remove(HISTORY); + low_priority_user_types.Put(HISTORY_DELETE_DIRECTIVES); + + return low_priority_user_types; +} + +} // namespace syncer + +#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_BASE_MODEL_TYPE_H_ diff --git a/chromium_src/components/sync/base/model_type_unittest.cc b/chromium_src/components/sync/base/model_type_unittest.cc index c7f0557550da..be67a6d8279e 100644 --- a/chromium_src/components/sync/base/model_type_unittest.cc +++ b/chromium_src/components/sync/base/model_type_unittest.cc @@ -10,6 +10,13 @@ namespace { TEST_F(ModelTypeTest, EncryptableUserTypes) { EXPECT_TRUE(EncryptableUserTypes().Has(DEVICE_INFO)); + EXPECT_TRUE(EncryptableUserTypes().Has(HISTORY)); +} + +TEST_F(ModelTypeTest, LowPriorityUserTypes) { + EXPECT_TRUE(LowPriorityUserTypes().Has(HISTORY_DELETE_DIRECTIVES)); + EXPECT_FALSE(LowPriorityUserTypes().Has(HISTORY)); + EXPECT_TRUE(LowPriorityUserTypes().Has(USER_EVENTS)); } // This test is supposed to fail when sync types are increased/decreased diff --git a/chromium_src/components/sync/engine/cycle/model_neutral_state.h b/chromium_src/components/sync/engine/cycle/model_neutral_state.h index ad563e5529f4..1fc7a67b9770 100644 --- a/chromium_src/components/sync/engine/cycle/model_neutral_state.h +++ b/chromium_src/components/sync/engine/cycle/model_neutral_state.h @@ -7,7 +7,7 @@ #define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_ENGINE_CYCLE_MODEL_NEUTRAL_STATE_H_ #define last_download_updates_result \ - unused; \ + Unused(); \ std::string last_server_error_message; \ SyncerError last_download_updates_result diff --git a/chromium_src/components/sync/engine/sync_engine.h b/chromium_src/components/sync/engine/sync_engine.h index a8ccfff908d1..f811b5abcc17 100644 --- a/chromium_src/components/sync/engine/sync_engine.h +++ b/chromium_src/components/sync/engine/sync_engine.h @@ -7,7 +7,7 @@ #define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_ENGINE_SYNC_ENGINE_H_ #include "base/functional/callback_forward.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #define DisableProtocolEventForwarding \ PermanentlyDeleteAccount( \ diff --git a/chromium_src/components/sync/engine/sync_manager.h b/chromium_src/components/sync/engine/sync_manager.h index e22891d32191..363886c2753f 100644 --- a/chromium_src/components/sync/engine/sync_manager.h +++ b/chromium_src/components/sync/engine/sync_manager.h @@ -7,7 +7,7 @@ #define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ #include "base/functional/callback_forward.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #define ShutdownOnSyncThread \ PermanentlyDeleteAccount( \ diff --git a/chromium_src/components/sync/engine/sync_scheduler.h b/chromium_src/components/sync/engine/sync_scheduler.h index ab55696a82a2..754e6d065a99 100644 --- a/chromium_src/components/sync/engine/sync_scheduler.h +++ b/chromium_src/components/sync/engine/sync_scheduler.h @@ -6,7 +6,7 @@ #ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_ENGINE_SYNC_SCHEDULER_H_ #define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_ENGINE_SYNC_SCHEDULER_H_ -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #define OnCredentialsUpdated \ SchedulePermanentlyDeleteAccount( \ diff --git a/chromium_src/components/sync/engine/sync_scheduler_impl.cc b/chromium_src/components/sync/engine/sync_scheduler_impl.cc index 91817f4d09a2..72390e070be3 100644 --- a/chromium_src/components/sync/engine/sync_scheduler_impl.cc +++ b/chromium_src/components/sync/engine/sync_scheduler_impl.cc @@ -14,7 +14,7 @@ #include "brave/components/sync/engine/brave_sync_server_commands.h" #include "base/functional/callback.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" namespace syncer { diff --git a/chromium_src/components/sync/engine/sync_scheduler_impl.h b/chromium_src/components/sync/engine/sync_scheduler_impl.h index 655c954b7be3..1b0cc159fe38 100644 --- a/chromium_src/components/sync/engine/sync_scheduler_impl.h +++ b/chromium_src/components/sync/engine/sync_scheduler_impl.h @@ -12,7 +12,7 @@ extern const char kNigoriFolderNotReadyError[]; } // namespace syncer -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #define DoPollSyncCycleJob \ HandleBraveConfigurationFailure( \ diff --git a/chromium_src/components/sync/engine/sync_scheduler_impl_unittest.cc b/chromium_src/components/sync/engine/sync_scheduler_impl_unittest.cc index 38c365b22bfe..25a2ca19d278 100644 --- a/chromium_src/components/sync/engine/sync_scheduler_impl_unittest.cc +++ b/chromium_src/components/sync/engine/sync_scheduler_impl_unittest.cc @@ -12,13 +12,13 @@ namespace { void SimulatePollFailedRegularTransientError(ModelTypeSet requested_types, SyncCycle* cycle) { cycle->mutable_status_controller()->set_last_download_updates_result( - SyncerError(SyncerError::SERVER_RETURN_TRANSIENT_ERROR)); + SyncerError::ProtocolError(TRANSIENT_ERROR)); } void SimulatePollFailedNigoryNotReady(ModelTypeSet requested_types, SyncCycle* cycle) { cycle->mutable_status_controller()->set_last_download_updates_result( - SyncerError(SyncerError::SERVER_RETURN_TRANSIENT_ERROR)); + SyncerError::ProtocolError(TRANSIENT_ERROR)); cycle->mutable_status_controller()->set_last_server_error_message( kNigoriFolderNotReadyError); diff --git a/chromium_src/components/sync/service/glue/sync_engine_backend.cc b/chromium_src/components/sync/service/glue/sync_engine_backend.cc index b3c5be1d0978..fa5708a2ad5a 100644 --- a/chromium_src/components/sync/service/glue/sync_engine_backend.cc +++ b/chromium_src/components/sync/service/glue/sync_engine_backend.cc @@ -5,7 +5,7 @@ #include "src/components/sync/service/glue/sync_engine_backend.cc" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" namespace syncer { diff --git a/chromium_src/components/sync/service/glue/sync_engine_impl.h b/chromium_src/components/sync/service/glue/sync_engine_impl.h index 8a12c0bc38f7..ad4e380e42e4 100644 --- a/chromium_src/components/sync/service/glue/sync_engine_impl.h +++ b/chromium_src/components/sync/service/glue/sync_engine_impl.h @@ -11,7 +11,7 @@ // DisableProtocolEventForwarding include explicitly it to avoid compilation // error 'DisableProtocolEventForwarding' macro redefined #include "components/sync/engine/sync_engine.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #define DisableProtocolEventForwarding \ PermanentlyDeleteAccount( \ diff --git a/chromium_src/components/sync_preferences/common_syncable_prefs_database.cc b/chromium_src/components/sync_preferences/common_syncable_prefs_database.cc index ade2fda8d42a..9a37c6ea055b 100644 --- a/chromium_src/components/sync_preferences/common_syncable_prefs_database.cc +++ b/chromium_src/components/sync_preferences/common_syncable_prefs_database.cc @@ -26,10 +26,12 @@ const auto& BraveSyncablePreferences() { base::MakeFixedFlatMap( {{prefs::kSyncedDefaultPrivateSearchProviderGUID, {brave_syncable_prefs_ids::kSyncedDefaultPrivateSearchProviderGUID, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}, + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + MergeBehavior::kNone}}, {prefs::kSyncedDefaultPrivateSearchProviderData, {brave_syncable_prefs_ids::kSyncedDefaultPrivateSearchProviderData, - syncer::PREFERENCES, /*is_history_opt_in_required*/ false}}}); + syncer::PREFERENCES, /*is_history_opt_in_required*/ false, + MergeBehavior::kNone}}}); return kBraveCommonSyncablePrefsAllowlist; } } // namespace diff --git a/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc b/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc index 88714dd9bbda..d9a1df31df53 100644 --- a/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc +++ b/chromium_src/content/browser/aggregation_service/aggregation_service_features.cc @@ -11,6 +11,8 @@ namespace content { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kPrivacySandboxAggregationService, base::FEATURE_DISABLED_BY_DEFAULT}, + {kPrivacySandboxAggregationServiceReportPadding, + base::FEATURE_DISABLED_BY_DEFAULT}, }}); } // namespace content diff --git a/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc b/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc new file mode 100644 index 000000000000..360964af5874 --- /dev/null +++ b/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 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/private_aggregation/private_aggregation_features.cc" + +#include "base/feature_override.h" + +namespace content { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kPrivateAggregationApiBundledEnhancements, + base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace content diff --git a/chromium_src/content/common/features.cc b/chromium_src/content/common/features.cc index 451186a782da..7dc76db6c00f 100644 --- a/chromium_src/content/common/features.cc +++ b/chromium_src/content/common/features.cc @@ -8,10 +8,14 @@ #include "base/feature_override.h" #include "build/build_config.h" -namespace content { +namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kResourceTimingForCancelledNavigationInFrame, + base::FEATURE_DISABLED_BY_DEFAULT}, + {kSignedExchangeReportingForDistributors, + base::FEATURE_DISABLED_BY_DEFAULT}, {kServiceWorkerAutoPreload, base::FEATURE_DISABLED_BY_DEFAULT}, }}); -} // namespace content +} // namespace features diff --git a/chromium_src/content/public/common/content_features.cc b/chromium_src/content/public/common/content_features.cc index e76a061e04d1..ac69b5f78ce5 100644 --- a/chromium_src/content/public/common/content_features.cc +++ b/chromium_src/content/public/common/content_features.cc @@ -19,8 +19,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kIdleDetection, base::FEATURE_DISABLED_BY_DEFAULT}, {kNotificationTriggers, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrivacySandboxAdsAPIsOverride, base::FEATURE_DISABLED_BY_DEFAULT}, - {kSignedExchangeReportingForDistributors, - base::FEATURE_DISABLED_BY_DEFAULT}, {kSignedHTTPExchange, base::FEATURE_DISABLED_BY_DEFAULT}, #if BUILDFLAG(IS_ANDROID) {kWebNfc, base::FEATURE_DISABLED_BY_DEFAULT}, diff --git a/chromium_src/ios/chrome/browser/application_context/model/application_context_impl.mm b/chromium_src/ios/chrome/browser/application_context/model/application_context_impl.mm deleted file mode 100644 index 8d0794c82a37..000000000000 --- a/chromium_src/ios/chrome/browser/application_context/model/application_context_impl.mm +++ /dev/null @@ -1,413 +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 https://mozilla.org/MPL/2.0/. */ - -#include "ios/chrome/browser/application_context/model/application_context_impl.h" - -#include - -#include "base/command_line.h" -#include "base/files/file_path.h" -#include "base/functional/bind.h" -#include "base/memory/ptr_util.h" -#include "base/path_service.h" -#include "base/task/sequenced_task_runner.h" -#include "base/time/default_clock.h" -#include "base/time/default_tick_clock.h" -#include "components/breadcrumbs/core/breadcrumb_manager.h" -#include "components/breadcrumbs/core/breadcrumb_persistent_storage_manager.h" -#include "components/component_updater/component_updater_service.h" -#include "components/component_updater/timer_update_scheduler.h" -#include "components/gcm_driver/gcm_driver.h" -#include "components/history/core/browser/history_service.h" -#include "components/keyed_service/core/service_access_type.h" -#include "components/metrics/metrics_service.h" -#include "components/metrics_services_manager/metrics_services_manager.h" -#include "components/net_log/net_export_file_writer.h" -#include "components/network_time/network_time_tracker.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/pref_service.h" -#include "components/sessions/core/session_id_generator.h" -#include "components/ukm/ukm_service.h" -#import "ios/chrome/app/tests_hook.h" -#include "ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.h" -#import "ios/chrome/browser/browser_state/ios_chrome_io_thread.h" -#include "ios/chrome/browser/component_updater/ios_component_updater_configurator.h" -#import "ios/chrome/browser/crash_report/breadcrumbs/application_breadcrumbs_logger.h" -#include "ios/chrome/browser/history/history_service_factory.h" -#include "ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.h" -#include "ios/chrome/browser/policy/browser_policy_connector_ios.h" -#include "ios/chrome/browser/prefs/ios_chrome_pref_service_factory.h" -#include "ios/chrome/browser/push_notification/push_notification_service.h" -#include "ios/chrome/browser/segmentation_platform/otr_web_state_observer.h" -#include "ios/chrome/browser/shared/model/application_context/application_context.h" -#include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/shared/model/paths/paths.h" -#include "ios/chrome/browser/shared/model/prefs/browser_prefs.h" -#include "ios/chrome/browser/shared/model/prefs/pref_names.h" -#import "ios/components/security_interstitials/safe_browsing/safe_browsing_service.h" -#include "ios/public/provider/chrome/browser/app_distribution/app_distribution_api.h" -#include "ios/public/provider/chrome/browser/push_notification/push_notification_api.h" -#import "ios/public/provider/chrome/browser/signin/signin_identity_api.h" -#include "ios/public/provider/chrome/browser/signin/signin_sso_api.h" -#import "ios/web/public/thread/web_task_traits.h" -#import "ios/web/public/thread/web_thread.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "net/log/net_log.h" -#include "net/log/net_log_capture_mode.h" -#include "net/socket/client_socket_pool_manager.h" -#include "net/url_request/url_request_context_getter.h" -#include "services/metrics/public/cpp/ukm_recorder.h" -#include "services/network/network_change_manager.h" -#include "services/network/public/cpp/network_connection_tracker.h" -#include "services/network/public/cpp/shared_url_loader_factory.h" - -namespace { - -// Passed to NetworkConnectionTracker to bind a NetworkChangeManager receiver. -void BindNetworkChangeManagerReceiver( - network::NetworkChangeManager* network_change_manager, - mojo::PendingReceiver receiver) { - network_change_manager->AddReceiver(std::move(receiver)); -} - -} // namespace - -ApplicationContextImpl::ApplicationContextImpl( - base::SequencedTaskRunner* local_state_task_runner, - const base::CommandLine& command_line, - const std::string& locale, - const std::string& country) - : local_state_task_runner_(local_state_task_runner) { - DCHECK(!GetApplicationContext()); - SetApplicationContext(this); - - SetApplicationLocale(locale); - application_country_ = country; - - // update_client::UpdateQueryParams::SetDelegate( - // IOSChromeUpdateQueryParamsDelegate::GetInstance()); -} - -ApplicationContextImpl::~ApplicationContextImpl() { - DCHECK_EQ(this, GetApplicationContext()); - SetApplicationContext(nullptr); -} - -void ApplicationContextImpl::PreCreateThreads() { - DCHECK(thread_checker_.CalledOnValidThread()); - ios_chrome_io_thread_.reset( - new IOSChromeIOThread(GetLocalState(), GetNetLog())); -} - -void ApplicationContextImpl::PreMainMessageLoopRun() { - DCHECK(thread_checker_.CalledOnValidThread()); -} - -void ApplicationContextImpl::StartTearDown() { - DCHECK(thread_checker_.CalledOnValidThread()); - - // Destroy the segmentation OTR observer before - // `chrome_browser_state_manager_`. - segmentation_otr_web_state_observer_.reset(); - - // We need to destroy the MetricsServicesManager and NetworkTimeTracker before - // the IO thread gets destroyed, since the destructor can call the URLFetcher - // destructor, which does a PostDelayedTask operation on the IO thread. (The - // IO thread will handle that URLFetcher operation before going away.) - metrics::MetricsService* metrics_service = GetMetricsService(); - if (metrics_service) { - metrics_service->LogCleanShutdown(); - } - metrics_services_manager_.reset(); - - // We need to destroy the NetworkTimeTracker before the IO thread gets - // destroyed, since the destructor can call the URLFetcher destructor, - // which does a PostDelayedTask operation on the IO thread. (The IO thread - // will handle that URLFetcher operation before going away.) - network_time_tracker_.reset(); - - net_export_file_writer_.reset(); - - // Need to clear browser states before the IO thread. - chrome_browser_state_manager_.reset(); - - if (local_state_) { - local_state_->CommitPendingWrite(); - sessions::SessionIdGenerator::GetInstance()->Shutdown(); - } - - ios_chrome_io_thread_->NetworkTearDown(); -} - -void ApplicationContextImpl::PostDestroyThreads() { - DCHECK(thread_checker_.CalledOnValidThread()); - // Resets associated state right after actual thread is stopped as - // IOSChromeIOThread::Globals cleanup happens in CleanUp on the IO - // thread, i.e. as the thread exits its message loop. - // - // This is important because in various places, the IOSChromeIOThread - // object being NULL is considered synonymous with the IO thread - // having stopped. - ios_chrome_io_thread_.reset(); -} - -void ApplicationContextImpl::OnAppEnterForeground() { - DCHECK(thread_checker_.CalledOnValidThread()); -} - -void ApplicationContextImpl::OnAppEnterBackground() { - DCHECK(thread_checker_.CalledOnValidThread()); - // Mark all the ChromeBrowserStates as clean and persist history. - std::vector loaded_browser_state = - GetChromeBrowserStateManager()->GetLoadedBrowserStates(); - for (ChromeBrowserState* browser_state : loaded_browser_state) { - if (history::HistoryService* history_service = - ios::HistoryServiceFactory::GetForBrowserStateIfExists( - browser_state, ServiceAccessType::EXPLICIT_ACCESS)) { - history_service->HandleBackgrounding(); - } - - PrefService* browser_state_prefs = browser_state->GetPrefs(); - if (browser_state_prefs) { - browser_state_prefs->CommitPendingWrite(); - } - } -} - -bool ApplicationContextImpl::WasLastShutdownClean() { - DCHECK(thread_checker_.CalledOnValidThread()); - // Make sure the locale state is created as the file is initialized there. - return true; -} - -PrefService* ApplicationContextImpl::GetLocalState() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!local_state_) { - CreateLocalState(); - } - return local_state_.get(); -} - -net::URLRequestContextGetter* -ApplicationContextImpl::GetSystemURLRequestContext() { - DCHECK(thread_checker_.CalledOnValidThread()); - return ios_chrome_io_thread_->system_url_request_context_getter(); -} - -scoped_refptr -ApplicationContextImpl::GetSharedURLLoaderFactory() { - return ios_chrome_io_thread_->GetSharedURLLoaderFactory(); -} - -network::mojom::NetworkContext* -ApplicationContextImpl::GetSystemNetworkContext() { - return ios_chrome_io_thread_->GetSystemNetworkContext(); -} - -const std::string& ApplicationContextImpl::GetApplicationLocale() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(!application_locale_.empty()); - return application_locale_; -} - -const std::string& ApplicationContextImpl::GetApplicationCountry() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(!application_country_.empty()); - return application_country_; -} - -ios::ChromeBrowserStateManager* -ApplicationContextImpl::GetChromeBrowserStateManager() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!chrome_browser_state_manager_) { - chrome_browser_state_manager_.reset(new ChromeBrowserStateManagerImpl()); - } - return chrome_browser_state_manager_.get(); -} - -metrics_services_manager::MetricsServicesManager* -ApplicationContextImpl::GetMetricsServicesManager() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!metrics_services_manager_) { - metrics_services_manager_.reset( - new metrics_services_manager::MetricsServicesManager( - std::make_unique( - GetLocalState()))); - } - return metrics_services_manager_.get(); -} - -metrics::MetricsService* ApplicationContextImpl::GetMetricsService() { - DCHECK(thread_checker_.CalledOnValidThread()); - return GetMetricsServicesManager()->GetMetricsService(); -} - -ukm::UkmRecorder* ApplicationContextImpl::GetUkmRecorder() { - DCHECK(thread_checker_.CalledOnValidThread()); - return nullptr; -} - -variations::VariationsService* ApplicationContextImpl::GetVariationsService() { - DCHECK(thread_checker_.CalledOnValidThread()); - return GetMetricsServicesManager()->GetVariationsService(); -} - -net::NetLog* ApplicationContextImpl::GetNetLog() { - DCHECK(thread_checker_.CalledOnValidThread()); - return net::NetLog::Get(); -} - -net_log::NetExportFileWriter* ApplicationContextImpl::GetNetExportFileWriter() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!net_export_file_writer_) { - net_export_file_writer_ = std::make_unique(); - } - return net_export_file_writer_.get(); -} - -network_time::NetworkTimeTracker* -ApplicationContextImpl::GetNetworkTimeTracker() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!network_time_tracker_) { - network_time_tracker_.reset(new network_time::NetworkTimeTracker( - base::WrapUnique(new base::DefaultClock), - base::WrapUnique(new base::DefaultTickClock), GetLocalState(), - GetSharedURLLoaderFactory())); - } - return network_time_tracker_.get(); -} - -IOSChromeIOThread* ApplicationContextImpl::GetIOSChromeIOThread() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(ios_chrome_io_thread_.get()); - return ios_chrome_io_thread_.get(); -} - -gcm::GCMDriver* ApplicationContextImpl::GetGCMDriver() { - DCHECK(thread_checker_.CalledOnValidThread()); - return nullptr; -} - -component_updater::ComponentUpdateService* -ApplicationContextImpl::GetComponentUpdateService() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!component_updater_) { - // Creating the component updater does not do anything, components need to - // be registered and Start() needs to be called. - component_updater_ = component_updater::ComponentUpdateServiceFactory( - component_updater::MakeIOSComponentUpdaterConfigurator( - base::CommandLine::ForCurrentProcess()), - std::make_unique(), - ios::provider::GetBrandCode()); - } - return component_updater_.get(); -} - -SafeBrowsingService* ApplicationContextImpl::GetSafeBrowsingService() { - DCHECK(thread_checker_.CalledOnValidThread()); - return nullptr; -} - -network::NetworkConnectionTracker* -ApplicationContextImpl::GetNetworkConnectionTracker() { - if (!network_connection_tracker_) { - if (!network_change_manager_) { - network_change_manager_ = - std::make_unique(nullptr); - } - network_connection_tracker_ = - std::make_unique(base::BindRepeating( - &BindNetworkChangeManagerReceiver, - base::Unretained(network_change_manager_.get()))); - } - return network_connection_tracker_.get(); -} - -BrowserPolicyConnectorIOS* ApplicationContextImpl::GetBrowserPolicyConnector() { - DCHECK(thread_checker_.CalledOnValidThread()); - return nullptr; -} - -id ApplicationContextImpl::GetSSOService() { - if (!single_sign_on_service_) { - single_sign_on_service_ = ios::provider::CreateSSOService(); - DCHECK(single_sign_on_service_); - } - return single_sign_on_service_; -} - -SystemIdentityManager* ApplicationContextImpl::GetSystemIdentityManager() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!system_identity_manager_) { - // Give the opportunity for the test hook to override the factory from - // the provider (allowing EG tests to use a fake SystemIdentityManager). - system_identity_manager_ = tests_hook::CreateSystemIdentityManager(); - if (!system_identity_manager_) { - system_identity_manager_ = - ios::provider::CreateSystemIdentityManager(GetSSOService()); - } - DCHECK(system_identity_manager_); - } - return system_identity_manager_.get(); -} - -segmentation_platform::OTRWebStateObserver* -ApplicationContextImpl::GetSegmentationOTRWebStateObserver() { - if (!segmentation_otr_web_state_observer_) { - segmentation_otr_web_state_observer_ = - std::make_unique( - GetChromeBrowserStateManager()); - } - return segmentation_otr_web_state_observer_.get(); -} - -void ApplicationContextImpl::SetApplicationLocale(const std::string& locale) { - DCHECK(thread_checker_.CalledOnValidThread()); - application_locale_ = locale; -} - -void ApplicationContextImpl::CreateLocalState() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(!local_state_); - - base::FilePath local_state_path; - CHECK(base::PathService::Get(ios::FILE_LOCAL_STATE, &local_state_path)); - scoped_refptr pref_registry(new PrefRegistrySimple); - - // Register local state preferences. - RegisterLocalStatePrefs(pref_registry.get()); - - local_state_ = - ::CreateLocalState(local_state_path, local_state_task_runner_.get(), - pref_registry, nullptr, nullptr); - DCHECK(local_state_); - - sessions::SessionIdGenerator::GetInstance()->Init(local_state_.get()); - - net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( - net::HttpNetworkSession::NORMAL_SOCKET_POOL, - std::max(std::min(net::kDefaultMaxSocketsPerProxyServer, 99), - net::ClientSocketPoolManager::max_sockets_per_group( - net::HttpNetworkSession::NORMAL_SOCKET_POOL))); -} - -void ApplicationContextImpl::CreateGCMDriver() { - DCHECK(thread_checker_.CalledOnValidThread()); -} - -PushNotificationService* ApplicationContextImpl::GetPushNotificationService() { - if (!push_notification_service_) { - push_notification_service_ = ios::provider::CreatePushNotificationService(); - DCHECK(push_notification_service_); - } - - return push_notification_service_.get(); -} - -void ApplicationContextImpl::PostCreateThreads() { - web::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&IOSChromeIOThread::InitOnIO, - base::Unretained(ios_chrome_io_thread_.get()))); -} diff --git a/chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.h b/chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.h deleted file mode 100644 index ae52fd7ff33d..000000000000 --- a/chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.h +++ /dev/null @@ -1,18 +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 http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_H_ -#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_H_ - -#include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" - -#define GetPolicyConnector \ - GetPolicyConnector_ChromiumImpl(); \ - BrowserStatePolicyConnector* GetPolicyConnector - -#include "src/ios/chrome/browser/browser_state/chrome_browser_state_impl.h" // IWYU pragma: export -#undef GetPolicyConnector - -#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_H_ diff --git a/chromium_src/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm b/chromium_src/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm similarity index 76% rename from chromium_src/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm rename to chromium_src/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm index 0c2c9c821db3..f07cd83b6d32 100644 --- a/chromium_src/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm +++ b/chromium_src/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm @@ -1,15 +1,15 @@ /* 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 "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h" +#include "ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.h" #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" #include "ios/chrome/browser/bookmarks/model/bookmark_undo_service_factory.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" -#include "ios/chrome/browser/consent_auditor/consent_auditor_factory.h" -#include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "ios/chrome/browser/consent_auditor/model/consent_auditor_factory.h" +#include "ios/chrome/browser/content_settings/model/host_content_settings_map_factory.h" #include "ios/chrome/browser/favicon/favicon_service_factory.h" #include "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #include "ios/chrome/browser/favicon/ios_chrome_large_icon_cache_factory.h" @@ -22,16 +22,12 @@ #include "ios/chrome/browser/search_engines/template_url_service_factory.h" #include "ios/chrome/browser/signin/account_consistency_service_factory.h" #include "ios/chrome/browser/signin/identity_manager_factory.h" -#include "ios/chrome/browser/sync/ios_user_event_service_factory.h" -#include "ios/chrome/browser/sync/model_type_store_service_factory.h" -#include "ios/chrome/browser/sync/session_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service_factory.h" -#include "ios/chrome/browser/webdata_services/web_data_service_factory.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif +#include "ios/chrome/browser/sync/model/ios_user_event_service_factory.h" +#include "ios/chrome/browser/sync/model/model_type_store_service_factory.h" +#include "ios/chrome/browser/sync/model/session_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_setup_service_factory.h" +#include "ios/chrome/browser/webdata_services/model/web_data_service_factory.h" void EnsureBrowserStateKeyedServiceFactoriesBuilt() { autofill::PersonalDataManagerFactory::GetInstance(); diff --git a/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h new file mode 100644 index 000000000000..6e02f058e74e --- /dev/null +++ b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h @@ -0,0 +1,18 @@ +/* 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/. */ + +#ifndef BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ +#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ + +#include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" + +#define GetPolicyConnector \ + GetPolicyConnector_ChromiumImpl(); \ + BrowserStatePolicyConnector* GetPolicyConnector + +#include "src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h" // IWYU pragma: export +#undef GetPolicyConnector + +#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ diff --git a/chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.mm b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm similarity index 76% rename from chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.mm rename to chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm index 02617b26991d..35edfff5535c 100644 --- a/chromium_src/ios/chrome/browser/browser_state/chrome_browser_state_impl.mm +++ b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm @@ -1,11 +1,11 @@ /* Copyright (c) 2022 The Brave Authors. All rights reserved. * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "ios/chrome/browser/browser_state/chrome_browser_state_impl.h" +#include "ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h" -#include "ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_impl.h" +#include "ios/chrome/browser/browser_state/model/off_the_record_chrome_browser_state_impl.h" #include "ios/chrome/browser/policy/browser_policy_connector_ios.h" #include "ios/chrome/browser/policy/browser_state_policy_connector.h" #include "ios/chrome/browser/policy/browser_state_policy_connector_factory.h" @@ -22,7 +22,7 @@ #define GetPolicyConnector GetPolicyConnector_ChromiumImpl -#include "src/ios/chrome/browser/browser_state/chrome_browser_state_impl.mm" +#include "src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm" #undef GetPolicyConnector #undef BuildBrowserStatePolicyConnector diff --git a/chromium_src/ios/chrome/browser/component_updater/ios_component_updater_configurator.mm b/chromium_src/ios/chrome/browser/component_updater/model/ios_component_updater_configurator.mm similarity index 81% rename from chromium_src/ios/chrome/browser/component_updater/ios_component_updater_configurator.mm rename to chromium_src/ios/chrome/browser/component_updater/model/ios_component_updater_configurator.mm index 7fbaf9260ecd..7deb936c7003 100644 --- a/chromium_src/ios/chrome/browser/component_updater/ios_component_updater_configurator.mm +++ b/chromium_src/ios/chrome/browser/component_updater/model/ios_component_updater_configurator.mm @@ -1,7 +1,7 @@ /* 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/. */ + * You can obtain one at https://mozilla.org/MPL/2.0/. */ #include "components/component_updater/configurator_impl.h" @@ -24,5 +24,5 @@ } // namespace component_updater #define ConfiguratorImpl BraveConfiguratorImpl -#include "src/ios/chrome/browser/component_updater/ios_component_updater_configurator.mm" +#include "src/ios/chrome/browser/component_updater/model/ios_component_updater_configurator.mm" #undef ConfiguratorImpl diff --git a/chromium_src/ios/chrome/browser/main/browser_agent_util.mm b/chromium_src/ios/chrome/browser/main/browser_agent_util.mm index b1510f8a9b6f..6f68b6f1bf3d 100644 --- a/chromium_src/ios/chrome/browser/main/browser_agent_util.mm +++ b/chromium_src/ios/chrome/browser/main/browser_agent_util.mm @@ -4,7 +4,7 @@ * You can obtain one at https://mozilla.org/MPL/2.0/. */ #import "ios/chrome/browser/main/browser_agent_util.h" -#include "ios/chrome/browser/send_tab_to_self/send_tab_to_self_browser_agent.h" +#include "ios/chrome/browser/send_tab_to_self/model/send_tab_to_self_browser_agent.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/tabs/synced_window_delegate_browser_agent.h" diff --git a/chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.h b/chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.h similarity index 71% rename from chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.h rename to chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.h index 92f5a749c892..80310cfc4f11 100644 --- a/chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.h +++ b/chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.h @@ -1,10 +1,10 @@ /* Copyright (c) 2022 The Brave Authors. All rights reserved. * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNC_CLIENT_H__ -#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNC_CLIENT_H__ +#ifndef BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_MODEL_IOS_CHROME_SYNC_CLIENT_H_ +#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_MODEL_IOS_CHROME_SYNC_CLIENT_H_ class IOSChromeSyncClient; using IOSChromeSyncClient_BraveImpl = IOSChromeSyncClient; @@ -14,7 +14,7 @@ using IOSChromeSyncClient_BraveImpl = IOSChromeSyncClient; component_factory_; \ friend IOSChromeSyncClient_BraveImpl -#include "src/ios/chrome/browser/sync/ios_chrome_sync_client.h" // IWYU pragma: export +#include "src/ios/chrome/browser/sync/model/ios_chrome_sync_client.h" // IWYU pragma: export #undef component_factory_ #undef IOSChromeSyncClient @@ -32,4 +32,4 @@ class IOSChromeSyncClient : public IOSChromeSyncClient_ChromiumImpl { syncer::SyncService* sync_service) override; }; -#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNC_CLIENT_H__ +#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_SYNC_MODEL_IOS_CHROME_SYNC_CLIENT_H_ diff --git a/chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.mm b/chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm similarity index 80% rename from chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.mm rename to chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm index fbe113b0fc4d..9885667cbef2 100644 --- a/chromium_src/ios/chrome/browser/sync/ios_chrome_sync_client.mm +++ b/chromium_src/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm @@ -1,12 +1,12 @@ /* Copyright (c) 2022 The Brave Authors. All rights reserved. * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "ios/chrome/browser/sync/ios_chrome_sync_client.h" +#include "ios/chrome/browser/sync/model/ios_chrome_sync_client.h" #define IOSChromeSyncClient IOSChromeSyncClient_ChromiumImpl -#include "src/ios/chrome/browser/sync/ios_chrome_sync_client.mm" +#include "src/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm" #undef IOSChromeSyncClient IOSChromeSyncClient::~IOSChromeSyncClient() = default; diff --git a/chromium_src/ios/chrome/browser/sync/sync_service_factory.mm b/chromium_src/ios/chrome/browser/sync/model/sync_service_factory.mm similarity index 77% rename from chromium_src/ios/chrome/browser/sync/sync_service_factory.mm rename to chromium_src/ios/chrome/browser/sync/model/sync_service_factory.mm index 7867420e516c..64009f9faef4 100644 --- a/chromium_src/ios/chrome/browser/sync/sync_service_factory.mm +++ b/chromium_src/ios/chrome/browser/sync/model/sync_service_factory.mm @@ -1,11 +1,11 @@ /* 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 "brave/browser/sync/brave_sync_service_impl_delegate.h" #include "brave/components/sync/service/brave_sync_service_impl.h" -#include "ios/chrome/browser/sync/device_info_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/device_info_sync_service_factory.h" #define BRAVE_BUILD_SERVICE_INSTANCE_FOR \ std::make_unique( \ @@ -13,6 +13,6 @@ std::make_unique( \ DeviceInfoSyncServiceFactory::GetForBrowserState(browser_state))); -#include "src/ios/chrome/browser/sync/sync_service_factory.mm" +#include "src/ios/chrome/browser/sync/model/sync_service_factory.mm" #undef BRAVE_BUILD_SERVICE_INSTANCE_FOR diff --git a/chromium_src/ios/chrome/browser/tabs/tab_helper_util.mm b/chromium_src/ios/chrome/browser/tabs/tab_helper_util.mm index 7da2b3ca767a..dbd786bd7808 100644 --- a/chromium_src/ios/chrome/browser/tabs/tab_helper_util.mm +++ b/chromium_src/ios/chrome/browser/tabs/tab_helper_util.mm @@ -4,9 +4,9 @@ #import "ios/chrome/browser/tabs/tab_helper_util.h" -#include "ios/chrome/browser/complex_tasks/ios_task_tab_helper.h" +#include "ios/chrome/browser/complex_tasks/model/ios_task_tab_helper.h" #include "ios/chrome/browser/sessions/ios_chrome_session_tab_helper.h" -#include "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h" +#include "ios/chrome/browser/sync/model/ios_chrome_synced_tab_delegate.h" #include "ios/chrome/browser/tabs/tab_helper_util.h" #include "ios/chrome/browser/web/session_state/web_session_state_tab_helper.h" diff --git a/chromium_src/ios/chrome/browser/web/DEPS b/chromium_src/ios/chrome/browser/web/DEPS new file mode 100644 index 000000000000..946a7da9925d --- /dev/null +++ b/chromium_src/ios/chrome/browser/web/DEPS @@ -0,0 +1,10 @@ +include_rules = [ + "+src/ios/chrome/browser", +] + +specific_include_rules = { + "chrome_main_parts\.mm": [ + "+brave/ios/browser/application_context/brave_application_context_impl.h", + "+ios/chrome/browser/web/chrome_main_parts.h", + ] +} diff --git a/chromium_src/ios/chrome/browser/web/chrome_main_parts.h b/chromium_src/ios/chrome/browser/web/chrome_main_parts.h new file mode 100644 index 000000000000..b10b5f0b5149 --- /dev/null +++ b/chromium_src/ios/chrome/browser/web/chrome_main_parts.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2023 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_IOS_CHROME_BROWSER_WEB_CHROME_MAIN_PARTS_H_ +#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_WEB_CHROME_MAIN_PARTS_H_ + +#include "ios/web/public/init/web_main_parts.h" + +// Change `PreCreateMainMessageLoop` to `protected` so we can override the +// IE: Change all the ChromeMainParts functions to `protected` instead of +// `private. +#define PreCreateMainMessageLoop \ + PreCreateMainMessageLoop_ChromiumImpl(); \ + \ + protected: \ + void PreCreateMainMessageLoop + +#include "src/ios/chrome/browser/web/chrome_main_parts.h" // IWYU pragma: export +#undef PreCreateMainMessageLoop + +#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_WEB_CHROME_MAIN_PARTS_H_ diff --git a/chromium_src/ios/chrome/browser/web/chrome_main_parts.mm b/chromium_src/ios/chrome/browser/web/chrome_main_parts.mm new file mode 100644 index 000000000000..e7458f1d7815 --- /dev/null +++ b/chromium_src/ios/chrome/browser/web/chrome_main_parts.mm @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 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 "ios/chrome/browser/web/chrome_main_parts.h" +#include "brave/ios/browser/application_context/brave_application_context_impl.h" + +#define PreCreateMainMessageLoop PreCreateMainMessageLoop_ChromiumImpl +#define ApplicationContextImpl BraveApplicationContextImpl +#include "src/ios/chrome/browser/web/chrome_main_parts.mm" +#undef ApplicationContextImpl +#undef PreCreateMainMessageLoop + +void IOSChromeMainParts::PreCreateMainMessageLoop() { + IOSChromeMainParts::PreCreateMainMessageLoop_ChromiumImpl(); +} diff --git a/chromium_src/net/base/features.cc b/chromium_src/net/base/features.cc index e3c922bd8815..405e4de921bf 100644 --- a/chromium_src/net/base/features.cc +++ b/chromium_src/net/base/features.cc @@ -12,7 +12,6 @@ namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kEnableWebTransportDraft07, base::FEATURE_DISABLED_BY_DEFAULT}, - {kNoncedPartitionedCookies, base::FEATURE_DISABLED_BY_DEFAULT}, // Enable NIK-partitioning by default. {kPartitionConnectionsByNetworkIsolationKey, base::FEATURE_ENABLED_BY_DEFAULT}, @@ -28,6 +27,8 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kSupportPartitionedBlobUrl, base::FEATURE_DISABLED_BY_DEFAULT}, {kThirdPartyPartitionedStorageAllowedByDefault, base::FEATURE_DISABLED_BY_DEFAULT}, + {kThirdPartyStoragePartitioning, base::FEATURE_DISABLED_BY_DEFAULT}, + {kWaitForFirstPartySetsInit, base::FEATURE_DISABLED_BY_DEFAULT}, }}); BASE_FEATURE(kBraveEphemeralStorage, diff --git a/chromium_src/third_party/blink/common/features.cc b/chromium_src/third_party/blink/common/features.cc index fcb1aea027d9..9424a784e176 100644 --- a/chromium_src/third_party/blink/common/features.cc +++ b/chromium_src/third_party/blink/common/features.cc @@ -27,7 +27,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kClientHintsFormFactor, base::FEATURE_DISABLED_BY_DEFAULT}, {kClientHintsMetaEquivDelegateCH, base::FEATURE_DISABLED_BY_DEFAULT}, {kComputePressure, base::FEATURE_DISABLED_BY_DEFAULT}, - {kConversionMeasurement, base::FEATURE_DISABLED_BY_DEFAULT}, {kCssSelectorFragmentAnchor, base::FEATURE_DISABLED_BY_DEFAULT}, {kEventTimingReportAllEarlyEntriesOnPaintedPresentation, 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 71ceed9bf152..cfea48676124 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 @@ -57,7 +57,6 @@ bool IsTrialDisabledInBrave(OriginTrialFeature feature) { static const OriginTrialFeature kBraveDisabledTrialFeatures[] = { // NOLINT OriginTrialFeature::kAdInterestGroupAPI, - OriginTrialFeature::kDeviceAttributes, OriginTrialFeature::kDigitalGoods, OriginTrialFeature::kFencedFrames, OriginTrialFeature::kFledge, diff --git a/chromium_src/third_party/blink/renderer/core/frame/local_frame.cc b/chromium_src/third_party/blink/renderer/core/frame/local_frame.cc index fc32e82cdeec..a39d3f1b962e 100644 --- a/chromium_src/third_party/blink/renderer/core/frame/local_frame.cc +++ b/chromium_src/third_party/blink/renderer/core/frame/local_frame.cc @@ -46,8 +46,7 @@ scoped_refptr ImageFromNode(const Node& node) { if (layout_object->IsCanvas()) { return To(const_cast(node)) - .Snapshot(CanvasResourceProvider::FlushReason::kNon2DCanvas, - kFrontBuffer); + .Snapshot(FlushReason::kNon2DCanvas, kFrontBuffer); } if (!layout_object->IsImage()) diff --git a/chromium_src/third_party/blink/renderer/core/loader/frame_fetch_context.h b/chromium_src/third_party/blink/renderer/core/loader/frame_fetch_context.h index 8933a38dfa4b..7c03d40cc92b 100644 --- a/chromium_src/third_party/blink/renderer/core/loader/frame_fetch_context.h +++ b/chromium_src/third_party/blink/renderer/core/loader/frame_fetch_context.h @@ -8,8 +8,10 @@ #include "third_party/blink/renderer/platform/loader/fetch/fetch_context.h" -#define AddAdditionalRequestHeaders \ - NotUsedOverride() {} \ +#define DoesLCPPHaveAnyHintData \ + NotUsedOverride() { \ + return false; \ + } \ String GetCacheIdentifierIfCrossSiteSubframe() const override; \ \ private: \ @@ -18,10 +20,10 @@ mutable String cache_identifier_if_cross_site_subframe_; \ \ public: \ - void AddAdditionalRequestHeaders + bool DoesLCPPHaveAnyHintData #include "src/third_party/blink/renderer/core/loader/frame_fetch_context.h" // IWYU pragma: export -#undef AddAdditionalRequestHeaders +#undef DoesLCPPHaveAnyHintData #endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_FRAME_FETCH_CONTEXT_H_ diff --git a/chromium_src/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.cc b/chromium_src/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.cc index 37107da98417..eb810e5744bb 100644 --- a/chromium_src/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.cc +++ b/chromium_src/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.cc @@ -6,17 +6,15 @@ #include "third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h" #include "third_party/abseil-cpp/absl/container/internal/layout.h" - -#define kCoarseResolution kCoarseResolution [[maybe_unused]] +#include "third_party/blink/renderer/core/timing/time_clamper.h" #define FloorToMultiple(X) \ FloorToMultiple( \ base::Microseconds(TimeClamper::CoarseResolutionMicroseconds())) -#define static_assert(...) static_assert(true) +#define kCoarseResolutionMicroseconds kCoarseResolutionMicroseconds_ChromiumImpl #include "src/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.cc" -#undef kCoarseResolution #undef FloorToMultiple -#undef static_assert +#undef kCoarseResolutionMicroseconds diff --git a/chromium_src/v8/src/builtins/builtins-utils.h b/chromium_src/v8/src/builtins/builtins-utils.h index 5c9728532ab8..6e6ed6f8254a 100644 --- a/chromium_src/v8/src/builtins/builtins-utils.h +++ b/chromium_src/v8/src/builtins/builtins-utils.h @@ -34,14 +34,14 @@ static_assert(false, "BUILTIN macro is expected to be defined"); #endif #undef BUILTIN #define BUILTIN(name) \ - V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \ + V8_WARN_UNUSED_RESULT static Tagged Builtin_Impl_##name( \ BuiltinArguments args, Isolate* isolate); \ \ V8_WARN_UNUSED_RESULT Address Builtin_##name( \ int args_length, Address* args_object, Isolate* isolate) { \ DCHECK(isolate->context().is_null() || IsContext(isolate->context())); \ BuiltinArguments args(args_length, args_object); \ - Object result = Builtin_Impl_##name(args, isolate); \ + Tagged result(Builtin_Impl_##name(args, isolate)); \ if (V8_UNLIKELY(IsBuiltinTrackedInPageGraph(#name)) && \ V8_UNLIKELY(isolate->page_graph_delegate())) { \ ReportBuiltinCallAndResponse(isolate, #name, args, result); \ @@ -49,7 +49,7 @@ static_assert(false, "BUILTIN macro is expected to be defined"); return BUILTIN_CONVERT_RESULT(result); \ } \ \ - V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \ + V8_WARN_UNUSED_RESULT static Tagged Builtin_Impl_##name( \ BuiltinArguments args, Isolate* isolate) #endif // BUILDFLAG(ENABLE_BRAVE_PAGE_GRAPH_WEBAPI_PROBES) diff --git a/chromium_src/v8/src/builtins/builtins.cc b/chromium_src/v8/src/builtins/builtins.cc index 628f4dabacbb..2024f463440a 100644 --- a/chromium_src/v8/src/builtins/builtins.cc +++ b/chromium_src/v8/src/builtins/builtins.cc @@ -26,7 +26,7 @@ static std::string ToPageGraphArg(Isolate* isolate, Handle object) { void ReportBuiltinCallAndResponse(Isolate* isolate, const char* builtin_name, const BuiltinArguments& builtin_args, - const Object& builtin_result) { + const Tagged& builtin_result) { HandleScope scope(isolate); std::vector args; // Start from 1 to skip receiver arg. diff --git a/chromium_src/v8/src/builtins/builtins.h b/chromium_src/v8/src/builtins/builtins.h index 06986690b86e..ff4737ad4444 100644 --- a/chromium_src/v8/src/builtins/builtins.h +++ b/chromium_src/v8/src/builtins/builtins.h @@ -19,7 +19,7 @@ class BuiltinArguments; void ReportBuiltinCallAndResponse(Isolate* isolate, const char* builtin_name, const BuiltinArguments& builtin_args, - const Object& builtin_result); + const Tagged& builtin_result); #endif // BUILDFLAG(ENABLE_BRAVE_PAGE_GRAPH_WEBAPI_PROBES) } // namespace internal diff --git a/chromium_src/v8/src/codegen/compiler.cc b/chromium_src/v8/src/codegen/compiler.cc index 90338d347a67..4b546fe6a13c 100644 --- a/chromium_src/v8/src/codegen/compiler.cc +++ b/chromium_src/v8/src/codegen/compiler.cc @@ -9,7 +9,7 @@ IF_BUILDFLAG(ENABLE_BRAVE_PAGE_GRAPH, { \ auto* page_graph_delegate = isolate->page_graph_delegate(); \ if (V8_UNLIKELY(page_graph_delegate)) { \ - Object maybe_script = result->shared()->script(); \ + Tagged maybe_script = result->shared()->script(); \ if (IsScript(maybe_script)) { \ const int script_id = Script::cast(maybe_script)->id(); \ page_graph_delegate->OnEvalScriptCompiled( \ diff --git a/chromium_src/v8/src/execution/isolate.cc b/chromium_src/v8/src/execution/isolate.cc index 3a8871cd08fb..f6d337b643c2 100644 --- a/chromium_src/v8/src/execution/isolate.cc +++ b/chromium_src/v8/src/execution/isolate.cc @@ -17,10 +17,10 @@ GetExecutingScriptsImpl(Isolate* isolate, bool all, bool include_position) { JavaScriptStackFrameIterator it(isolate); while (!it.done()) { JavaScriptFrame* frame = it.frame(); - std::vector functions; + std::vector> functions; frame->GetFunctions(&functions); for (const auto& shared : functions) { - Object maybe_script = shared.script(); + Tagged maybe_script = shared->script(); if (!IsScript(maybe_script)) { continue; } diff --git a/components/android_system_error_page_strings.grdp b/components/android_system_error_page_strings.grdp index b1d92e14202f..232852218bbb 100644 --- a/components/android_system_error_page_strings.grdp +++ b/components/android_system_error_page_strings.grdp @@ -13,4 +13,7 @@ <strong>_Suggestions:</strong><ul><li>_Make sure you have a data connection</li><li>_Reload this webpage later</li><li>_Check the address you entered</li></ul>_ + + This website is blocked by your parent. + diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp index 51f1f4fdbeba..2404332c7bcf 100644 --- a/components/autofill_payments_strings.grdp +++ b/components/autofill_payments_strings.grdp @@ -44,6 +44,10 @@ + + Google Pay logo + + @@ -113,13 +117,13 @@ - + Save card? - + To pay faster next time, save your card to your device - + To pay faster next time, save your card, and security code to your device @@ -133,13 +137,13 @@ - - Do you want to save this card to your Brave sync chain? + + Do you want to save this card in your Brave sync chain? - - Do you want to save this card to your Brave sync chain and on this device? + + Do you want to save this card in your Brave sync chain and on this device? @@ -158,6 +162,9 @@ Save card? + + Save security code? + $1Visa, $24444, expires $301/2025 @@ -193,8 +200,8 @@ Pay quickly on sites and apps across devices using cards you have saved with Brave. - - To pay faster next time, save your card and billing address to your Brave sync chain. + + To pay faster next time, save your card and billing address in your Brave sync chain It’ll be encrypted, saved securely and the CVC is never stored. @@ -202,12 +209,21 @@ Pay faster next time and protect your card with Brave’s industry-leading security. - - To pay faster next time, save your card, name, and billing address to your Brave sync chain. + + To pay faster next time, save your card, name, and billing address in your Brave sync chain Pay faster next time and protect your card with Brave’s industry-leading security. + + For faster checkout, save the CVC for this card in your Brave sync chain + + + + + To pay faster next time, save your card, security code, and billing address in your Brave sync chain + + @@ -247,9 +263,6 @@ - - Google Pay logo - Saving cards... @@ -508,8 +521,8 @@ Contacting your bank... - - Using Brave’s security technology to keep your payment info secure + + Securely checking your payment details Cancel @@ -950,6 +963,9 @@ List of payment methods is closed. + + %1$sCard info, %2$s2 of %3$s8. + diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index efa85164886d..9f913aff3f43 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp @@ -25,8 +25,8 @@ - - Clear copy + + Remove copy @@ -582,5 +582,17 @@ Expand suggestion + + Fill address + + + right key + + + left key + + + Submenu available, use $1right key to navigate to additional options. + diff --git a/components/brave_ads/core/internal/common/unittest/unittest_tag_parser_util.cc b/components/brave_ads/core/internal/common/unittest/unittest_tag_parser_util.cc index df27d750814f..48a32591a552 100644 --- a/components/brave_ads/core/internal/common/unittest/unittest_tag_parser_util.cc +++ b/components/brave_ads/core/internal/common/unittest/unittest_tag_parser_util.cc @@ -9,12 +9,12 @@ #include #include "base/check.h" +#include "base/i18n/time_formatting.h" #include "base/notreached.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/time/time.h" -#include "base/time/time_to_iso8601.h" #include "brave/components/brave_ads/core/internal/common/unittest/unittest_time_util.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/re2/src/re2/re2.h" @@ -78,7 +78,7 @@ absl::optional ParseTimeTagValue(const std::string& value) { if (re2::RE2::FullMatch(value, "[-+]?[0-9]*.*(seconds|minutes|hours|days)")) { const absl::optional time_delta = ParseTimeDelta(value); CHECK(time_delta) << "Invalid time tag value: " << value; - return base::TimeToISO8601(Now() + *time_delta); + return base::TimeFormatAsIso8601(Now() + *time_delta); } return absl::nullopt; diff --git a/components/brave_ads/core/internal/common/unittest/unittest_time_util.cc b/components/brave_ads/core/internal/common/unittest/unittest_time_util.cc index fa50a11c52d4..8c1cae8d9979 100644 --- a/components/brave_ads/core/internal/common/unittest/unittest_time_util.cc +++ b/components/brave_ads/core/internal/common/unittest/unittest_time_util.cc @@ -6,8 +6,8 @@ #include "brave/components/brave_ads/core/internal/common/unittest/unittest_time_util.h" #include "base/check.h" +#include "base/i18n/time_formatting.h" #include "base/time/time.h" -#include "base/time/time_to_iso8601.h" namespace brave_ads { @@ -29,7 +29,7 @@ base::Time DistantPast() { } std::string DistantPastAsISO8601() { - return base::TimeToISO8601(DistantPast()); + return base::TimeFormatAsIso8601(DistantPast()); } base::Time Now() { @@ -38,7 +38,7 @@ base::Time Now() { } std::string NowAsISO8601() { - return base::TimeToISO8601(Now()); + return base::TimeFormatAsIso8601(Now()); } base::Time DistantFuture() { @@ -50,7 +50,7 @@ base::Time DistantFuture() { } std::string DistantFutureAsISO8601() { - return base::TimeToISO8601(DistantFuture()); + return base::TimeFormatAsIso8601(DistantFuture()); } } // namespace brave_ads diff --git a/components/brave_referrals/browser/BUILD.gn b/components/brave_referrals/browser/BUILD.gn index b7bb38e686ed..4900d2964713 100644 --- a/components/brave_referrals/browser/BUILD.gn +++ b/components/brave_referrals/browser/BUILD.gn @@ -5,6 +5,7 @@ if (is_android) { import("//build/config/android/rules.gni") + import("//third_party/jni_zero/jni_zero.gni") } assert(!is_ios) diff --git a/components/brave_shields/adblock/rs/src/engine.rs b/components/brave_shields/adblock/rs/src/engine.rs index feffb5e187d3..adce58387065 100644 --- a/components/brave_shields/adblock/rs/src/engine.rs +++ b/components/brave_shields/adblock/rs/src/engine.rs @@ -164,15 +164,13 @@ impl Engine { ) -> String { // The following strings are also UTF-8. self.engine - .get_csp_directives( - &adblock::request::Request::preparsed( - url.to_str().unwrap(), - hostname.to_str().unwrap(), - source_hostname.to_str().unwrap(), - request_type.to_str().unwrap(), - third_party_request, - ), - ) + .get_csp_directives(&adblock::request::Request::preparsed( + url.to_str().unwrap(), + hostname.to_str().unwrap(), + source_hostname.to_str().unwrap(), + request_type.to_str().unwrap(), + third_party_request, + )) .unwrap_or_default() } @@ -193,7 +191,7 @@ impl Engine { kind: ResourceType::Mime(MimeType::from(content_type.to_str()?)), content: data.to_string(), dependencies: vec![], - /// user-added resources require full permissions + // user-added resources require full permissions permission: adblock::resources::PermissionMask::from_bits(0b11111111), }; Ok(self.engine.add_resource(resource)?) diff --git a/components/brave_sync/features.cc b/components/brave_sync/features.cc index 83a1944b9d66..853473dec423 100644 --- a/components/brave_sync/features.cc +++ b/components/brave_sync/features.cc @@ -12,21 +12,5 @@ namespace features { BASE_FEATURE(kBraveSync, "BraveSync", base::FEATURE_ENABLED_BY_DEFAULT); -// When this feature is enabled through brave://flags it adds to history entry's -// title additional info for sync diagnostics: -// - whether history entry should be synced; -// - typed count; -// - page transition. -BASE_FEATURE(kBraveSyncHistoryDiagnostics, - "BraveSyncHistoryDiagnostics", - base::FEATURE_DISABLED_BY_DEFAULT); - -// When this feature is enabled, Sync sends to remote server all the history -// entries, including page transition beyond typed url (link, bookmark, reload, -// etc). -BASE_FEATURE(kBraveSyncSendAllHistory, - "BraveSyncSendAllHistory", - base::FEATURE_DISABLED_BY_DEFAULT); - } // namespace features } // namespace brave_sync diff --git a/components/brave_sync/features.h b/components/brave_sync/features.h index 5fa00d9c84fa..11db015866df 100644 --- a/components/brave_sync/features.h +++ b/components/brave_sync/features.h @@ -13,10 +13,6 @@ namespace features { BASE_DECLARE_FEATURE(kBraveSync); -BASE_DECLARE_FEATURE(kBraveSyncHistoryDiagnostics); - -BASE_DECLARE_FEATURE(kBraveSyncSendAllHistory); - } // namespace features } // namespace brave_sync diff --git a/components/brave_wallet/browser/permission_utils.cc b/components/brave_wallet/browser/permission_utils.cc index cea642821117..61d93cc022f4 100644 --- a/components/brave_wallet/browser/permission_utils.cc +++ b/components/brave_wallet/browser/permission_utils.cc @@ -20,10 +20,10 @@ namespace { // We keep the ethereum pattern is for backward compatibility because we // already wrote some content setting using this pattern. -constexpr char kEthAddrPattern[] = "addr%3D(0x[[:xdigit:]]{40})"; +constexpr char kEthAddrPattern[] = "addr=(0x[[:xdigit:]]{40})"; // This is generic pattern for all coins, we put maximum length bump 128 is to // prevent ReDoS attack. -constexpr char kAddrPattern[] = "addr%3D([[:alnum:]]{1,128})"; +constexpr char kAddrPattern[] = "addr=([[:alnum:]]{1,128})"; // Given an origin and an account address, append the account address to the // end of the host piece of the origin, then return it as the new origin. @@ -88,12 +88,12 @@ bool ParseRequestingOriginInternal(permissions::RequestType type, std::string pattern; if (type == permissions::RequestType::kBraveEthereum) { pattern = sub_req_format ? "(.*)(0x[[:xdigit:]]{40})(:[0-9]+)*" - : "(.*)%7Baddr%3D0x[[:xdigit:]]{40}(%" - "26addr%3D0x[[:xdigit:]]{40})*%7D(:[0-9]+)*"; + : "(.*){addr=0x[[:xdigit:]]{40}(&" + "addr=0x[[:xdigit:]]{40})*}(:[0-9]+)*"; } else { pattern = sub_req_format ? "(.*)__([[:alnum:]]{1,128})(:[0-9]+)*" - : "(.*)%7Baddr%3D[[:alnum:]]{1,128}(%" - "26addr%3D[[:alnum:]]{1,128})*%7D(:[0-9]+)*"; + : "(.*){addr=[[:alnum:]]{1,128}(&" + "addr=[[:alnum:]]{1,128})*}(:[0-9]+)*"; } RE2 full_pattern(pattern); if (!re2::RE2::FullMatch(origin.Serialize(), full_pattern, &scheme_host_group, diff --git a/components/browser_ui/accessibility/android/BUILD.gn b/components/browser_ui/accessibility/android/BUILD.gn index c5a327ca10f6..48905c0d0ae2 100644 --- a/components/browser_ui/accessibility/android/BUILD.gn +++ b/components/browser_ui/accessibility/android/BUILD.gn @@ -11,7 +11,7 @@ android_library("java") { "//base:base_java", "//build/android:build_java", "//chrome/browser/flags:java", - "//components/browser_ui/accessibility/android:java", + "//components/browser_ui/accessibility/android:lib_java", "//components/browser_ui/settings/android:java", "//third_party/androidx:androidx_preference_preference_java", ] diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleCategorySettings.java index 46e9e1ae628e..db74f9d06193 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleCategorySettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleCategorySettings.java @@ -12,8 +12,8 @@ import org.chromium.content_public.browser.BrowserContextHandle; @UsedByReflection("brave_site_settings_preferences.xml") -public class BraveSingleCategorySettings - extends SiteSettingsPreferenceFragment implements AddExceptionPreference.SiteAddedCallback { +public class BraveSingleCategorySettings extends BaseSiteSettingsFragment + implements AddExceptionPreference.SiteAddedCallback { private static final String ADD_EXCEPTION_KEY = "add_exception"; @Override diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings.java index a369e9626200..29ea24506c61 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSingleWebsiteSettings.java @@ -17,7 +17,7 @@ import org.chromium.components.content_settings.ContentSettingsType; import org.chromium.content_public.browser.BrowserContextHandle; -public class BraveSingleWebsiteSettings extends SiteSettingsPreferenceFragment { +public class BraveSingleWebsiteSettings extends BaseSiteSettingsFragment { @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {} diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase.java index 8a076f4439b6..30f19852ee50 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BraveSiteSettingsPreferencesBase.java @@ -6,6 +6,7 @@ package org.chromium.components.browser_ui.site_settings; import android.os.Bundle; + import androidx.preference.Preference; import org.chromium.base.ContextUtils; @@ -13,8 +14,9 @@ import java.util.HashMap; -public class BraveSiteSettingsPreferencesBase extends SiteSettingsPreferenceFragment { - private static final String PLAY_YT_VIDEO_IN_BROWSER_CATEGORY_KEY = "play_yt_video_in_browser_category"; +public class BraveSiteSettingsPreferencesBase extends BaseSiteSettingsFragment { + private static final String PLAY_YT_VIDEO_IN_BROWSER_CATEGORY_KEY = + "play_yt_video_in_browser_category"; private static final String ADS_KEY = "ads"; private static final String BACKGROUND_SYNC_KEY = "background_sync"; private static final String PLAY_YT_VIDEO_IN_BROWSER_KEY = "play_yt_video_in_browser"; diff --git a/components/browsing_data_strings.grdp b/components/browsing_data_strings.grdp index e6fcd619d190..d0345973f2b0 100644 --- a/components/browsing_data_strings.grdp +++ b/components/browsing_data_strings.grdp @@ -32,6 +32,15 @@ Frees up less than 1 MB. Some sites may load more slowly on your next visit. + + $1328 MB. Some sites may load more slowly on your next visit. + + + Less than $1328 MB. Some sites may load more slowly on your next visit. + + + Less than 1 MB. Some sites may load more slowly on your next visit. + {COUNT, plural, =0 {None} @@ -150,6 +159,12 @@ =1 {From 1 site (you won't be signed out of your Brave sync chain)} other {From # sites (you won't be signed out of your Brave sync chain)}} + + {COUNT, plural, + =0 {None} + =1 {From 1 site. Signs you out of most sites. } + other {From # sites. Signs you out of most sites. }} + {COUNT, plural, =0 {None} diff --git a/components/commerce_strings.grdp b/components/commerce_strings.grdp index 1630eea53002..82581f913fd0 100644 --- a/components/commerce_strings.grdp +++ b/components/commerce_strings.grdp @@ -77,10 +77,10 @@ - + Get emails sent to $1example@example.com when the price of items you track drops on any site. - + Want emails when prices drop? @@ -229,6 +229,12 @@ Price History + + Price History Across the Web for this Option + + + Price History Across the Web + Low Priced Option @@ -258,6 +264,12 @@ Price history + + Price history across the web for this option + + + Price history across the web + Low priced option diff --git a/components/components_brave_strings.grd b/components/components_brave_strings.grd index b81cf80eebb8..8aa20c887c66 100644 --- a/components/components_brave_strings.grd +++ b/components/components_brave_strings.grd @@ -2,7 +2,7 @@ - + diff --git a/components/components_strings.grd b/components/components_strings.grd index 2abee4758100..09aaaafcf0d5 100644 --- a/components/components_strings.grd +++ b/components/components_strings.grd @@ -320,6 +320,7 @@ + @@ -341,6 +342,7 @@ + diff --git a/components/components_strings_override.grd b/components/components_strings_override.grd index cd8c9c336e87..19a3e4fa61f8 100644 --- a/components/components_strings_override.grd +++ b/components/components_strings_override.grd @@ -98,7 +98,8 @@ - + + diff --git a/components/error_page_strings.grdp b/components/error_page_strings.grdp index 077416eb3d27..3ee2044a8c9d 100644 --- a/components/error_page_strings.grdp +++ b/components/error_page_strings.grdp @@ -318,8 +318,8 @@ <a jsvalues="href:learnMoreUrl">Learn more</a></a> about this problem. - - <a jsvalues="href:learnMoreUrl">Try clearing your cookies</a></a>. + + <a jsvalues="href:learnMoreUrl">Try deleting your cookies</a></a>. diff --git a/components/flags_strings.grdp b/components/flags_strings.grdp index b6c63c5109a6..3e590d3a008c 100644 --- a/components/flags_strings.grdp +++ b/components/flags_strings.grdp @@ -160,7 +160,7 @@ Unsupported features - These features are disabled by default. They will not be available in future versions of Brave. + These flags prevent or revert a breaking change and will only be available for a limited time. No matching features diff --git a/components/history/core/browser/sources.gni b/components/history/core/browser/sources.gni index 4a584cda68fc..655322363fa1 100644 --- a/components/history/core/browser/sources.gni +++ b/components/history/core/browser/sources.gni @@ -4,9 +4,10 @@ # You can obtain one at https://mozilla.org/MPL/2.0/. brave_components_history_core_browser_sources = [ - "//brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.cc", - "//brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.h", + "//brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.cc", + "//brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h", + "//brave/components/history/core/browser/sync/brave_history_model_type_controller.cc", + "//brave/components/history/core/browser/sync/brave_history_model_type_controller.h", ] -brave_components_history_core_browser_deps = - [ "//brave/components/brave_sync:features" ] +brave_components_history_core_browser_deps = [] diff --git a/components/history/core/browser/sync/BUILD.gn b/components/history/core/browser/sync/BUILD.gn new file mode 100644 index 000000000000..b6e0f8bb22dc --- /dev/null +++ b/components/history/core/browser/sync/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright (c) 2023 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/. + +source_set("unit_tests") { + testonly = true + sources = [ "//components/history/core/browser/sync/delete_directive_handler_unittest.cc" ] + deps = [ + "//base", + "//base/test:test_support", + "//components/history/core/browser:browser", + "//components/history/core/common", + "//components/history/core/test", + "//components/prefs:test_support", + "//components/sync", + "//components/sync:test_support", + "//testing/gtest", + "//url", + ] +} diff --git a/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.cc b/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.cc new file mode 100644 index 000000000000..5a97bef79c95 --- /dev/null +++ b/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.cc @@ -0,0 +1,34 @@ +/* Copyright (c) 2023 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 "brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h" + +#include "components/history/core/browser/sync/history_delete_directives_model_type_controller.h" + +namespace history { + +BraveHistoryDeleteDirectivesModelTypeController:: + BraveHistoryDeleteDirectivesModelTypeController( + const base::RepeatingClosure& dump_stack, + syncer::SyncService* sync_service, + syncer::ModelTypeStoreService* model_type_store_service, + HistoryService* history_service, + PrefService* pref_service) + : HistoryDeleteDirectivesModelTypeController(dump_stack, + sync_service, + model_type_store_service, + history_service, + pref_service) {} + +BraveHistoryDeleteDirectivesModelTypeController:: + ~BraveHistoryDeleteDirectivesModelTypeController() = default; + +syncer::DataTypeController::PreconditionState +BraveHistoryDeleteDirectivesModelTypeController::GetPreconditionState() const { + DCHECK(CalledOnValidThread()); + return PreconditionState::kPreconditionsMet; +} + +} // namespace history diff --git a/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h b/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h new file mode 100644 index 000000000000..a2b8e6f97e4f --- /dev/null +++ b/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2023 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_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ +#define BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ + +#include "base/functional/callback_forward.h" +#include "components/history/core/browser/sync/history_delete_directives_model_type_controller.h" +#include "components/sync/service/data_type_controller.h" + +class PrefService; + +namespace syncer { +class ModelTypeStoreService; +class SyncService; +} // namespace syncer + +namespace history { + +class BraveHistoryDeleteDirectivesModelTypeController + : public HistoryDeleteDirectivesModelTypeController { + public: + BraveHistoryDeleteDirectivesModelTypeController( + const base::RepeatingClosure& dump_stack, + syncer::SyncService* sync_service, + syncer::ModelTypeStoreService* model_type_store_service, + HistoryService* history_service, + PrefService* pref_service); + + BraveHistoryDeleteDirectivesModelTypeController( + const BraveHistoryDeleteDirectivesModelTypeController&) = delete; + BraveHistoryDeleteDirectivesModelTypeController& operator=( + const BraveHistoryDeleteDirectivesModelTypeController&) = delete; + + ~BraveHistoryDeleteDirectivesModelTypeController() override; + + // DataTypeController overrides. + PreconditionState GetPreconditionState() const override; +}; + +} // namespace history + +#endif // BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ diff --git a/components/history/core/browser/sync/brave_history_model_type_controller.cc b/components/history/core/browser/sync/brave_history_model_type_controller.cc new file mode 100644 index 000000000000..0a980c4fe7ff --- /dev/null +++ b/components/history/core/browser/sync/brave_history_model_type_controller.cc @@ -0,0 +1,27 @@ +/* Copyright (c) 2023 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 "brave/components/history/core/browser/sync/brave_history_model_type_controller.h" + +namespace history { + +BraveHistoryModelTypeController::BraveHistoryModelTypeController( + syncer::SyncService* sync_service, + signin::IdentityManager* identity_manager, + HistoryService* history_service, + PrefService* pref_service) + : HistoryModelTypeController(sync_service, + identity_manager, + history_service, + pref_service) {} + +BraveHistoryModelTypeController::~BraveHistoryModelTypeController() = default; + +syncer::DataTypeController::PreconditionState +BraveHistoryModelTypeController::GetPreconditionState() const { + return PreconditionState::kPreconditionsMet; +} + +} // namespace history diff --git a/components/history/core/browser/sync/brave_history_model_type_controller.h b/components/history/core/browser/sync/brave_history_model_type_controller.h new file mode 100644 index 000000000000..cc585c00c9ff --- /dev/null +++ b/components/history/core/browser/sync/brave_history_model_type_controller.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2023 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_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_MODEL_TYPE_CONTROLLER_H_ +#define BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_MODEL_TYPE_CONTROLLER_H_ + +#include "components/history/core/browser/sync/history_model_type_controller.h" +#include "components/sync/base/model_type.h" + +class PrefService; + +namespace signin { +// class AccountManagedStatusFinder; +class IdentityManager; +} // namespace signin + +namespace syncer { +// class ModelTypeStoreService; +class SyncService; +} // namespace syncer + +namespace history { + +class HistoryService; + +class BraveHistoryModelTypeController : public HistoryModelTypeController { + public: + BraveHistoryModelTypeController(syncer::SyncService* sync_service, + signin::IdentityManager* identity_manager, + HistoryService* history_service, + PrefService* pref_service); + + BraveHistoryModelTypeController(const BraveHistoryModelTypeController&) = + delete; + BraveHistoryModelTypeController& operator=( + const BraveHistoryModelTypeController&) = delete; + + ~BraveHistoryModelTypeController() override; + + // syncer::DataTypeController implementation. + PreconditionState GetPreconditionState() const override; +}; + +} // namespace history + +#endif // BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_HISTORY_MODEL_TYPE_CONTROLLER_H_ diff --git a/components/history/core/browser/sync/brave_typed_url_sync_bridge.cc b/components/history/core/browser/sync/brave_typed_url_sync_bridge.cc deleted file mode 100644 index 57c161eed780..000000000000 --- a/components/history/core/browser/sync/brave_typed_url_sync_bridge.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2023 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 "brave/components/history/core/browser/sync/brave_typed_url_sync_bridge.h" - -#include -#include - -#include "brave/components/brave_sync/features.h" - -namespace history { - -// For the case when kBraveSyncSendAllHistory feature is enabled, -// we want to send to the sync server first 20 visits and then each 10th -namespace { -const int kSendAllFlagVisitThrottleThreshold = 20; -const int kSendAllFlagVisitThrottleMultiple = 10; -} // namespace - -BraveTypedURLSyncBridge::BraveTypedURLSyncBridge( - HistoryBackend* history_backend, - TypedURLSyncMetadataDatabase* sync_metadata_store, - std::unique_ptr change_processor) - : TypedURLSyncBridge(history_backend, - sync_metadata_store, - std::move(change_processor)) {} - -bool BraveTypedURLSyncBridge::ShouldSyncVisit(const URLRow& url_row, - ui::PageTransition transition) { - if (base::FeatureList::IsEnabled( - brave_sync::features::kBraveSyncSendAllHistory)) { - return url_row.visit_count() < kSendAllFlagVisitThrottleThreshold || - (url_row.visit_count() % kSendAllFlagVisitThrottleMultiple) == 0; - } - return TypedURLSyncBridge::ShouldSyncVisit(url_row.typed_count(), transition); -} - -int BraveTypedURLSyncBridge::GetSendAllFlagVisitThrottleThreshold() { - return kSendAllFlagVisitThrottleThreshold; -} - -int BraveTypedURLSyncBridge::GetSendAllFlagVisitThrottleMultiple() { - return kSendAllFlagVisitThrottleMultiple; -} - -} // namespace history diff --git a/components/history/core/browser/sync/brave_typed_url_sync_bridge.h b/components/history/core/browser/sync/brave_typed_url_sync_bridge.h deleted file mode 100644 index 47a67bb186f2..000000000000 --- a/components/history/core/browser/sync/brave_typed_url_sync_bridge.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2023 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_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_TYPED_URL_SYNC_BRIDGE_H_ -#define BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_TYPED_URL_SYNC_BRIDGE_H_ - -#include - -#include "components/history/core/browser/sync/typed_url_sync_bridge.h" - -namespace history { - -class BraveTypedURLSyncBridge : public TypedURLSyncBridge { - public: - BraveTypedURLSyncBridge( - HistoryBackend* history_backend, - TypedURLSyncMetadataDatabase* sync_metadata_store, - std::unique_ptr change_processor); - - BraveTypedURLSyncBridge(const BraveTypedURLSyncBridge&) = delete; - BraveTypedURLSyncBridge& operator=(const BraveTypedURLSyncBridge&) = delete; - - ~BraveTypedURLSyncBridge() override = default; - bool ShouldSyncVisit(const URLRow& url_row, - ui::PageTransition transition) override; - - static int GetSendAllFlagVisitThrottleThreshold(); - static int GetSendAllFlagVisitThrottleMultiple(); - - private: - friend class BraveTypedURLSyncBridgeTest; -}; - -} // namespace history - -#endif // BRAVE_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_BRAVE_TYPED_URL_SYNC_BRIDGE_H_ diff --git a/components/history_clusters_strings.grdp b/components/history_clusters_strings.grdp index a9f21bd9fd29..723fda60f2c6 100644 --- a/components/history_clusters_strings.grdp +++ b/components/history_clusters_strings.grdp @@ -33,7 +33,7 @@ “$1flowers - $1google.com and more + $1google.com and more Hide item diff --git a/components/ipfs/import/ipfs_import_worker_base.cc b/components/ipfs/import/ipfs_import_worker_base.cc index 52675c7a1f37..ce2887d5e3fc 100644 --- a/components/ipfs/import/ipfs_import_worker_base.cc +++ b/components/ipfs/import/ipfs_import_worker_base.cc @@ -10,6 +10,7 @@ #include "base/command_line.h" #include "base/files/file_util.h" +#include "base/hash/hash.h" #include "base/strings/strcat.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" diff --git a/components/ipfs/ipfs_service.cc b/components/ipfs/ipfs_service.cc index 035d49bb445f..c1d81ccaa97d 100644 --- a/components/ipfs/ipfs_service.cc +++ b/components/ipfs/ipfs_service.cc @@ -9,6 +9,7 @@ #include #include "base/files/file_util.h" +#include "base/hash/hash.h" #include "base/memory/raw_ref.h" #include "base/rand_util.h" #include "base/strings/strcat.h" diff --git a/components/new_or_sad_tab_strings.grdp b/components/new_or_sad_tab_strings.grdp index 737386c0f784..f7df66442878 100644 --- a/components/new_or_sad_tab_strings.grdp +++ b/components/new_or_sad_tab_strings.grdp @@ -191,6 +191,17 @@ When on, sites can't use cookies that track you across the web. Features on some sites may break. + + + + Third-party cookies are blocked + + + Brave blocks sites from using third-party cookies to track you as you browse. + If site features aren’t working <a target="_blank" href="$1">try temporarily allowing third-party cookies</a>. + + + diff --git a/components/new_or_sad_tab_strings_override.grdp b/components/new_or_sad_tab_strings_override.grdp index 47ff7ab5c6bf..8291057080e4 100644 --- a/components/new_or_sad_tab_strings_override.grdp +++ b/components/new_or_sad_tab_strings_override.grdp @@ -71,6 +71,9 @@ + + + Private in Brave diff --git a/components/p3a/message_manager_unittest.cc b/components/p3a/message_manager_unittest.cc index 02bad8c3164a..afe0ce2b6402 100644 --- a/components/p3a/message_manager_unittest.cc +++ b/components/p3a/message_manager_unittest.cc @@ -11,12 +11,12 @@ #include #include +#include "base/i18n/time_formatting.h" #include "base/strings/string_number_conversions.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "base/test/values_test_util.h" #include "base/time/time.h" -#include "base/time/time_to_iso8601.h" #include "brave/components/p3a/features.h" #include "brave/components/p3a/metric_names.h" #include "brave/components/p3a/p3a_config.h" @@ -113,8 +113,8 @@ class P3AMessageManagerTest : public testing::Test, url_loader_factory.AddResponse( request.url.spec(), "{\"currentEpoch\":" + base::NumberToString(current_epoch) + - ", \"nextEpochTime\": \"" + TimeToISO8601(next_epoch_time) + - "\"}", + ", \"nextEpochTime\": \"" + + TimeFormatAsIso8601(next_epoch_time) + "\"}", interceptor_status_code_from_randomness); info_request_made = true; } else if (request.url == diff --git a/components/p3a/star_randomness_test_util.cc b/components/p3a/star_randomness_test_util.cc index d02acb29905f..8387cd1c8e2e 100644 --- a/components/p3a/star_randomness_test_util.cc +++ b/components/p3a/star_randomness_test_util.cc @@ -11,9 +11,9 @@ #include #include "base/base64.h" +#include "base/i18n/time_formatting.h" #include "base/json/json_writer.h" #include "base/test/values_test_util.h" -#include "base/time/time_to_iso8601.h" #include "brave/components/p3a/constellation/rs/cxx/src/lib.rs.h" #include "net/http/http_request_headers.h" #include "services/network/public/cpp/resource_request.h" diff --git a/components/page_info_strings.grdp b/components/page_info_strings.grdp index de19faf5716c..f77fd4ac264b 100644 --- a/components/page_info_strings.grdp +++ b/components/page_info_strings.grdp @@ -390,7 +390,7 @@ Can ask to track your camera position - Can ask to automatically open picture-in-picture windows + Can ask to enter picture-in-picture Can ask to automatically download multiple files @@ -716,14 +716,29 @@ - Cookies and site data + Cookies and site data - + + Tracking Protection + + + Tracking Protection + + Cookies and other site data are used to remember you, for example to sign you in or to personalize ads. To manage cookies for all sites, see $1Settings. + + Brave limits most sites from using third-party cookies to track you as you browse. Visit settings to $1manage your tracking protections. + + + You blocked sites from using third-party cookies to track you as you browse. Visit settings to $1manage your tracking protections. + Settings + + manage your tracking protections + Block third-party cookies @@ -830,6 +845,9 @@ Try temporarily allowing third-party cookies, which means less protection but site features are more likely to work + + Try temporarily allowing third-party cookies, which means less browsing protection but site features are more likely to work as expected. + Try allowing third-party cookies, which means less protection but site features are more likely to work @@ -842,9 +860,24 @@ =1 {Brave will block cookies again tomorrow} other {# days until Brave blocks cookies again}} + + {COUNT, plural, + =0 {Brave will limit cookies again today} + =1 {Brave will limit cookies again tomorrow} + other {# days until Brave limits cookies again}} + + + {COUNT, plural, + =0 {Cookies will be blocked again today} + =1 {Cookies will be blocked again tomorrow} + other {# days until cookies are blocked again}} + You allowed this site to use third-party cookies. This means that most site features should work, but you have less protection. + + You temporarily allowed this site to use third-party cookies, which means less browsing protection but site features are more likely to work as expected. + You allowed third-party cookies for this site diff --git a/components/password_manager_strings.grdp b/components/password_manager_strings.grdp index 3b4f17d9b63d..80bc1c7e8dde 100644 --- a/components/password_manager_strings.grdp +++ b/components/password_manager_strings.grdp @@ -14,21 +14,9 @@ Change your password - - Check your passwords - Check your saved passwords - - Brave found the password you just used in a data breach. To secure your accounts, we recommend checking your saved passwords. - - - Brave found the password you just used in a data breach. We recommend changing this password now. - - - Brave found the password you just used in a data breach. To secure your accounts, we recommend changing it now and then checking your saved passwords. - The password you just used was found in a data breach. To secure your accounts, Brave Password Manager recommends checking your saved passwords. diff --git a/components/permissions/android/BUILD.gn b/components/permissions/android/BUILD.gn index 7e72eff82e8f..823b3500fee9 100644 --- a/components/permissions/android/BUILD.gn +++ b/components/permissions/android/BUILD.gn @@ -1,4 +1,10 @@ +# Copyright (c) 2023 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/. + import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") generate_jni("jni_headers") { sources = [ "java/src/org/chromium/components/permissions/BravePermissionDialogDelegate.java" ] diff --git a/components/permissions_strings.grdp b/components/permissions_strings.grdp index 42760d864072..ddb74cd5b5db 100644 --- a/components/permissions_strings.grdp +++ b/components/permissions_strings.grdp @@ -360,4 +360,36 @@ This will otherwise be blocked by your privacy settings. This will allow the con Store files on this device + + + + Your administrator has blocked $1camera on $2www.google.com + + + Your administrator has allowed $1camera on $2www.google.com + + + You have allowed $1camera on $1www.google.com + + + + camera + + + microphone + + + camera and microphone + + + + + OK + + + Continue allowing + + + Stop allowing $1camera + diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index 6e9c12093412..4dbc0d880c49 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp @@ -250,6 +250,9 @@ Invalid URL. + + URL must be https. + Invalid search URL. diff --git a/components/privacy_sandbox/brave_privacy_sandbox_settings.cc b/components/privacy_sandbox/brave_privacy_sandbox_settings.cc index c4c16a5c0ea4..252b6dbbb87f 100644 --- a/components/privacy_sandbox/brave_privacy_sandbox_settings.cc +++ b/components/privacy_sandbox/brave_privacy_sandbox_settings.cc @@ -17,10 +17,12 @@ BravePrivacySandboxSettings::BravePrivacySandboxSettings( std::unique_ptr delegate, HostContentSettingsMap* host_content_settings_map, content_settings::CookieSettings* cookie_settings, + privacy_sandbox::TrackingProtectionSettings* tracking_protection_settings, PrefService* pref_service) : privacy_sandbox::PrivacySandboxSettingsImpl(std::move(delegate), host_content_settings_map, cookie_settings, + tracking_protection_settings, pref_service), pref_service_(pref_service) { // Register observers for the Privacy Sandbox. diff --git a/components/privacy_sandbox/brave_privacy_sandbox_settings.h b/components/privacy_sandbox/brave_privacy_sandbox_settings.h index e8ff32c8f70d..c2120a77fcf0 100644 --- a/components/privacy_sandbox/brave_privacy_sandbox_settings.h +++ b/components/privacy_sandbox/brave_privacy_sandbox_settings.h @@ -22,10 +22,12 @@ class CookieSettings; class BravePrivacySandboxSettings : public privacy_sandbox::PrivacySandboxSettingsImpl { public: - BravePrivacySandboxSettings(std::unique_ptr delegate, - HostContentSettingsMap* host_content_settings_map, - content_settings::CookieSettings* cookie_settings, - PrefService* pref_service); + BravePrivacySandboxSettings( + std::unique_ptr delegate, + HostContentSettingsMap* host_content_settings_map, + content_settings::CookieSettings* cookie_settings, + privacy_sandbox::TrackingProtectionSettings* tracking_protection_settings, + PrefService* pref_service); ~BravePrivacySandboxSettings() override; private: diff --git a/components/privacy_sandbox_strings.grdp b/components/privacy_sandbox_strings.grdp index d148c5f3b886..b2c961a90abc 100644 --- a/components/privacy_sandbox_strings.grdp +++ b/components/privacy_sandbox_strings.grdp @@ -2156,4 +2156,70 @@ Vacation Offers + + + + + Tracking Protection + + + Brave limits the amount of information sites can use to track you as you browse. You can change your settings to choose your own level of protection. + + + Browse with more privacy + + + You’re one of the first to experience Tracking Protection, which limits sites from using third-party cookies to track you as you browse. + + + Settings + + + Brave automatically limits third-party cookies + + + Most sites can’t use third-party cookies to track you as you browse, and sites can’t use third-party cookies in Private mode. + + + Most sites should work as expected + + + If a site isn’t working, you can try giving it temporary permission to use third-party cookies. Learn more + + + Advanced + + + Block all third-party cookies + + + Features on some sites may not work. Learn more + + + Send a “Do Not Track” request with your browsing traffic + + + Sites use their discretion when responding to this request + + + Sites allowed to use third-party cookies + + + Affects the sites listed here and their subdomains. For example, adding “google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com. + + + Does not expire + + + Expires today + + + {COUNT, plural, + =1 {Expires tomorrow} + other {Expires in # days} + } + + + Delete site + diff --git a/components/privacy_sandbox_strings_override.grdp b/components/privacy_sandbox_strings_override.grdp index abd3bfb6446e..d5d638a88c86 100644 --- a/components/privacy_sandbox_strings_override.grdp +++ b/components/privacy_sandbox_strings_override.grdp @@ -3,4 +3,7 @@ Profiles & society + + Most sites can’t use third-party cookies to track you as you browse, and sites can’t use third-party cookies in Private mode. + diff --git a/components/safetynet/BUILD.gn b/components/safetynet/BUILD.gn index 3743bc0bcecd..3775b987b0a5 100644 --- a/components/safetynet/BUILD.gn +++ b/components/safetynet/BUILD.gn @@ -1,5 +1,11 @@ +# Copyright (c) 2023 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/. + import("//build/buildflag_header.gni") import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") declare_args() { brave_safetynet_api_key = "" diff --git a/components/search_engine_choice_strings.grdp b/components/search_engine_choice_strings.grdp new file mode 100644 index 000000000000..5c4930ed9d5f --- /dev/null +++ b/components/search_engine_choice_strings.grdp @@ -0,0 +1,80 @@ + + + + + + + Choose Your Search Engine + + + + + Choose your search engine + + + + + + Confirm Your Search Engine + + + + + Confirm your search engine + + + + + These search engines are shown in random order. You can change your default anytime in settings. + + + + Learn more + + + + Learn more about your search engine in Brave + + + + + Set as Default + + + + + Set as default + + + + + + Your Search Engine in Brave + + + + + Your search engine in Brave + + + + + Based on a law in your region, Brave asks you to choose your default search engine. These search engines are popular in your region and are shown in random order. + + + <b>Your default search engine lets you search the web and powers Brave features</b> like searching from the address bar and from images on web pages. A feature might not be available if your search engine doesn’t support it. + + + You can change your search engine anytime in Brave’s settings. + + + + Search with $1Brave + + + + These search engines are popular in your region and are shown in random order + + + + diff --git a/components/site_settings_strings.grdp b/components/site_settings_strings.grdp index 63bdfa4d52da..b9bf270b7596 100644 --- a/components/site_settings_strings.grdp +++ b/components/site_settings_strings.grdp @@ -24,10 +24,10 @@ automatic downloads - Auto picture-in-picture + Automatic picture-in-picture - auto picture-in-picture + automatic picture-in-picture Background sync @@ -161,6 +161,12 @@ virtual reality + + Embedded content + + + embedded content + @@ -227,11 +233,5 @@ window management - - Embedded content - - - embedded content - diff --git a/components/sync/engine/brave_sync_manager_impl.cc b/components/sync/engine/brave_sync_manager_impl.cc index 41fa6c1de638..a7c2d0b06c7f 100644 --- a/components/sync/engine/brave_sync_manager_impl.cc +++ b/components/sync/engine/brave_sync_manager_impl.cc @@ -7,8 +7,8 @@ #include +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/engine/sync_scheduler.h" -#include "components/sync/protocol/sync_protocol_error.h" namespace syncer { diff --git a/components/sync/engine/brave_sync_manager_impl.h b/components/sync/engine/brave_sync_manager_impl.h index b0395598bf1c..25577a1d6ac1 100644 --- a/components/sync/engine/brave_sync_manager_impl.h +++ b/components/sync/engine/brave_sync_manager_impl.h @@ -10,7 +10,7 @@ #include "base/functional/callback_forward.h" #include "components/sync/engine/sync_manager_impl.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" namespace syncer { diff --git a/components/sync/engine/brave_sync_server_commands.cc b/components/sync/engine/brave_sync_server_commands.cc index f7a91e7bd646..695dd1fdf059 100644 --- a/components/sync/engine/brave_sync_server_commands.cc +++ b/components/sync/engine/brave_sync_server_commands.cc @@ -10,9 +10,10 @@ #include "base/functional/callback.h" #include "base/logging.h" #include "base/sequence_checker.h" +#include "base/types/cxx23_to_underlying.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/engine/syncer_proto_util.h" #include "components/sync/protocol/sync.pb.h" -#include "components/sync/protocol/sync_protocol_error.h" namespace syncer { @@ -38,10 +39,11 @@ void BraveSyncServerCommands::PermanentlyDeleteAccount( const SyncerError post_result = SyncerProtoUtil::PostClientToServerMessage( message, &response, cycle, nullptr); - if (post_result.value() != SyncerError::SYNCER_OK) { + if (post_result.type() != SyncerError::Type::kSuccess) { VLOG(1) << "[BraveSync] " << __func__ << " Post ClearServerData failed post_result=" - << post_result.value() << " " << post_result.ToString(); + << base::to_underlying(post_result.type()) << " " + << post_result.ToString(); } if (response.has_error_code()) { diff --git a/components/sync/engine/brave_sync_server_commands.h b/components/sync/engine/brave_sync_server_commands.h index 8502de559e7f..2a9e9fefdd6a 100644 --- a/components/sync/engine/brave_sync_server_commands.h +++ b/components/sync/engine/brave_sync_server_commands.h @@ -7,7 +7,7 @@ #define BRAVE_COMPONENTS_SYNC_ENGINE_BRAVE_SYNC_SERVER_COMMANDS_H_ #include "base/functional/callback_forward.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" namespace syncer { diff --git a/components/sync/service/BUILD.gn b/components/sync/service/BUILD.gn index 34b619a12b70..b1fc73c29a58 100644 --- a/components/sync/service/BUILD.gn +++ b/components/sync/service/BUILD.gn @@ -23,6 +23,7 @@ source_set("unit_tests") { "//brave/components/brave_sync:prefs", "//brave/components/constants", "//brave/components/sync/test:test_support", + "//components/history/core/browser:browser", "//components/os_crypt/sync:os_crypt", "//components/os_crypt/sync:test_support", "//components/prefs:prefs", diff --git a/components/sync/service/brave_sync_service_impl.cc b/components/sync/service/brave_sync_service_impl.cc index 31ae686e88f4..156e2265c6dd 100644 --- a/components/sync/service/brave_sync_service_impl.cc +++ b/components/sync/service/brave_sync_service_impl.cc @@ -16,8 +16,8 @@ #include "brave/components/sync/service/brave_sync_auth_manager.h" #include "brave/components/sync/service/sync_service_impl_delegate.h" #include "components/prefs/pref_service.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/model/type_entities_count.h" -#include "components/sync/protocol/sync_protocol_error.h" namespace syncer { diff --git a/components/sync/service/brave_sync_service_impl.h b/components/sync/service/brave_sync_service_impl.h index 75a1c0fbcb2a..c77d5731e6e0 100644 --- a/components/sync/service/brave_sync_service_impl.h +++ b/components/sync/service/brave_sync_service_impl.h @@ -14,7 +14,7 @@ #include "base/memory/weak_ptr.h" #include "brave/components/brave_sync/brave_sync_prefs.h" #include "components/prefs/pref_change_registrar.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/service/sync_service_impl.h" namespace syncer { @@ -76,6 +76,7 @@ class BraveSyncServiceImpl : public SyncServiceImpl { OnAccountDeleted_FailureAndRetry); FRIEND_TEST_ALL_PREFIXES(BraveSyncServiceImplTest, JoinActiveOrNewChain); FRIEND_TEST_ALL_PREFIXES(BraveSyncServiceImplTest, JoinDeletedChain); + FRIEND_TEST_ALL_PREFIXES(BraveSyncServiceImplTest, HistoryPreconditions); BraveSyncAuthManager* GetBraveSyncAuthManager(); SyncServiceCrypto* GetCryptoForTests(); diff --git a/components/sync/service/brave_sync_service_impl_unittest.cc b/components/sync/service/brave_sync_service_impl_unittest.cc index 6aae971436fd..3416a28387a3 100644 --- a/components/sync/service/brave_sync_service_impl_unittest.cc +++ b/components/sync/service/brave_sync_service_impl_unittest.cc @@ -9,6 +9,8 @@ #include "base/logging.h" #include "base/test/gtest_util.h" #include "base/test/task_environment.h" +#include "brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h" +#include "brave/components/history/core/browser/sync/brave_history_model_type_controller.h" #include "brave/components/sync/service/brave_sync_service_impl.h" #include "brave/components/sync/service/sync_service_impl_delegate.h" #include "brave/components/sync/test/brave_mock_sync_engine.h" @@ -24,6 +26,7 @@ #include "components/sync/test/fake_sync_engine.h" #include "components/sync/test/fake_sync_manager.h" #include "components/sync/test/sync_service_impl_bundle.h" +#include "components/sync/test/test_model_type_store_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -132,6 +135,10 @@ class BraveSyncServiceImplTest : public testing::Test { return component_factory()->last_created_engine(); } + signin::IdentityManager* identity_manager() { + return sync_service_impl_bundle_.identity_manager(); + } + protected: content::BrowserTaskEnvironment task_environment_; @@ -489,4 +496,62 @@ TEST_F(BraveSyncServiceImplTest, JoinDeletedChain) { OSCryptMocker::TearDown(); } +TEST_F(BraveSyncServiceImplTest, HistoryPreconditions) { + // This test ensures that BraveHistoryModelTypeController and + // BraveHistoryDeleteDirectivesModelTypeController allow to run if + // IsEncryptEverythingEnabled is set to true; upstream doesn't allow + // History sync when encrypt everything is set to true. + // The test is placed here alongside BraveSyncServiceImplTest because + // here is the infrastructure which allows implement it. + // Otherwise TestSyncUserSettings would not allow to override + // IsEncryptEverythingEnabled. + + OSCryptMocker::SetUp(); + CreateSyncService(); + + brave_sync_service_impl()->Initialize(); + EXPECT_FALSE(engine()); + brave_sync_service_impl()->SetSyncCode(kValidSyncCode); + task_environment_.RunUntilIdle(); + + brave_sync_service_impl() + ->GetUserSettings() + ->SetInitialSyncFeatureSetupComplete( + syncer::SyncFirstSetupCompleteSource::ADVANCED_FLOW_CONFIRM); + EXPECT_TRUE(engine()); + + // Code below turns on encrypt everything + brave_sync_service_impl()->GetCryptoForTests()->OnEncryptedTypesChanged( + AlwaysEncryptedUserTypes(), true); + + // Ensure encrypt everything was actually enabled + EXPECT_TRUE(brave_sync_service_impl() + ->GetUserSettings() + ->IsEncryptEverythingEnabled()); + + auto history_model_type_controller = + std::make_unique( + brave_sync_service_impl(), identity_manager(), nullptr, + pref_service()); + + auto history_precondition_state = + history_model_type_controller->GetPreconditionState(); + EXPECT_EQ(history_precondition_state, + DataTypeController::PreconditionState::kPreconditionsMet); + + auto test_model_type_store_service = + std::make_unique(); + auto history_delete_directives_model_type_controller = std::make_unique< + history::BraveHistoryDeleteDirectivesModelTypeController>( + base::DoNothing(), brave_sync_service_impl(), + test_model_type_store_service.get(), nullptr, pref_service()); + + auto history_delete_directives_precondition_state = + history_delete_directives_model_type_controller->GetPreconditionState(); + EXPECT_EQ(history_delete_directives_precondition_state, + DataTypeController::PreconditionState::kPreconditionsMet); + + OSCryptMocker::TearDown(); +} + } // namespace syncer diff --git a/components/sync/sources.gni b/components/sync/sources.gni deleted file mode 100644 index d6eefad2ae1f..000000000000 --- a/components/sync/sources.gni +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2023 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_components_sync_deps = [ "//brave/components/brave_sync:features" ] diff --git a/components/version_ui_strings.grdp b/components/version_ui_strings.grdp index 32fad769fc5d..68bf0db48533 100644 --- a/components/version_ui_strings.grdp +++ b/components/version_ui_strings.grdp @@ -101,8 +101,8 @@ . - - chrome://version + + <a href="#" id="os-link-href" aria-describedby="os-link-desc">chrome://version</a> @@ -112,8 +112,8 @@ . - - os://version + + <a href="os://version" id="os-link-href" aria-describedby="os-link-desc">os://version</a> diff --git a/components/webauthn_strings.grdp b/components/webauthn_strings.grdp new file mode 100644 index 000000000000..f19544ebbae7 --- /dev/null +++ b/components/webauthn_strings.grdp @@ -0,0 +1,23 @@ + + + + + Save passkey outside Private? + + + This passkey will be saved to your password manager. Anyone with access to it will be able to use this passkey. + + + Continue + + + + Passkey confirmation sheet + + + Passkey confirmation sheet opened + + + Passkey confirmation sheet closed + + diff --git a/components/webauthn_strings_override.grdp b/components/webauthn_strings_override.grdp new file mode 100644 index 000000000000..e8b204711f84 --- /dev/null +++ b/components/webauthn_strings_override.grdp @@ -0,0 +1,6 @@ + + + + Save passkey outside Private? + + diff --git a/components/webxr_strings.grdp b/components/webxr_strings.grdp index 383d229eeaa3..2ad94241ed4d 100644 --- a/components/webxr_strings.grdp +++ b/components/webxr_strings.grdp @@ -21,5 +21,8 @@ Use another device + + VR Menu + diff --git a/ios/app/BUILD.gn b/ios/app/BUILD.gn index 54d9a1317251..a61c58794d12 100644 --- a/ios/app/BUILD.gn +++ b/ios/app/BUILD.gn @@ -69,7 +69,7 @@ source_set("app") { "//ios/chrome/app/startup:startup", "//ios/chrome/app/startup:startup_basic", "//ios/chrome/browser/bookmarks/model", - "//ios/chrome/browser/browser_state:browser_state", + "//ios/chrome/browser/browser_state/model", "//ios/chrome/browser/flags:system_flags", "//ios/chrome/browser/history", "//ios/chrome/browser/main", @@ -80,7 +80,7 @@ source_set("app") { "//ios/chrome/browser/shared/model/paths", "//ios/chrome/browser/shared/model/web_state_list", "//ios/chrome/browser/shared/public/commands", - "//ios/chrome/browser/sync", + "//ios/chrome/browser/sync/model", "//ios/chrome/browser/ui/webui:webui_internal", "//ios/chrome/common", "//ios/public/provider/chrome/browser/font:font_api", diff --git a/ios/app/brave_core_main.mm b/ios/app/brave_core_main.mm index 838cad1cbf80..e3f4ef85e348 100644 --- a/ios/app/brave_core_main.mm +++ b/ios/app/brave_core_main.mm @@ -65,9 +65,9 @@ #include "ios/chrome/browser/shared/model/paths/paths.h" #include "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #include "ios/chrome/browser/shared/public/commands/command_dispatcher.h" -#include "ios/chrome/browser/sync/send_tab_to_self_sync_service_factory.h" -#include "ios/chrome/browser/sync/session_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_service_factory.h" +#include "ios/chrome/browser/sync/model/send_tab_to_self_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/session_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_service_factory.h" #include "ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.h" #include "ios/public/provider/chrome/browser/overrides/overrides_api.h" #include "ios/public/provider/chrome/browser/ui_utils/ui_utils_api.h" @@ -356,15 +356,8 @@ - (BraveBookmarksAPI*)bookmarksAPI { - (BraveHistoryAPI*)historyAPI { if (!_historyAPI) { - history::HistoryService* history_service_ = - ios::HistoryServiceFactory::GetForBrowserState( - _mainBrowserState, ServiceAccessType::EXPLICIT_ACCESS); - history::WebHistoryService* web_history_service_ = - ios::WebHistoryServiceFactory::GetForBrowserState(_mainBrowserState); - _historyAPI = - [[BraveHistoryAPI alloc] initWithHistoryService:history_service_ - webHistoryService:web_history_service_]; + [[BraveHistoryAPI alloc] initWithBrowserState:_mainBrowserState]; } return _historyAPI; } diff --git a/ios/browser/BUILD.gn b/ios/browser/BUILD.gn index eaccdb4a27f7..0247defea6be 100644 --- a/ios/browser/BUILD.gn +++ b/ios/browser/BUILD.gn @@ -47,12 +47,13 @@ source_set("browser") { "//components/variations", "//components/variations/service", "//ios/chrome/browser/application_context/model", - "//ios/chrome/browser/browser_state:browser_state", + "//ios/chrome/browser/browser_state/model", "//ios/chrome/browser/flags", "//ios/chrome/browser/flags:client_side", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/paths", "//ios/chrome/browser/shared/model/url:constants", + "//ios/chrome/browser/web:web_internal", "//ios/components/webui:url_constants", "//ios/web/public", "//ios/web/public/init", diff --git a/ios/browser/DEPS b/ios/browser/DEPS index b28f94c744bb..448906f2ff73 100644 --- a/ios/browser/DEPS +++ b/ios/browser/DEPS @@ -3,6 +3,7 @@ include_rules = [ "+components", "+mojo/public/cpp/bindings", "+ios/chrome/browser", + "+ios/chrome/browser/web", "+ios/components", "+ios/web/public", "+ios/web/js_messaging", diff --git a/ios/browser/api/brave_wallet/BUILD.gn b/ios/browser/api/brave_wallet/BUILD.gn index 454b7cfc075b..3f733a45e506 100644 --- a/ios/browser/api/brave_wallet/BUILD.gn +++ b/ios/browser/api/brave_wallet/BUILD.gn @@ -40,7 +40,7 @@ source_set("brave_wallet") { "//brave/components/resources:static_resources_grit", "//brave/ios/browser/api/url", "//brave/ios/browser/brave_wallet", - "//ios/chrome/browser/content_settings", + "//ios/chrome/browser/content_settings/model", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/paths", "//net", diff --git a/ios/browser/api/brave_wallet/brave_wallet_api.mm b/ios/browser/api/brave_wallet/brave_wallet_api.mm index b95bb1147bb9..b6adaaf7f056 100644 --- a/ios/browser/api/brave_wallet/brave_wallet_api.mm +++ b/ios/browser/api/brave_wallet/brave_wallet_api.mm @@ -18,7 +18,7 @@ #include "brave/ios/browser/brave_wallet/keyring_service_factory.h" #include "brave/ios/browser/brave_wallet/tx_service_factory.h" #include "components/grit/brave_components_resources.h" -#include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "ios/chrome/browser/content_settings/model/host_content_settings_map_factory.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state_manager.h" #include "ui/base/resource/resource_bundle.h" diff --git a/ios/browser/api/history/BUILD.gn b/ios/browser/api/history/BUILD.gn index 491347897e0f..329571e346f3 100644 --- a/ios/browser/api/history/BUILD.gn +++ b/ios/browser/api/history/BUILD.gn @@ -12,14 +12,21 @@ source_set("history") { "brave_history_api.h", "brave_history_api.mm", "brave_history_observer.h", + "history_driver_ios.h", + "history_driver_ios.mm", "history_service_listener_ios.h", "history_service_listener_ios.mm", ] deps = [ "//base", + "//components/browsing_data/core", "//components/history/core/browser", + "//components/keyed_service/core", "//ios/chrome/browser/history", + "//ios/chrome/browser/history:history_utils", + "//ios/chrome/browser/shared/model/browser_state", + "//ios/chrome/browser/sync/model", "//ios/web/public/thread", "//net", "//ui/base", diff --git a/ios/browser/api/history/brave_history_api+private.h b/ios/browser/api/history/brave_history_api+private.h index 69fd0d62bfae..067cd7f25a91 100644 --- a/ios/browser/api/history/brave_history_api+private.h +++ b/ios/browser/api/history/brave_history_api+private.h @@ -12,15 +12,10 @@ NS_ASSUME_NONNULL_BEGIN -namespace history { -class HistoryService; -class WebHistoryService; -} +class ChromeBrowserState; @interface BraveHistoryAPI (Private) -- (instancetype)initWithHistoryService:(history::HistoryService*)historyService - webHistoryService: - (history::WebHistoryService*)webHistoryService; +- (instancetype)initWithBrowserState:(ChromeBrowserState*)mainBrowserState; @end NS_ASSUME_NONNULL_END diff --git a/ios/browser/api/history/brave_history_api.h b/ios/browser/api/history/brave_history_api.h index 90462360c5ea..2565ec93ab00 100644 --- a/ios/browser/api/history/brave_history_api.h +++ b/ios/browser/api/history/brave_history_api.h @@ -53,8 +53,7 @@ OBJC_EXPORT /// Add History Method which also allows to edit transition type /// @param history - History Object to be added -/// @param isURLTyped - Bool determine If URL is typed and synced -- (void)addHistory:(IOSHistoryNode*)history isURLTyped:(BOOL)isURLTyped; +- (void)addHistory:(IOSHistoryNode*)history; /// Remove Specific History /// @param history - History Object to be removed from history diff --git a/ios/browser/api/history/brave_history_api.mm b/ios/browser/api/history/brave_history_api.mm index 3c924bddae75..72e1dcfd2cd6 100644 --- a/ios/browser/api/history/brave_history_api.mm +++ b/ios/browser/api/history/brave_history_api.mm @@ -7,23 +7,39 @@ #include "base/functional/bind.h" #include "base/strings/sys_string_conversions.h" +#include "brave/ios/browser/api/history/brave_history_observer.h" +#include "brave/ios/browser/api/history/history_driver_ios.h" +#include "brave/ios/browser/api/history/history_service_listener_ios.h" +#include "components/history/core/browser/browsing_history_service.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_types.h" +#include "components/keyed_service/core/service_access_type.h" #include "ios/chrome/browser/history/history_service_factory.h" #include "ios/chrome/browser/history/web_history_service_factory.h" +#include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" +#include "ios/chrome/browser/sync/model/sync_service_factory.h" #include "ios/web/public/thread/web_task_traits.h" #include "ios/web/public/thread/web_thread.h" #include "net/base/mac/url_conversions.h" #include "ui/base/page_transition_types.h" #include "url/gurl.h" -#include "brave/ios/browser/api/history/brave_history_observer.h" -#include "brave/ios/browser/api/history/history_service_listener_ios.h" - #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif +namespace { + +history::WebHistoryService* WebHistoryServiceGetter( + base::WeakPtr weak_browser_state) { + DCHECK(weak_browser_state.get()) + << "Getter should not be called after ChromeBrowserState destruction."; + return ios::WebHistoryServiceFactory::GetForBrowserState( + weak_browser_state.get()); +} + +} // anonymous namespace + DomainMetricTypeIOS const DomainMetricTypeIOSNoMetric = static_cast( history::DomainMetricType::kNoMetric); @@ -100,20 +116,39 @@ @interface BraveHistoryAPI () { history::WebHistoryService* web_history_service_; // Tracker for history requests. base::CancelableTaskTracker tracker_; + + // Provides dependencies and funnels callbacks from BrowsingHistoryService. + std::unique_ptr _browsingHistoryDriver; + // Abstraction to communicate with HistoryService and WebHistoryService. + std::unique_ptr _browsingHistoryService; } @property(nonatomic, strong) void (^query_completion)(NSArray*) ; @end -@implementation BraveHistoryAPI +@implementation BraveHistoryAPI { + ChromeBrowserState* _mainBrowserState; // NOT OWNED +} -- (instancetype)initWithHistoryService:(history::HistoryService*)historyService - webHistoryService: - (history::WebHistoryService*)webHistoryService { +- (instancetype)initWithBrowserState:(ChromeBrowserState*)mainBrowserState { if ((self = [super init])) { DCHECK_CURRENTLY_ON(web::WebThread::UI); - history_service_ = historyService; - web_history_service_ = webHistoryService; + _mainBrowserState = mainBrowserState; + + history_service_ = ios::HistoryServiceFactory::GetForBrowserState( + _mainBrowserState, ServiceAccessType::EXPLICIT_ACCESS); + web_history_service_ = + ios::WebHistoryServiceFactory::GetForBrowserState(_mainBrowserState); + + _browsingHistoryDriver = + std::make_unique(base::BindRepeating( + &WebHistoryServiceGetter, _mainBrowserState->AsWeakPtr())); + + _browsingHistoryService = std::make_unique( + _browsingHistoryDriver.get(), + ios::HistoryServiceFactory::GetForBrowserState( + _mainBrowserState, ServiceAccessType::EXPLICIT_ACCESS), + SyncServiceFactory::GetForBrowserState(_mainBrowserState)); } return self; } @@ -138,7 +173,7 @@ - (bool)isBackendLoaded { return history_service_->BackendLoaded(); } -- (void)addHistory:(IOSHistoryNode*)history isURLTyped:(BOOL)isURLTyped { +- (void)addHistory:(IOSHistoryNode*)history { DCHECK_CURRENTLY_ON(web::WebThread::UI); // Important! Only Typed URL is being synced in core side @@ -149,8 +184,7 @@ - (void)addHistory:(IOSHistoryNode*)history isURLTyped:(BOOL)isURLTyped { /*nav_entry_id=*/0, /*local_navigation_id=*/absl::nullopt, /*referrer=*/GURL(), /*redirect_list*/ history::RedirectList(), - /*transition*/ - isURLTyped ? ui::PAGE_TRANSITION_TYPED : ui::PAGE_TRANSITION_LINK, + /*transition*/ ui::PAGE_TRANSITION_TYPED, /*hidden=*/false, /*visit_source*/ history::VisitSource::SOURCE_BROWSED, /*did_replace_entry=*/false, /*consider_for_ntp_most_visited=*/true, /*title*/ base::SysNSStringToUTF16(history.title), @@ -163,9 +197,16 @@ - (void)addHistory:(IOSHistoryNode*)history isURLTyped:(BOOL)isURLTyped { - (void)removeHistory:(IOSHistoryNode*)history { DCHECK_CURRENTLY_ON(web::WebThread::UI); - // Deletes a specific URL using history service and web history service - history_service_->DeleteLocalAndRemoteUrl(web_history_service_, - net::GURLWithNSURL(history.url)); + // Delete items from Browser History and from synced devices + std::vector entries; + history::BrowsingHistoryService::HistoryEntry entry; + entry.url = net::GURLWithNSURL(history.url); + entry.all_timestamps.insert(base::Time::FromNSDate(history.dateAdded) + .ToDeltaSinceWindowsEpoch() + .InMicroseconds()); + entries.push_back(entry); + + _browsingHistoryService->RemoveVisits(entries); } - (void)removeAllWithCompletion:(void (^)())completion { diff --git a/ios/browser/api/history/history_driver_ios.h b/ios/browser/api/history/history_driver_ios.h new file mode 100644 index 000000000000..fd3d1bb34f37 --- /dev/null +++ b/ios/browser/api/history/history_driver_ios.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2023 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_IOS_BROWSER_API_HISTORY_HISTORY_DRIVER_IOS_H_ +#define BRAVE_IOS_BROWSER_API_HISTORY_HISTORY_DRIVER_IOS_H_ + +#include + +#include "base/functional/callback.h" +#include "base/memory/raw_ptr.h" +#include "components/history/core/browser/browsing_history_driver.h" +#include "components/history/core/browser/browsing_history_service.h" +#include "url/gurl.h" + +class HistoryDriverIOS : public history::BrowsingHistoryDriver { + public: + using WebHistoryServiceGetter = + base::RepeatingCallback; + + explicit HistoryDriverIOS(WebHistoryServiceGetter history_service_getter); + + HistoryDriverIOS(const HistoryDriverIOS&) = delete; + HistoryDriverIOS& operator=(const HistoryDriverIOS&) = delete; + + ~HistoryDriverIOS() override; + + private: + // history::BrowsingHistoryDriver implementation. + void OnQueryComplete( + const std::vector& results, + const history::BrowsingHistoryService::QueryResultsInfo& + query_results_info, + base::OnceClosure continuation_closure) override; + void OnRemoveVisitsComplete() override; + void OnRemoveVisitsFailed() override; + void OnRemoveVisits( + const std::vector& expire_list) override; + void HistoryDeleted() override; + void HasOtherFormsOfBrowsingHistory(bool has_other_forms, + bool has_synced_results) override; + bool AllowHistoryDeletions() override; + bool ShouldHideWebHistoryUrl(const GURL& url) override; + history::WebHistoryService* GetWebHistoryService() override; + void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( + const syncer::SyncService* sync_service, + history::WebHistoryService* history_service, + base::OnceCallback callback) override; + + // The current web history service. + WebHistoryServiceGetter history_service_getter_; +}; + +#endif // BRAVE_IOS_BROWSER_API_HISTORY_HISTORY_DRIVER_IOS_H_ diff --git a/ios/browser/api/history/history_driver_ios.mm b/ios/browser/api/history/history_driver_ios.mm new file mode 100644 index 000000000000..6254e2f3e7fc --- /dev/null +++ b/ios/browser/api/history/history_driver_ios.mm @@ -0,0 +1,76 @@ +/* Copyright (c) 2023 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 "brave/ios/browser/api/history/history_driver_ios.h" + +#import + +#import "base/check.h" +#import "base/strings/utf_string_conversions.h" +#import "components/browsing_data/core/history_notice_utils.h" +#import "ios/chrome/browser/history/history_utils.h" + +using history::BrowsingHistoryService; + +#pragma mark - HistoryDriverIOS + +HistoryDriverIOS::HistoryDriverIOS( + WebHistoryServiceGetter history_service_getter) + : history_service_getter_(history_service_getter) { + DCHECK(!history_service_getter_.is_null()); +} + +HistoryDriverIOS::~HistoryDriverIOS() = default; + +#pragma mark - Private methods + +void HistoryDriverIOS::OnQueryComplete( + const std::vector& results, + const BrowsingHistoryService::QueryResultsInfo& query_results_info, + base::OnceClosure continuation_closure) { + // Ignored. +} + +void HistoryDriverIOS::OnRemoveVisitsComplete() { + // Ignored. +} + +void HistoryDriverIOS::OnRemoveVisitsFailed() { + // Ignored. +} + +void HistoryDriverIOS::OnRemoveVisits( + const std::vector& expire_list) { + // Ignored. +} + +void HistoryDriverIOS::HistoryDeleted() { + // Ignored. +} + +void HistoryDriverIOS::HasOtherFormsOfBrowsingHistory(bool has_other_forms, + bool has_synced_results) { + // Ignored. +} + +bool HistoryDriverIOS::AllowHistoryDeletions() { + return true; +} + +bool HistoryDriverIOS::ShouldHideWebHistoryUrl(const GURL& url) { + return !ios::CanAddURLToHistory(url); +} + +history::WebHistoryService* HistoryDriverIOS::GetWebHistoryService() { + return history_service_getter_.Run(); +} + +void HistoryDriverIOS::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( + const syncer::SyncService* sync_service, + history::WebHistoryService* history_service, + base::OnceCallback callback) { + browsing_data::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( + sync_service, history_service, std::move(callback)); +} diff --git a/ios/browser/api/opentabs/BUILD.gn b/ios/browser/api/opentabs/BUILD.gn index 11a9f8915aef..e9747f0027f3 100644 --- a/ios/browser/api/opentabs/BUILD.gn +++ b/ios/browser/api/opentabs/BUILD.gn @@ -36,7 +36,7 @@ source_set("opentabs") { "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/web_state_list", - "//ios/chrome/browser/sync", + "//ios/chrome/browser/sync/model", "//ios/chrome/browser/synced_sessions", "//ios/chrome/browser/tabs", "//ios/web/common:user_agent", diff --git a/ios/browser/api/sync/BUILD.gn b/ios/browser/api/sync/BUILD.gn index bb2e53035f49..00add4c97035 100644 --- a/ios/browser/api/sync/BUILD.gn +++ b/ios/browser/api/sync/BUILD.gn @@ -30,7 +30,7 @@ source_set("sync") { "//components/sync_device_info", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser_state", - "//ios/chrome/browser/sync", + "//ios/chrome/browser/sync/model", "//ios/components/webui:url_constants", "//ios/web/js_messaging:js_messaging", "//ios/web/public/thread", diff --git a/ios/browser/api/sync/brave_sync_api.h b/ios/browser/api/sync/brave_sync_api.h index d8177a026af2..a6eef6d1fab7 100644 --- a/ios/browser/api/sync/brave_sync_api.h +++ b/ios/browser/api/sync/brave_sync_api.h @@ -22,8 +22,6 @@ OBJC_EXPORT BraveSyncAPISyncProtocolErrorResult const BraveSyncAPISyncProtocolErrorResultNotMyBirthday; OBJC_EXPORT BraveSyncAPISyncProtocolErrorResult const BraveSyncAPISyncProtocolErrorResultThrottled; -OBJC_EXPORT BraveSyncAPISyncProtocolErrorResult const - BraveSyncAPISyncProtocolErrorResultClearPending; OBJC_EXPORT BraveSyncAPISyncProtocolErrorResult const BraveSyncAPISyncProtocolErrorResultTransientError; OBJC_EXPORT BraveSyncAPISyncProtocolErrorResult const diff --git a/ios/browser/api/sync/brave_sync_api.mm b/ios/browser/api/sync/brave_sync_api.mm index db41067ba6dc..c3a599727c68 100644 --- a/ios/browser/api/sync/brave_sync_api.mm +++ b/ios/browser/api/sync/brave_sync_api.mm @@ -23,7 +23,7 @@ #include "brave/ios/browser/api/sync/brave_sync_internals+private.h" #include "brave/ios/browser/api/sync/brave_sync_worker.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/service/sync_service.h" #include "components/sync/service/sync_service_impl.h" #include "components/sync/service/sync_service_observer.h" @@ -34,10 +34,10 @@ #include "ios/chrome/browser/shared/model/application_context/application_context.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state_manager.h" -#include "ios/chrome/browser/sync/device_info_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service.h" -#include "ios/chrome/browser/sync/sync_setup_service_factory.h" +#include "ios/chrome/browser/sync/model/device_info_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_setup_service.h" +#include "ios/chrome/browser/sync/model/sync_setup_service_factory.h" #include "ios/web/public/thread/web_task_traits.h" #include "ios/web/public/thread/web_thread.h" @@ -56,9 +56,6 @@ BraveSyncAPISyncProtocolErrorResult const BraveSyncAPISyncProtocolErrorResultThrottled = static_cast(syncer::SyncProtocolErrorType::THROTTLED); -BraveSyncAPISyncProtocolErrorResult const - BraveSyncAPISyncProtocolErrorResultClearPending = - static_cast(syncer::SyncProtocolErrorType::CLEAR_PENDING); BraveSyncAPISyncProtocolErrorResult const BraveSyncAPISyncProtocolErrorResultTransientError = static_cast(syncer::SyncProtocolErrorType::TRANSIENT_ERROR); diff --git a/ios/browser/api/sync/brave_sync_worker.cc b/ios/browser/api/sync/brave_sync_worker.cc index 81f5f425f88d..7ccb93830ed8 100644 --- a/ios/browser/api/sync/brave_sync_worker.cc +++ b/ios/browser/api/sync/brave_sync_worker.cc @@ -22,7 +22,7 @@ #include "brave/components/brave_sync/time_limited_words.h" #include "brave/components/sync/service/brave_sync_service_impl.h" #include "brave/components/sync_device_info/brave_device_info.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/service/sync_service.h" #include "components/sync/service/sync_service_impl.h" #include "components/sync/service/sync_service_observer.h" @@ -31,10 +31,10 @@ #include "components/sync_device_info/device_info_tracker.h" #include "components/sync_device_info/local_device_info_provider.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/sync/device_info_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service.h" -#include "ios/chrome/browser/sync/sync_setup_service_factory.h" +#include "ios/chrome/browser/sync/model/device_info_sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_service_factory.h" +#include "ios/chrome/browser/sync/model/sync_setup_service.h" +#include "ios/chrome/browser/sync/model/sync_setup_service_factory.h" #include "ios/web/public/thread/web_thread.h" namespace { diff --git a/ios/browser/api/sync/brave_sync_worker.h b/ios/browser/api/sync/brave_sync_worker.h index 542c445307c0..a87054b0ba10 100644 --- a/ios/browser/api/sync/brave_sync_worker.h +++ b/ios/browser/api/sync/brave_sync_worker.h @@ -14,7 +14,7 @@ #include "base/scoped_multi_source_observation.h" #include "base/scoped_observation.h" #include "brave/components/brave_sync/time_limited_words.h" -#include "components/sync/protocol/sync_protocol_error.h" +#include "components/sync/engine/sync_protocol_error.h" #include "components/sync/service/sync_service.h" #include "components/sync/service/sync_service_observer.h" #include "components/sync_device_info/device_info_sync_service.h" diff --git a/ios/browser/api/web/web_state/BUILD.gn b/ios/browser/api/web/web_state/BUILD.gn index 001de3ea73f9..1e3182037a57 100644 --- a/ios/browser/api/web/web_state/BUILD.gn +++ b/ios/browser/api/web/web_state/BUILD.gn @@ -22,7 +22,7 @@ source_set("web_state") { "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/web_state_list", - "//ios/chrome/browser/sync", + "//ios/chrome/browser/sync/model", "//ios/chrome/browser/tabs", "//ios/web/common:user_agent", "//ios/web/public/session:session", diff --git a/ios/browser/application_context/brave_application_context_impl.h b/ios/browser/application_context/brave_application_context_impl.h index 71e2af9bea13..ef0859d7d15d 100644 --- a/ios/browser/application_context/brave_application_context_impl.h +++ b/ios/browser/application_context/brave_application_context_impl.h @@ -28,19 +28,23 @@ class BraveApplicationContextImpl : public ApplicationContextImpl { const std::string& locale, const std::string& country); - brave::URLSanitizerComponentInstaller* url_sanitizer_component_installer(); - - // Disable copy constructor and assignment operator BraveApplicationContextImpl(const BraveApplicationContextImpl&) = delete; BraveApplicationContextImpl& operator=(const BraveApplicationContextImpl&) = delete; + ~BraveApplicationContextImpl() override; + + // ApplicationContextImpl + ukm::UkmRecorder* GetUkmRecorder() override; + BrowserPolicyConnectorIOS* GetBrowserPolicyConnector() override; + gcm::GCMDriver* GetGCMDriver() override; + + // BraveApplicationContextImpl + brave::URLSanitizerComponentInstaller* url_sanitizer_component_installer(); + // Start any services that we may need later void StartBraveServices(); - // Out-of-line destructor declaration - ~BraveApplicationContextImpl() override; - private: brave_component_updater::BraveComponent::Delegate* brave_component_updater_delegate(); diff --git a/ios/browser/application_context/brave_application_context_impl.mm b/ios/browser/application_context/brave_application_context_impl.mm index ce7b6476f58a..9b17cd0460a7 100644 --- a/ios/browser/application_context/brave_application_context_impl.mm +++ b/ios/browser/application_context/brave_application_context_impl.mm @@ -27,6 +27,23 @@ inline BraveApplicationContextImpl::~BraveApplicationContextImpl() = default; +// MARK: - ApplicationContextImpl + +ukm::UkmRecorder* BraveApplicationContextImpl::GetUkmRecorder() { + return nullptr; +} + +BrowserPolicyConnectorIOS* +BraveApplicationContextImpl::GetBrowserPolicyConnector() { + return nullptr; +} + +gcm::GCMDriver* BraveApplicationContextImpl::GetGCMDriver() { + return nullptr; +} + +// MARK: - BraveApplicationContextImpl + brave_component_updater::BraveComponent::Delegate* BraveApplicationContextImpl::brave_component_updater_delegate() { if (!brave_component_updater_delegate_) { diff --git a/ios/browser/brave_web_client.h b/ios/browser/brave_web_client.h index 3bcc1301ccbc..c408bfbe8030 100644 --- a/ios/browser/brave_web_client.h +++ b/ios/browser/brave_web_client.h @@ -8,15 +8,11 @@ #include #include -#include #include -#include "base/compiler_specific.h" -#import "ios/web/public/web_client.h" +#include "ios/chrome/browser/web/chrome_web_client.h" -class BraveWebMainParts; - -class BraveWebClient : public web::WebClient { +class BraveWebClient : public ChromeWebClient { public: BraveWebClient(); BraveWebClient(const BraveWebClient&) = delete; @@ -26,21 +22,10 @@ class BraveWebClient : public web::WebClient { void SetUserAgent(const std::string& user_agent); // WebClient implementation. - void AddAdditionalSchemes(Schemes* schemes) const override; - bool IsAppSpecificURL(const GURL& url) const override; - std::unique_ptr CreateWebMainParts() override; std::string GetUserAgent(web::UserAgentType type) const override; - std::string_view GetDataResource( - int resource_id, - ui::ResourceScaleFactor scale_factor) const override; - base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; - - void GetAdditionalWebUISchemes( - std::vector* additional_schemes) override; private: - BraveWebMainParts* web_main_parts_; std::string user_agent_; }; diff --git a/ios/browser/brave_web_client.mm b/ios/browser/brave_web_client.mm index 2e3712785f0d..2993a0d277c8 100644 --- a/ios/browser/brave_web_client.mm +++ b/ios/browser/brave_web_client.mm @@ -5,38 +5,24 @@ #import "brave/ios/browser/brave_web_client.h" -#include -#include - #include "base/functional/bind.h" #include "brave/ios/browser/brave_web_main_parts.h" #include "ios/chrome/browser/shared/model/url/chrome_url_constants.h" #include "ios/components/webui/web_ui_url_constants.h" -#include "ui/base/resource/resource_bundle.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif -BraveWebClient::BraveWebClient() : web_main_parts_(nullptr) {} +BraveWebClient::BraveWebClient() {} BraveWebClient::~BraveWebClient() { } -void BraveWebClient::AddAdditionalSchemes(Schemes* schemes) const { - schemes->standard_schemes.push_back(kChromeUIScheme); - schemes->secure_schemes.push_back(kChromeUIScheme); -} - -bool BraveWebClient::IsAppSpecificURL(const GURL& url) const { - return url.SchemeIs(kChromeUIScheme); -} - std::unique_ptr BraveWebClient::CreateWebMainParts() { - auto web_main_parts = std::make_unique(); - web_main_parts_ = web_main_parts.get(); - return web_main_parts; + return std::make_unique( + *base::CommandLine::ForCurrentProcess()); } void BraveWebClient::SetUserAgent(const std::string& user_agent) { @@ -46,19 +32,3 @@ std::string BraveWebClient::GetUserAgent(web::UserAgentType type) const { return user_agent_; } - -std::string_view BraveWebClient::GetDataResource( - int resource_id, - ui::ResourceScaleFactor scale_factor) const { - return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( - resource_id, scale_factor); -} - -base::RefCountedMemory* BraveWebClient::GetDataResourceBytes( - int resource_id) const { - return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( - resource_id); -} - -void BraveWebClient::GetAdditionalWebUISchemes( - std::vector* additional_schemes) {} diff --git a/ios/browser/brave_web_main_parts.h b/ios/browser/brave_web_main_parts.h index 7d242aa55119..7b79930a68e4 100644 --- a/ios/browser/brave_web_main_parts.h +++ b/ios/browser/brave_web_main_parts.h @@ -6,45 +6,19 @@ #ifndef BRAVE_IOS_BROWSER_BRAVE_WEB_MAIN_PARTS_H_ #define BRAVE_IOS_BROWSER_BRAVE_WEB_MAIN_PARTS_H_ -#include +#include "ios/chrome/browser/web/chrome_main_parts.h" -#include "ios/chrome/browser/flags/ios_chrome_field_trials.h" -#include "ios/web/public/init/web_main_parts.h" - -class BraveApplicationContextImpl; -class PrefService; - -namespace base { -class FieldTrialList; -} - -class BraveWebMainParts : public web::WebMainParts { +class BraveWebMainParts : public IOSChromeMainParts { public: - BraveWebMainParts(); + explicit BraveWebMainParts(const base::CommandLine& parsed_command_line); BraveWebMainParts(const BraveWebMainParts&) = delete; BraveWebMainParts& operator=(const BraveWebMainParts&) = delete; ~BraveWebMainParts() override; private: - void SetupMetrics(); // web::WebMainParts implementation. void PreCreateMainMessageLoop() override; - void PreCreateThreads() override; void PreMainMessageLoopRun() override; - void PostMainMessageLoopRun() override; - void PostDestroyThreads() override; - void PostCreateThreads() override; - void SetupFieldTrials(); - - std::unique_ptr application_context_; - - // Statistical testing infrastructure for the entire browser. NULL until - // SetUpMetricsAndFieldTrials is called. - std::unique_ptr field_trial_list_; - - PrefService* local_state_; - - IOSChromeFieldTrials ios_field_trials_; }; #endif // BRAVE_IOS_BROWSER_BRAVE_WEB_MAIN_PARTS_H_ diff --git a/ios/browser/brave_web_main_parts.mm b/ios/browser/brave_web_main_parts.mm index b4256e6c5bb3..e8a8088b1efe 100644 --- a/ios/browser/brave_web_main_parts.mm +++ b/ios/browser/brave_web_main_parts.mm @@ -21,7 +21,7 @@ #include "components/variations/variations_ids_provider.h" #include "components/variations/variations_switches.h" #include "ios/chrome/browser/application_context/model/application_context_impl.h" -#include "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h" +#include "ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.h" #include "ios/chrome/browser/flags/about_flags.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state_manager.h" @@ -35,23 +35,16 @@ #error "This file requires ARC support." #endif -BraveWebMainParts::BraveWebMainParts() {} +BraveWebMainParts::BraveWebMainParts( + const base::CommandLine& parsed_command_line) + : IOSChromeMainParts(parsed_command_line) {} BraveWebMainParts::~BraveWebMainParts() {} void BraveWebMainParts::PreCreateMainMessageLoop() { - l10n_util::OverrideLocaleWithCocoaLocale(); - - const std::string loaded_locale = - ui::ResourceBundle::InitSharedInstanceWithLocale( - std::string(), nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); - CHECK(!loaded_locale.empty()); - - base::FilePath resources_pack_path; - base::PathService::Get(ios::FILE_RESOURCES_PACK, &resources_pack_path); - ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( - resources_pack_path, ui::k100Percent); + IOSChromeMainParts::PreCreateMainMessageLoop(); + // Add Brave Resource Pack base::FilePath brave_pack_path; base::PathService::Get(base::DIR_ASSETS, &brave_pack_path); brave_pack_path = brave_pack_path.AppendASCII("brave_resources.pak"); @@ -59,114 +52,8 @@ brave_pack_path, ui::kScaleFactorNone); } -void BraveWebMainParts::PreCreateThreads() { - scoped_refptr local_state_task_runner = - base::ThreadPool::CreateSequencedTaskRunner( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); - - base::FilePath local_state_path; - CHECK(base::PathService::Get(ios::FILE_LOCAL_STATE, &local_state_path)); - application_context_.reset(new BraveApplicationContextImpl( - local_state_task_runner.get(), *base::CommandLine::ForCurrentProcess(), - l10n_util::GetLocaleOverride(), - base::SysNSStringToUTF8( - [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode]))); - DCHECK_EQ(application_context_.get(), GetApplicationContext()); - - // Initialize local state. - local_state_ = application_context_->GetLocalState(); - DCHECK(local_state_); - - flags_ui::PrefServiceFlagsStorage flags_storage( - application_context_->GetLocalState()); - ConvertFlagsToSwitches(&flags_storage, - base::CommandLine::ForCurrentProcess()); - - variations::VariationsIdsProvider::Create( - variations::VariationsIdsProvider::Mode::kUseSignedInState); - - SetupFieldTrials(); - - // variations::InitCrashKeys(); - // metrics::EnableExpiryChecker(::kExpiredHistogramsHashes, - // ::kNumExpiredHistograms); - - application_context_->PreCreateThreads(); -} - -void BraveWebMainParts::SetupMetrics() { - metrics::MetricsService* metrics = application_context_->GetMetricsService(); - metrics->GetSyntheticTrialRegistry()->AddSyntheticTrialObserver( - variations::VariationsIdsProvider::GetInstance()); - metrics->GetSyntheticTrialRegistry()->AddSyntheticTrialObserver( - variations::SyntheticTrialsActiveGroupIdProvider::GetInstance()); - // Now that field trials have been created, initializes metrics recording. - metrics->InitializeMetricsRecordingState(); -} - -void BraveWebMainParts::SetupFieldTrials() { - base::SetRecordActionTaskRunner(web::GetUIThreadTaskRunner({})); - - // Initialize FieldTrialList to support FieldTrials that use one-time - // randomization. - DCHECK(!field_trial_list_); - application_context_->GetMetricsServicesManager() - ->InstantiateFieldTrialList(); - field_trial_list_.reset(base::FieldTrialList::GetInstance()); - - std::unique_ptr feature_list(new base::FeatureList); - - // Associate parameters chosen in about:flags and create trial/group for them. - flags_ui::PrefServiceFlagsStorage flags_storage( - application_context_->GetLocalState()); - std::vector variation_ids; - RegisterAllFeatureVariationParameters(&flags_storage, feature_list.get()); - - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - - application_context_->GetVariationsService()->SetUpFieldTrials( - variation_ids, - command_line->GetSwitchValueASCII( - variations::switches::kForceVariationIds), - std::vector(), - std::move(feature_list), &ios_field_trials_); -} - void BraveWebMainParts::PreMainMessageLoopRun() { - application_context_->PreMainMessageLoopRun(); - - // ContentSettingsPattern need to be initialized before creating the - // ChromeBrowserState. - ContentSettingsPattern::SetNonWildcardDomainNonPortSchemes(nullptr, 0); - - // Ensure that the browser state is initialized. - EnsureBrowserStateKeyedServiceFactoriesBuilt(); - brave::EnsureBrowserStateKeyedServiceFactoriesBuilt(); - ios::ChromeBrowserStateManager* browser_state_manager = - application_context_->GetChromeBrowserStateManager(); - [[maybe_unused]] ChromeBrowserState* last_used_browser_state = - browser_state_manager->GetLastUsedBrowserState(); - - // This must occur at PreMainMessageLoopRun because `SetupMetrics()` uses the - // blocking pool, which is disabled until the CreateThreads phase of startup. - // TODO(crbug.com/786494): Investigate whether metrics recording can be - // initialized consistently across iOS and non-iOS platforms - SetupMetrics(); - - // Start the brave services - application_context_->StartBraveServices(); -} - -void BraveWebMainParts::PostMainMessageLoopRun() { - application_context_->StartTearDown(); -} - -void BraveWebMainParts::PostDestroyThreads() { - application_context_->PostDestroyThreads(); -} - -void BraveWebMainParts::PostCreateThreads() { - application_context_->PostCreateThreads(); + IOSChromeMainParts::PreMainMessageLoopRun(); + static_cast(application_context_.get()) + ->StartBraveServices(); } diff --git a/ios/browser/providers/BUILD.gn b/ios/browser/providers/BUILD.gn index a96fe61170f0..62a17ef83659 100644 --- a/ios/browser/providers/BUILD.gn +++ b/ios/browser/providers/BUILD.gn @@ -42,6 +42,7 @@ group("brave_providers") { "//ios/chrome/browser/providers/text_classifier:chromium_text_classifier", "//ios/chrome/browser/providers/text_zoom:chromium_text_zoom", "//ios/chrome/browser/providers/ui_utils:chromium_ui_utils", + "//ios/chrome/browser/providers/unit_conversion:chromium_unit_conversion", "//ios/chrome/browser/providers/url_rewriters:chromium_url_rewriters", "//ios/chrome/browser/providers/user_feedback:chromium_user_feedback", "//ios/chrome/browser/providers/voice_search:chromium_voice_search", diff --git a/package.json b/package.json index 1c6ef52decaa..709fb6a2c876 100644 --- a/package.json +++ b/package.json @@ -267,7 +267,7 @@ "projects": { "chrome": { "dir": "src", - "tag": "118.0.5993.117", + "tag": "119.0.6045.33", "repository": { "url": "https://github.com/brave/chromium" } diff --git a/patches/.rustfmt.toml.patch b/patches/.rustfmt.toml.patch new file mode 100644 index 000000000000..93c751f79638 --- /dev/null +++ b/patches/.rustfmt.toml.patch @@ -0,0 +1,10 @@ +diff --git a/.rustfmt.toml b/.rustfmt.toml +index 0c2edf5faf0597654b5a806b4d6cf7e8efb8639e..74053342b622d657c06669b5922d1d684eab7f39 100644 +--- a/.rustfmt.toml ++++ b/.rustfmt.toml +@@ -22,4 +22,5 @@ use_small_heuristics = "Max" + # Third party code is formatted upstream. + ignore = [ + "third_party/rust/**/crate", ++ "brave/third_party/rust/**/crate", + ] diff --git a/patches/base-BUILD.gn.patch b/patches/base-BUILD.gn.patch index 406619d3822c..2b5f6f60818a 100644 --- a/patches/base-BUILD.gn.patch +++ b/patches/base-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn -index 82cb596dcbb369cf67addf856dfe8c0789449e78..e6be16420eb0ecac0158072065cac54be619f4d8 100644 +index 55479f4187323ad0f26dbbda555c0ff3093cc8d5..3ce31b4526993c440c3bee3766e8350d1cada5e4 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -4422,6 +4422,7 @@ if (is_android) { +@@ -4461,6 +4461,7 @@ if (is_android) { "android/java/src/org/chromium/base/task/ThreadPoolTaskExecutor.java", "android/java/src/org/chromium/base/task/UiThreadTaskExecutor.java", ] @@ -10,3 +10,11 @@ index 82cb596dcbb369cf67addf856dfe8c0789449e78..e6be16420eb0ecac0158072065cac54b if (use_clang_profiling) { sources += [ +@@ -4500,6 +4501,7 @@ if (is_android) { + "android/java/src/org/chromium/base/shared_preferences/SharedPreferencesManager.java", + "android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java", + ] ++ sources += brave_base_shared_preferences_java_sources + } + + android_aidl("process_launcher_aidl") { diff --git a/patches/base-test-launcher-test_results_tracker.cc.patch b/patches/base-test-launcher-test_results_tracker.cc.patch index 93c3e24af830..92df2150fe83 100644 --- a/patches/base-test-launcher-test_results_tracker.cc.patch +++ b/patches/base-test-launcher-test_results_tracker.cc.patch @@ -1,8 +1,8 @@ diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc -index 63a0ac10b98e68fb32547edcd70e635d1dd48e08..7b182a3517009e7a037f44294cba860bd18de040 100644 +index 6306371c88f3a572f0355e8c68c7aacad1d707ad..8054573c12df37180034f4286c5d497d0661c7bd 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc -@@ -151,6 +151,7 @@ TestResultsTracker::~TestResultsTracker() { +@@ -144,6 +144,7 @@ TestResultsTracker::~TestResultsTracker() { : ""), result.GetTestCaseName().c_str()); if (result.status != TestResult::TEST_SUCCESS) { diff --git a/patches/base-threading-thread_restrictions.h.patch b/patches/base-threading-thread_restrictions.h.patch index c8f28a5cec3b..519ef647008c 100644 --- a/patches/base-threading-thread_restrictions.h.patch +++ b/patches/base-threading-thread_restrictions.h.patch @@ -1,8 +1,8 @@ diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h -index 61ef504585b1347799be57205f1f7f87d01f5aec..96904b027f1f561236051d4da61f4fe662d8c67c 100644 +index b0bd783057a77a6752729105c5ca9d12f5b14ab0..21e2ecab20f51456b6b43e92e472bb6946dfb0a2 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h -@@ -710,6 +710,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBaseSyncPrimitives { +@@ -711,6 +711,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBaseSyncPrimitives { ScopedAllowBaseSyncPrimitives& operator=( const ScopedAllowBaseSyncPrimitives&) = delete; diff --git a/patches/base-trace_event-builtin_categories.h.patch b/patches/base-trace_event-builtin_categories.h.patch index defd8c55784d..232a1305a4d4 100644 --- a/patches/base-trace_event-builtin_categories.h.patch +++ b/patches/base-trace_event-builtin_categories.h.patch @@ -1,8 +1,8 @@ diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index 292e5ce4922b37a642233a70672d777f5ec6143a..d2a9e629a8b2d660560f85afc63abd89874c4ade 100644 +index 2f9a9813f863caa8f444bbcf64806826f5a8febb..13710d4612c9f6038ceae4b797643073cfdf41d1 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h -@@ -191,6 +191,7 @@ +@@ -192,6 +192,7 @@ X("webrtc") \ X("webrtc_stats") \ X("xr") \ diff --git a/patches/build-android-gyp-dex.py.patch b/patches/build-android-gyp-dex.py.patch index 71f02733eb2f..04906fe7ef69 100644 --- a/patches/build-android-gyp-dex.py.patch +++ b/patches/build-android-gyp-dex.py.patch @@ -1,5 +1,5 @@ diff --git a/build/android/gyp/dex.py b/build/android/gyp/dex.py -index 221b3fd50c7d02e56f337cacb7174e004ce15d7f..50db6b75db8c8bcfae75137fce46b72c1797f4bc 100755 +index ae87291066f3f9782ab087993ab130d70105ffa2..5a629f85f05a6fe2e4268b9a7c54c5b2782a5b74 100755 --- a/build/android/gyp/dex.py +++ b/build/android/gyp/dex.py @@ -30,6 +30,7 @@ DEFAULT_IGNORE_WARNINGS = ( diff --git a/patches/build-android-gyp-proguard.py.patch b/patches/build-android-gyp-proguard.py.patch index 66e4c71b98f2..df90f9d08309 100644 --- a/patches/build-android-gyp-proguard.py.patch +++ b/patches/build-android-gyp-proguard.py.patch @@ -1,8 +1,8 @@ diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py -index 89a1b2dd3dfc6a58c1c350587d76395028b21b32..601ee249ae18d2e38b5427aa895f1a89517ed1ba 100755 +index 153352c77d809dc8ba6528f7612d4c322043f0cc..f8145d2bc7a1e02b96fdc76aa4f5eacc730be084 100755 --- a/build/android/gyp/proguard.py +++ b/build/android/gyp/proguard.py -@@ -329,6 +329,7 @@ def _OptimizeWithR8(options, config_paths, libraries, dynamic_config_data): +@@ -331,6 +331,7 @@ def _OptimizeWithR8(options, config_paths, libraries, dynamic_config_data): '--pg-map-output', tmp_mapping_path, ] diff --git a/patches/build-config-android-BUILD.gn.patch b/patches/build-config-android-BUILD.gn.patch index 2297918c9053..ff9e80ccec60 100644 --- a/patches/build-config-android-BUILD.gn.patch +++ b/patches/build-config-android-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn -index e7c18c068d4e5d401e4128d7f2384bb06e506a30..5f26aed99647932158b4a25a46ae5b03fbccb633 100644 +index 9e481132f8f7dcb7be0c10821ac9a0dbec595010..592b0aff58ccb5c4ae126a1c0f00561be0908810 100644 --- a/build/config/android/BUILD.gn +++ b/build/config/android/BUILD.gn @@ -39,6 +39,7 @@ config("compiler") { diff --git a/patches/build-config-android-config.gni.patch b/patches/build-config-android-config.gni.patch index 12ad9d947190..1509d44f6bf6 100644 --- a/patches/build-config-android-config.gni.patch +++ b/patches/build-config-android-config.gni.patch @@ -1,8 +1,8 @@ diff --git a/build/config/android/config.gni b/build/config/android/config.gni -index d8d9a6b8de8788c4dad03b6bdb0ca33c8348fd02..686d5361d3b63ea7034c1d16b60c0e96a26e0269 100644 +index 0ad9fc4df71bfa2bd9ff8f45514e8fefb01267b0..1146b3be1186aab3464c6d1474dd6ed1019acd55 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni -@@ -22,6 +22,7 @@ declare_args() { +@@ -25,6 +25,7 @@ robolectric_toolchain = "//build/toolchain/android:robolectric_$host_cpu" # toolchain, this GNI file may be read and processed from within Chrome OS # toolchains. Checking |is_android| here would therefore be too restrictive. if (is_android || is_chromeos) { diff --git a/patches/build-config-android-internal_rules.gni.patch b/patches/build-config-android-internal_rules.gni.patch index 6345c66cf2ae..7ec2c699df7d 100644 --- a/patches/build-config-android-internal_rules.gni.patch +++ b/patches/build-config-android-internal_rules.gni.patch @@ -1,8 +1,8 @@ diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni -index d6bcf850168e853cdf70d16362c282256b693868..164c20ff23f2cefafa9e8a91ad1797f30968add1 100644 +index afbbcf781c23a3a857233b529e908282a3cb5a02..ebeebd623352691d434e2834257335fdb7075de0 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni -@@ -4070,6 +4070,7 @@ if (enable_java_templates) { +@@ -4010,6 +4010,7 @@ if (enable_java_templates) { } else { not_needed(invoker, [ "missing_classes_allowlist" ]) } diff --git a/patches/build-config-android-rules.gni.patch b/patches/build-config-android-rules.gni.patch index 0e1d91b8ed80..9efa23955223 100644 --- a/patches/build-config-android-rules.gni.patch +++ b/patches/build-config-android-rules.gni.patch @@ -1,8 +1,8 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni -index 9fd501ff10137a903e87213b9ed29ec975420e1e..c68234ab0609deb949614dbf1c3cb0d08e69d00d 100644 +index 4b2024518f1fc9214d0c893ead69c2d59909388c..777d597466ef34aef99ba76cccf6e4e7e648fd8c 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni -@@ -285,6 +285,7 @@ if (enable_java_templates && is_android) { +@@ -211,6 +211,7 @@ if (enable_java_templates && is_android) { # ] # } template("java_cpp_enum") { @@ -10,7 +10,7 @@ index 9fd501ff10137a903e87213b9ed29ec975420e1e..c68234ab0609deb949614dbf1c3cb0d0 action_with_pydeps(target_name) { forward_variables_from(invoker, TESTONLY_AND_VISIBILITY + [ "sources" ]) -@@ -460,6 +461,7 @@ if (enable_java_templates && is_android) { +@@ -386,6 +387,7 @@ if (enable_java_templates && is_android) { # output = "$target_gen_dir/AndroidManifest.xml" # } template("jinja_template") { diff --git a/patches/build-rust-cargo_crate.gni.patch b/patches/build-rust-cargo_crate.gni.patch index d8f45fe7350f..fabba839c06a 100644 --- a/patches/build-rust-cargo_crate.gni.patch +++ b/patches/build-rust-cargo_crate.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/rust/cargo_crate.gni b/build/rust/cargo_crate.gni -index 427fcf69da0b5b15f972b58e3988c7d103bae80d..12cfea27becb565b28ba667f1efb326c2754de68 100644 +index 7eb557d204d9d52faa7bc8b5651a81ffbdd47b34..f237114e8024216cd482e11d7eee7e2d500522d9 100644 --- a/build/rust/cargo_crate.gni +++ b/build/rust/cargo_crate.gni @@ -153,6 +153,7 @@ template("cargo_crate") { diff --git a/patches/build-util-android_chrome_version.py.patch b/patches/build-util-android_chrome_version.py.patch index 9634807b9b20..37fc952e7ad9 100644 --- a/patches/build-util-android_chrome_version.py.patch +++ b/patches/build-util-android_chrome_version.py.patch @@ -1,8 +1,8 @@ diff --git a/build/util/android_chrome_version.py b/build/util/android_chrome_version.py -index 16cf8d04033041608f09aca89610b644c30ab916..8bc041563e4bfd105a34a69aa83e3808f634b4c5 100755 +index ebf7e0b307a942c575d39336a69c84a332082d43..95d02f8ca1550f030bbdf8dd25af3f799cb044d7 100755 --- a/build/util/android_chrome_version.py +++ b/build/util/android_chrome_version.py -@@ -200,6 +200,7 @@ def _GetAbisToDigitMask(build_number, patch_number): +@@ -206,6 +206,7 @@ def _GetAbisToDigitMask(build_number, patch_number): mapped to version code suffix. """ # Scheme change was made directly to M113 and M114 branches. @@ -10,7 +10,7 @@ index 16cf8d04033041608f09aca89610b644c30ab916..8bc041563e4bfd105a34a69aa83e3808 use_new_scheme = (build_number >= 5750 or (build_number == 5672 and patch_number >= 176) or (build_number == 5735 and patch_number >= 53)) -@@ -333,7 +334,7 @@ def GenerateVersionCodes(version_values, arch, is_next_build): +@@ -339,7 +340,7 @@ def GenerateVersionCodes(version_values, arch, is_next_build): build_number = int(version_values['BUILD']) patch_number = int(version_values['PATCH']) diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 6d37c1826998..d9fcfe74c10f 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028987b3699 100644 +index 78e717afce47c78d502b43d0189fa0c13d118b9b..58c1d080713d9f64e62d1eb8e61c7b94e5b470f0 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -198,6 +198,7 @@ if (!is_android && !is_mac) { @@ -32,16 +32,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 if (enable_updater) { deps += [ ":chromium_updater_privileged_helper" ] -@@ -603,7 +606,7 @@ if (is_win) { - if (is_chrome_branded) { - _strings_file = "google_chrome_strings" - } else { -- _strings_file = "chromium_strings" -+ _strings_file = "${branding_path_product}_strings" - } - - inputs += [ "$root_gen_dir/chrome/${_strings_file}_${locale}.pak" ] -@@ -688,6 +691,7 @@ if (is_win) { +@@ -684,6 +687,7 @@ if (is_win) { # this dependency directly copies the file into the framework's # resources directory. public_deps += [ ":chrome_framework_widevine_signature" ] @@ -49,7 +40,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 } } -@@ -731,9 +735,11 @@ if (is_win) { +@@ -727,9 +731,11 @@ if (is_win) { "--scm=0", ] } @@ -61,7 +52,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 if (is_chrome_branded && include_branded_entitlements) { # These entitlements are bound to the official Google Chrome signing # certificate and will not necessarily work in any other build. -@@ -758,6 +764,7 @@ if (is_win) { +@@ -754,6 +760,7 @@ if (is_win) { info_plist_target = invoker.info_plist_target } else { info_plist_target = ":chrome_helper_plist" @@ -69,7 +60,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 } extra_substitutions = [ -@@ -936,6 +943,7 @@ if (is_win) { +@@ -932,6 +939,7 @@ if (is_win) { sources += [ "//third_party/updater/chrome_mac_universal_prod/${updater_product_full_name}.app" ] } else { sources += [ "$root_out_dir/${updater_product_full_name}.app" ] @@ -77,7 +68,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 public_deps += [ "//chrome/updater/mac:browser_install_script", -@@ -1272,6 +1280,7 @@ if (is_win) { +@@ -1268,6 +1276,7 @@ if (is_win) { "-current_version", chrome_dylib_version, ] @@ -85,7 +76,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 if (!is_component_build) { # Specify a sensible install_name for static builds. The library is -@@ -1452,6 +1461,7 @@ if (is_win) { +@@ -1448,6 +1457,7 @@ if (is_win) { group("dependencies") { public_deps = [ @@ -93,7 +84,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/browser", -@@ -1518,7 +1528,7 @@ group("dependencies") { +@@ -1514,7 +1524,7 @@ group("dependencies") { if (is_win) { process_version_rc_template("chrome_exe_version") { @@ -102,7 +93,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1572,6 +1582,7 @@ group("resources") { +@@ -1568,6 +1578,7 @@ group("resources") { "//chrome/browser:resources", "//chrome/common:resources", "//chrome/renderer:resources", @@ -110,7 +101,7 @@ index bc54ace77cade8c2e2439af6d0c18984cfdaf5c6..a63dd1fc5e762fb29f571d0123d51028 ] } -@@ -1625,6 +1636,7 @@ if (!is_android) { +@@ -1621,6 +1632,7 @@ if (!is_android) { if (enable_resource_allowlist_generation) { repack_allowlist = _chrome_resource_allowlist deps = [ ":resource_allowlist" ] diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch index 7c5f1825bc18..f98e280341c7 100644 --- a/patches/chrome-VERSION.patch +++ b/patches/chrome-VERSION.patch @@ -1,12 +1,12 @@ diff --git a/chrome/VERSION b/chrome/VERSION -index db2f010661c495572125bd262c2a7a79909c2ce4..381f6459e2f321dadb9e130332abee36145400b9 100644 +index e14dc825e4abf63c321d0e9356069c4070019995..005e288ce980e9e9c5b91c047f2dba5eb9bc88a2 100644 --- a/chrome/VERSION +++ b/chrome/VERSION @@ -1,4 +1,4 @@ - MAJOR=118 + MAJOR=119 -MINOR=0 --BUILD=5993 --PATCH=117 +-BUILD=6045 +-PATCH=33 +MINOR=1 +BUILD=60 +PATCH=102 diff --git a/patches/chrome-android-BUILD.gn.patch b/patches/chrome-android-BUILD.gn.patch index 6568ac9e8f9a..55851776990d 100644 --- a/patches/chrome-android-BUILD.gn.patch +++ b/patches/chrome-android-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd759e0c9db 100644 +index f56c41b506f45122f8b86f13dcbed4f02e7dab19..8010216aaf31dfc0f17826d1f2c8d2ba6f07d6ad 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -169,6 +169,7 @@ if (current_toolchain == default_toolchain) { @@ -10,7 +10,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 } android_resources("chrome_app_java_resources") { -@@ -237,6 +238,7 @@ if (current_toolchain == default_toolchain) { +@@ -236,6 +237,7 @@ if (current_toolchain == default_toolchain) { "//third_party/androidx:androidx_gridlayout_gridlayout_java", "//third_party/androidx:androidx_preference_preference_java", ] @@ -18,7 +18,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 } android_library("app_hooks_java") { -@@ -654,6 +656,7 @@ if (current_toolchain == default_toolchain) { +@@ -662,6 +664,7 @@ if (current_toolchain == default_toolchain) { ] deps += feed_deps @@ -26,7 +26,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 srcjar_deps = [ ":chrome_android_java_enums_srcjar", -@@ -672,6 +675,7 @@ if (current_toolchain == default_toolchain) { +@@ -680,6 +683,7 @@ if (current_toolchain == default_toolchain) { "//components/supervised_user/core/browser:supervised_user_url_filter_enum_javagen", "//net:effective_connection_type_java", ] @@ -34,7 +34,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 # From java_sources.gni. sources = chrome_java_sources + [ app_hooks_impl ] -@@ -806,6 +810,7 @@ if (current_toolchain == default_toolchain) { +@@ -817,6 +821,7 @@ if (current_toolchain == default_toolchain) { "//components/messages/android/internal:java", "//components/segmentation_platform/internal:internal_java", ] @@ -42,7 +42,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 } action_with_pydeps("chrome_android_java_google_api_keys_srcjar") { -@@ -2121,6 +2126,7 @@ if (current_toolchain == default_toolchain) { +@@ -2152,6 +2157,7 @@ if (current_toolchain == default_toolchain) { "java/res_chromium_base/mipmap-xxxhdpi/layered_app_icon_background.png", "java/res_chromium_base/values/channel_constants.xml", ] @@ -50,15 +50,15 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 # Dep needed to ensure override works properly. deps = [ ":chrome_base_module_resources" ] -@@ -2340,6 +2346,7 @@ if (current_toolchain == default_toolchain) { +@@ -2364,6 +2370,7 @@ if (current_toolchain == default_toolchain) { ":${_variant}_locale_pak_assets", ":${_variant}_paks", ] + deps += [ "//brave:brave_pak_assets" ] if (_is_monochrome) { deps += [ "//android_webview:locale_pak_assets" ] - if (webview_includes_weblayer && !_is_bundle_module) { -@@ -2612,6 +2619,7 @@ if (current_toolchain == default_toolchain) { + } +@@ -2628,6 +2635,7 @@ if (current_toolchain == default_toolchain) { "//components/payments/content/android:service_java", "//third_party/androidx:androidx_browser_browser_java", ] @@ -66,7 +66,7 @@ index e89e2f7d23cdf9552e15026fd805580c99d673e6..b4099f14e9467237e3ceed0569579cd7 # More deps for DFMs. if (dfmify_dev_ui) { -@@ -3550,6 +3558,7 @@ generate_jni("chrome_jni_headers") { +@@ -3630,6 +3638,7 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java", "java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java", ] diff --git a/patches/chrome-android-chrome_java_sources.gni.patch b/patches/chrome-android-chrome_java_sources.gni.patch index b4e5a273dbe4..e7745af7528d 100644 --- a/patches/chrome-android-chrome_java_sources.gni.patch +++ b/patches/chrome-android-chrome_java_sources.gni.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni -index f4d274b24e1120bf7e8a4bab31ec7628f24610df..556e36df338efe0927bfe07b27eb47324e6b59a9 100644 +index ac72edb1e282844cd3cc0ba784d45ba578be8053..1493dd0999ad3f34265c1a95de5aba2b48db91bf 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -1211,3 +1211,4 @@ chrome_java_sources = [ +@@ -1223,3 +1223,4 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorUSBActivity.java", "java/src/org/chromium/chrome/browser/webshare/ShareServiceImplementationFactory.java", ] diff --git a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch index 1bb76d69c34f..d75271d1dc88 100644 --- a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch +++ b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni -index ba3b2534130b96d44170a36567187688e86acc9a..2c514ce2d64b139476dc310960df94c57638a994 100644 +index 13ab7ec536d429e3444ab640c790b51af183be33..e9dbce7b59158cfd76a62bae84f8f5c4a118fb19 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni -@@ -314,6 +314,7 @@ template("chrome_common_apk_or_module_tmpl") { +@@ -309,6 +309,7 @@ template("chrome_common_apk_or_module_tmpl") { "*ic_file_download_white*", # Bottom edge seems misaligned. "*ic_lock.*", # Bottom edge seems misaligned. ] @@ -10,7 +10,7 @@ index ba3b2534130b96d44170a36567187688e86acc9a..2c514ce2d64b139476dc310960df94c5 # Most of these, with the exception of resource_exclusion_exceptions, # are currently duplicated in system_webview_apk_tmpl.gni. -@@ -338,6 +339,7 @@ template("chrome_common_apk_or_module_tmpl") { +@@ -333,6 +334,7 @@ template("chrome_common_apk_or_module_tmpl") { proguard_enabled = true proguard_configs = [ "//chrome/android/proguard/main.flags" ] @@ -18,7 +18,7 @@ index ba3b2534130b96d44170a36567187688e86acc9a..2c514ce2d64b139476dc310960df94c5 if (_is_monochrome) { proguard_configs += [ "//android_webview/nonembedded/java/proguard.flags" ] -@@ -749,6 +751,7 @@ template("chrome_common_apk_or_module_tmpl") { +@@ -744,6 +746,7 @@ template("chrome_common_apk_or_module_tmpl") { "version_code", "version_name", ]) @@ -26,7 +26,7 @@ index ba3b2534130b96d44170a36567187688e86acc9a..2c514ce2d64b139476dc310960df94c5 } } -@@ -777,6 +780,7 @@ template("monochrome_public_common_apk_or_module_tmpl") { +@@ -772,6 +775,7 @@ template("monochrome_public_common_apk_or_module_tmpl") { if (!defined(is_monochrome)) { is_trichrome = true } diff --git a/patches/chrome-android-expectations-lint-suppressions.xml.patch b/patches/chrome-android-expectations-lint-suppressions.xml.patch index 7264888b2b90..9f569374ecc3 100644 --- a/patches/chrome-android-expectations-lint-suppressions.xml.patch +++ b/patches/chrome-android-expectations-lint-suppressions.xml.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/expectations/lint-suppressions.xml b/chrome/android/expectations/lint-suppressions.xml -index 83f7680cdee0a0cf5dab220ed0047866e4699137..076fa1f5865c005038ef018b9c5a952b6a290205 100644 +index 75e5870bd2a12cf4adfce3e103cc8d3508c492d1..cff1d9b79a07e79d767ee4e3a8d5f9e8e6fbe796 100644 --- a/chrome/android/expectations/lint-suppressions.xml +++ b/chrome/android/expectations/lint-suppressions.xml @@ -268,4 +268,5 @@ https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md diff --git a/patches/chrome-android-features-tab_ui-BUILD.gn.patch b/patches/chrome-android-features-tab_ui-BUILD.gn.patch index 4fbe9a7fd645..5911579c6cae 100644 --- a/patches/chrome-android-features-tab_ui-BUILD.gn.patch +++ b/patches/chrome-android-features-tab_ui-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/features/tab_ui/BUILD.gn b/chrome/android/features/tab_ui/BUILD.gn -index c73c8adfa810ca56b5854d958df1eab89e95cf9a..15269f48bb9294fd19ef122f4acd868beea42a19 100644 +index 3ac20275302323bef9e31ceaf79617956d12d33d..d56f4393d2c30b23d810fe898cb49758967ada1a 100644 --- a/chrome/android/features/tab_ui/BUILD.gn +++ b/chrome/android/features/tab_ui/BUILD.gn -@@ -85,6 +85,7 @@ android_resources("java_resources") { +@@ -88,6 +88,7 @@ android_resources("java_resources") { "java/res/values/ids.xml", "java/res/values/styles.xml", ] diff --git a/patches/chrome-android-java-AndroidManifest.xml.patch b/patches/chrome-android-java-AndroidManifest.xml.patch index 478a135ea09f..84e3480fa03a 100644 --- a/patches/chrome-android-java-AndroidManifest.xml.patch +++ b/patches/chrome-android-java-AndroidManifest.xml.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml -index e4c9f334a89237c467f5e7485d97c361bd0a4b9a..f4cef65c0ce1990112602350da22d3c61a87c1dc 100644 +index fba6543bde641c1e29cbac01914000c75495cf2b..da9879111318168f381ffc3727b73a357aa4e15b 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml @@ -28,6 +28,7 @@ by a child template that "extends" this file. @@ -20,9 +20,9 @@ index e4c9f334a89237c467f5e7485d97c361bd0a4b9a..f4cef65c0ce1990112602350da22d3c6 -@@ -74,11 +77,17 @@ by a child template that "extends" this file. - +@@ -75,11 +78,17 @@ by a child template that "extends" this file. + + @@ -35,14 +35,15 @@ index d0cfac2fc91c94769a55bfd4f9596d4cc928c185..4aa4a8c0ef66ba3a1f8dbf63ef7b1302 - +@@ -67,6 +70,7 @@ + on-click="onPageContentRowClick_"> + + + @@ -50,7 +51,7 @@ index d0cfac2fc91c94769a55bfd4f9596d4cc928c185..4aa4a8c0ef66ba3a1f8dbf63ef7b1302 diff --git a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.ts.patch b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.ts.patch index 360885070a24..738c4f36deea 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.ts.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.ts b/chrome/browser/resources/settings/privacy_page/personalization_options.ts -index 4fd564ebb19be9fdb8f545a21e5fe1492313dc0c..d9572759a91d65a09a93dd43f804c1d01b8f6844 100644 +index 78dea0520e47faece3dc7a50372cbe75057dfd16..928ea30c37f46c09465c4129d93aa2909a2442ca 100644 --- a/chrome/browser/resources/settings/privacy_page/personalization_options.ts +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.ts -@@ -71,7 +71,7 @@ export class SettingsPersonalizationOptionsElement extends +@@ -80,7 +80,7 @@ export class SettingsPersonalizationOptionsElement extends syncStatus: Object, @@ -11,8 +11,8 @@ index 4fd564ebb19be9fdb8f545a21e5fe1492313dc0c..d9572759a91d65a09a93dd43f804c1d0 // TODO(dbeam): make a virtual.* pref namespace and set/get this normally // (but handled differently in C++). metricsReportingPref_: { -@@ -106,7 +106,7 @@ export class SettingsPersonalizationOptionsElement extends - pageVisibility: PrivacyPageVisibility; +@@ -123,7 +123,7 @@ export class SettingsPersonalizationOptionsElement extends + focusConfig: FocusConfig; syncStatus: SyncStatus; - // @@ -20,7 +20,7 @@ index 4fd564ebb19be9fdb8f545a21e5fe1492313dc0c..d9572759a91d65a09a93dd43f804c1d0 private metricsReportingPref_: chrome.settingsPrivate.PrefObject; private showRestart_: boolean; // -@@ -139,7 +139,7 @@ export class SettingsPersonalizationOptionsElement extends +@@ -173,7 +173,7 @@ export class SettingsPersonalizationOptionsElement extends override ready() { super.ready(); @@ -29,7 +29,7 @@ index 4fd564ebb19be9fdb8f545a21e5fe1492313dc0c..d9572759a91d65a09a93dd43f804c1d0 const setMetricsReportingPref = (metricsReporting: MetricsReporting) => this.setMetricsReportingPref_(metricsReporting); this.addWebUiListener('metrics-reporting-change', setMetricsReportingPref); -@@ -173,7 +173,7 @@ export class SettingsPersonalizationOptionsElement extends +@@ -207,7 +207,7 @@ export class SettingsPersonalizationOptionsElement extends } // diff --git a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch index fda03fb24fc0..7d8972d8d61b 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html -index 9072306bbf4fdba5a0a0aa37b4ccebee0c1ff33e..f028873838d4ba5010c35306b49bd4af11fed902 100644 +index 3fa3fca9d9270fa79870d0eaffff5f44df1eedae..aaa97536fd90c545ddc1a1fd025fa248f6de3a07 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html -@@ -34,6 +34,7 @@ +@@ -36,6 +36,7 @@
@@ -10,7 +10,7 @@ index 9072306bbf4fdba5a0a0aa37b4ccebee0c1ff33e..f028873838d4ba5010c35306b49bd4af @@ -18,7 +18,7 @@ index 9072306bbf4fdba5a0a0aa37b4ccebee0c1ff33e..f028873838d4ba5010c35306b49bd4af diff --git a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.ts.patch b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.ts.patch index ec6d533635f0..c217c21a630f 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.ts.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/chrome/browser/resources/settings/privacy_page/privacy_page.ts -index f063fa13689e802d0dfc642dbc601b0d74cc11c3..116326c6e4304cadac3bd027a76e0d600ca4300f 100644 +index 3c73c734435a0d2f800411e0c7e1fe47ee85e7f0..02b6491ea10b44669ca5cc8a6ee79cd62bda9260 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts -@@ -18,6 +18,7 @@ import '../settings_page/settings_animated_pages.js'; +@@ -20,6 +20,7 @@ import '../settings_page/settings_animated_pages.js'; import '../settings_page/settings_subpage.js'; import '../settings_shared.css.js'; import '../site_settings/settings_category_default_radio_group.js'; diff --git a/patches/chrome-browser-resources-settings-route.ts.patch b/patches/chrome-browser-resources-settings-route.ts.patch index 838c1c5fa90d..b8a8b724e20a 100644 --- a/patches/chrome-browser-resources-settings-route.ts.patch +++ b/patches/chrome-browser-resources-settings-route.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts -index 82631548e92c7b11cb0c1bfb673a809b11f3de00..06bb35a2710b0b070a3f910acc882ec231fbcaeb 100644 +index 26619e82e4a4d3162958184baba262c823243b3e..0057c9f5b540dbd59df0d34c01c84c7379083196 100644 --- a/chrome/browser/resources/settings/route.ts +++ b/chrome/browser/resources/settings/route.ts @@ -8,6 +8,7 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; @@ -10,7 +10,7 @@ index 82631548e92c7b11cb0c1bfb673a809b11f3de00..06bb35a2710b0b070a3f910acc882ec2 /** * Add all of the child routes that originate from the privacy route, * regardless of whether the privacy section under basic or advanced. -@@ -283,6 +284,7 @@ function createBrowserSettingsRoutes(): SettingsRoutes { +@@ -287,6 +288,7 @@ function createBrowserSettingsRoutes(): SettingsRoutes { } // } diff --git a/patches/chrome-browser-resources-settings-router.ts.patch b/patches/chrome-browser-resources-settings-router.ts.patch index 23e1df1af082..9b389da43945 100644 --- a/patches/chrome-browser-resources-settings-router.ts.patch +++ b/patches/chrome-browser-resources-settings-router.ts.patch @@ -1,10 +1,10 @@ diff --git a/chrome/browser/resources/settings/router.ts b/chrome/browser/resources/settings/router.ts -index 490064371b6b57236724ec0919a4d549a5ab2c9e..965028df2b0ea8cd675214371ae88ddb1a713f90 100644 +index 24bf153309625e5d05a1d961529431a92dba32c1..87438d008ab2357f8ee66287024d4a97a9b872e0 100644 --- a/chrome/browser/resources/settings/router.ts +++ b/chrome/browser/resources/settings/router.ts -@@ -102,6 +102,7 @@ export interface SettingsRoutes { - SYNC_ADVANCED: Route; +@@ -104,6 +104,7 @@ export interface SettingsRoutes { SYSTEM: Route; + TRACKING_PROTECTION: Route; TRIGGERED_RESET_DIALOG: Route; + GET_STARTED: Route; SHIELDS: Route; SOCIAL_BLOCKING: Route; REWARDS: Route; EXTENSIONS: Route; EXTENSIONS_V2: Route; BRAVE_SYNC: Route; BRAVE_SYNC_SETUP: Route; BRAVE_IPFS: Route; BRAVE_WALLET: Route; BRAVE_WEB3: Route; BRAVE_HELP_TIPS: Route; BRAVE_NEW_TAB: Route; THEMES: Route; BRAVE_SITE_SETTINGS_COOKIES_DETAILS: Route; } diff --git a/patches/chrome-browser-resources-settings-settings.ts.patch b/patches/chrome-browser-resources-settings-settings.ts.patch index dd617671cbc3..ab29a0e90015 100644 --- a/patches/chrome-browser-resources-settings-settings.ts.patch +++ b/patches/chrome-browser-resources-settings-settings.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/settings.ts b/chrome/browser/resources/settings/settings.ts -index d8783de1b83335f8dd295e1f53d3c4752a531a5c..ecb90e239e9727a2c0c3ca8585c4ebfe0ea2ea03 100644 +index 62243ae56beb6bf8218c3e5b3a0c5912d0c1de8e..a7da589dd6ad9b4f82dda1e1fe956cf5b00888e3 100644 --- a/chrome/browser/resources/settings/settings.ts +++ b/chrome/browser/resources/settings/settings.ts @@ -2,6 +2,7 @@ diff --git a/patches/chrome-browser-resources-settings-site_settings-constants.ts.patch b/patches/chrome-browser-resources-settings-site_settings-constants.ts.patch index f985b4276a2b..ce5fdbdae300 100644 --- a/patches/chrome-browser-resources-settings-site_settings-constants.ts.patch +++ b/patches/chrome-browser-resources-settings-site_settings-constants.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts -index 81acd993d10b96b5edb57d566197967696973d4f..c923b663a75bcd505a9d56e4b0bd3a5cfe283a2f 100644 +index 83cac6858b32189269e0ed8198d4f84d882569e6..cb03bc31f592d1ebf28e3489ec670e5a3a9b4744 100644 --- a/chrome/browser/resources/settings/site_settings/constants.ts +++ b/chrome/browser/resources/settings/site_settings/constants.ts -@@ -54,6 +54,7 @@ export enum ContentSettingsTypes { +@@ -55,6 +55,7 @@ export enum ContentSettingsTypes { // are used everywhere where ContentSettingsTypes is used in JS. PDF_DOCUMENTS = 'pdfDocuments', SITE_DATA = 'site-data', diff --git a/patches/chrome-browser-resources-settings-site_settings-settings_category_default_radio_group.ts.patch b/patches/chrome-browser-resources-settings-site_settings-settings_category_default_radio_group.ts.patch index 893af44f0dac..6abd8690fbd1 100644 --- a/patches/chrome-browser-resources-settings-site_settings-settings_category_default_radio_group.ts.patch +++ b/patches/chrome-browser-resources-settings-site_settings-settings_category_default_radio_group.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts -index 30a5a05854db15351c292ec28ba8ea422efed16f..16c3add479c09abd7f47ef6de0e0879a00097e47 100644 +index c122da8251dbd8cd8bc2191c0b58fbfae411b6ae..9be2d72371e6729e21aec6e0d2566cbd327bba82 100644 --- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts -@@ -159,6 +159,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends +@@ -160,6 +160,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends case ContentSettingsTypes.WINDOW_MANAGEMENT: // "Ask" vs "Blocked". return ContentSetting.ASK; diff --git a/patches/chrome-browser-resources-settings-site_settings_page-site_settings_page.ts.patch b/patches/chrome-browser-resources-settings-site_settings_page-site_settings_page.ts.patch index 90b4edf3b1ab..e5af4fca5323 100644 --- a/patches/chrome-browser-resources-settings-site_settings_page-site_settings_page.ts.patch +++ b/patches/chrome-browser-resources-settings-site_settings_page-site_settings_page.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts -index 6b3fcd5a1d53b56ad69aecddf96108d3c26782ee..eded10a7e6959b5ad4219601ea0a70e115fbe262 100644 +index 0d9387d95a99f82d61ac61b63413a46b30792740..959b2efd0a64e74e5b3e506f3b64cbf093aaa789 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts @@ -8,6 +8,7 @@ diff --git a/patches/chrome-browser-resources-settings_shared-privacy_page-privacy_page_browser_proxy.ts.patch b/patches/chrome-browser-resources-settings_shared-privacy_page-privacy_page_browser_proxy.ts.patch index 8cefcec6d360..88a1d3a44c07 100644 --- a/patches/chrome-browser-resources-settings_shared-privacy_page-privacy_page_browser_proxy.ts.patch +++ b/patches/chrome-browser-resources-settings_shared-privacy_page-privacy_page_browser_proxy.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings_shared/privacy_page/privacy_page_browser_proxy.ts b/chrome/browser/resources/settings_shared/privacy_page/privacy_page_browser_proxy.ts -index 2e13c777517eae71cbf8da2b4e0d0f4ac3e066bf..f9d60fb20e02f9d224e09ee85461fcc1543e6320 100644 +index 7f39d9ea5516a06a42336028d61933328c6f3191..5cdd364a038fdb332c9d8a4d5c2aa1a4df476d2c 100644 --- a/chrome/browser/resources/settings_shared/privacy_page/privacy_page_browser_proxy.ts +++ b/chrome/browser/resources/settings_shared/privacy_page/privacy_page_browser_proxy.ts @@ -54,7 +54,7 @@ export interface SecureDnsSetting { @@ -11,7 +11,7 @@ index 2e13c777517eae71cbf8da2b4e0d0f4ac3e066bf..f9d60fb20e02f9d224e09ee85461fcc1 getMetricsReporting(): Promise; setMetricsReportingEnabled(enabled: boolean): void; -@@ -92,7 +92,7 @@ export interface PrivacyPageBrowserProxy { +@@ -83,7 +83,7 @@ export interface PrivacyPageBrowserProxy { } export class PrivacyPageBrowserProxyImpl implements PrivacyPageBrowserProxy { diff --git a/patches/chrome-browser-resources-signin-profile_picker-profile_picker_main_view.ts.patch b/patches/chrome-browser-resources-signin-profile_picker-profile_picker_main_view.ts.patch index 779b7118590d..3a2a5505e626 100644 --- a/patches/chrome-browser-resources-signin-profile_picker-profile_picker_main_view.ts.patch +++ b/patches/chrome-browser-resources-signin-profile_picker-profile_picker_main_view.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts b/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts -index 55a1def4837a4ebdbc9eb9b243e1ea4d63257a0c..332b32aa1f01e4e2463e07142742be6e20ed942b 100644 +index 9b19b901a2f971890869713b8f7e9b756a05e7f2..4a0efe0cebbd938d9378c6e7fa89d923b52d4add 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts -@@ -101,6 +101,7 @@ export class ProfilePickerMainViewElement extends +@@ -104,6 +104,7 @@ export class ProfilePickerMainViewElement extends if (!isProfileCreationAllowed()) { this.$.addProfile.style.display = 'none'; } diff --git a/patches/chrome-browser-shell_integration_linux.cc.patch b/patches/chrome-browser-shell_integration_linux.cc.patch index fb430fabdc88..ec7fa960f5ad 100644 --- a/patches/chrome-browser-shell_integration_linux.cc.patch +++ b/patches/chrome-browser-shell_integration_linux.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc -index 032e9d2cf753b14512ad6683546b28e63b90a3b9..3ea42b413f26b55dc1e9852d06352850696e7de2 100644 +index 772a7785015de1e6506b811af6e0d944754a0853..e5f438b918bf5fe42d059673fbb9377ee3368fca 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -504,7 +504,7 @@ std::string GetIconName() { diff --git a/patches/chrome-browser-sync-sync_service_factory.cc.patch b/patches/chrome-browser-sync-sync_service_factory.cc.patch index d922203fe64f..6dc2eb92ee94 100644 --- a/patches/chrome-browser-sync-sync_service_factory.cc.patch +++ b/patches/chrome-browser-sync-sync_service_factory.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/sync/sync_service_factory.cc b/chrome/browser/sync/sync_service_factory.cc -index a8f5898effb1294a62ffc75adab5b189395401b3..cacfacd7bd318e9208b69e34733fc6ccbd433f0f 100644 +index f52ccec7f6846ee82388e943f0b3ca9e2bc4dc57..835187559b7f43809fa86fa1379db06bbad4d99b 100644 --- a/chrome/browser/sync/sync_service_factory.cc +++ b/chrome/browser/sync/sync_service_factory.cc -@@ -172,7 +172,7 @@ std::unique_ptr BuildSyncService( +@@ -162,7 +162,7 @@ std::unique_ptr BuildSyncService( } auto sync_service = diff --git a/patches/chrome-browser-ui-BUILD.gn.patch b/patches/chrome-browser-ui-BUILD.gn.patch index 6af68246549c..4ceaa82e5a36 100644 --- a/patches/chrome-browser-ui-BUILD.gn.patch +++ b/patches/chrome-browser-ui-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn -index 9da0c57372d3de3d47cc745602eb6f11a394ce5e..d4578bc33983b55af222e90f890c4401af26b6de 100644 +index d5bc836ec888d3bb1f8e5e6f9f03511337ff9cf2..0e88fb860df4e80673fb07c6dbdf72b0e3f55a2c 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn -@@ -698,6 +698,7 @@ static_library("ui") { +@@ -691,6 +691,7 @@ static_library("ui") { "//chrome/browser/profiling_host", "//chrome/browser/ui/webui:configs", ] @@ -10,7 +10,7 @@ index 9da0c57372d3de3d47cc745602eb6f11a394ce5e..d4578bc33983b55af222e90f890c4401 if (enable_vr && is_win) { deps += [ "//chrome/browser/vr:vr_base" ] -@@ -4346,10 +4347,13 @@ static_library("ui") { +@@ -4418,10 +4419,13 @@ static_library("ui") { ] deps += [ "//chrome/updater/app/server/win:updater_legacy_idl_idl" ] } else { diff --git a/patches/chrome-browser-ui-android-toolbar-BUILD.gn.patch b/patches/chrome-browser-ui-android-toolbar-BUILD.gn.patch index 5e6a49b372a4..2200d09e90db 100644 --- a/patches/chrome-browser-ui-android-toolbar-BUILD.gn.patch +++ b/patches/chrome-browser-ui-android-toolbar-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/android/toolbar/BUILD.gn b/chrome/browser/ui/android/toolbar/BUILD.gn -index 1562440ac47d0b6834a5ecac0c8988ae136767e7..08bba4685ffa3547e56edeebba135dfd19efeb0b 100644 +index c0f14b858e704981a9a27d553eda638cfaafc3b7..33a6eebd54bc1d304bbb1ecb37afd2c188b9401a 100644 --- a/chrome/browser/ui/android/toolbar/BUILD.gn +++ b/chrome/browser/ui/android/toolbar/BUILD.gn -@@ -116,6 +116,7 @@ android_library("java") { +@@ -117,6 +117,7 @@ android_library("java") { "java/src/org/chromium/chrome/browser/toolbar/top/ViewShiftingActionBarDelegate.java", "java/src/org/chromium/chrome/browser/toolbar/top/VisibleUrlText.java", ] diff --git a/patches/chrome-browser-ui-android-toolbar-java-res-layout-toolbar_tablet.xml.patch b/patches/chrome-browser-ui-android-toolbar-java-res-layout-toolbar_tablet.xml.patch index e207b8be4fe0..a3f1478e4a80 100644 --- a/patches/chrome-browser-ui-android-toolbar-java-res-layout-toolbar_tablet.xml.patch +++ b/patches/chrome-browser-ui-android-toolbar-java-res-layout-toolbar_tablet.xml.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml -index 6127d7e53cf5d36c7421a0535ccd9604f0d8be90..eadb81f1d0e1a8f939c5da7e142d8d62c4773d5b 100644 +index bd66b0b7f107940754944cf900393e223be5d013..dd809c0423cccf3c38bd5479e8ceab2cfbdc4707 100644 --- a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml +++ b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml @@ -66,6 +66,7 @@ found in the LICENSE file. diff --git a/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch b/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch index d64357420037..d62eaaf73d25 100644 --- a/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch +++ b/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java -index fdde4f4b600b90ba793c24018c19dc508e2d8009..dcf11139d267536a58498e98de79921ba53c0608 100644 +index 0dbe4aa666dbfd1b261891dec76cf763342f4cc1..e6eb72f3636914e2ad21ae515edbc9049d75735e 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java -@@ -405,6 +405,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC +@@ -422,6 +422,7 @@ public class ToolbarPhone extends ToolbarLayout if (mOptionalButtonCoordinator != null) { mOptionalButtonCoordinator.setBackgroundColorFilter(color); } @@ -10,7 +10,7 @@ index fdde4f4b600b90ba793c24018c19dc508e2d8009..dcf11139d267536a58498e98de79921b } private void updateModernLocationBarCorners() { -@@ -574,6 +575,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC +@@ -591,6 +592,7 @@ public class ToolbarPhone extends ToolbarLayout EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED); } } @@ -18,7 +18,7 @@ index fdde4f4b600b90ba793c24018c19dc508e2d8009..dcf11139d267536a58498e98de79921b } @Override -@@ -1025,6 +1027,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC +@@ -1049,6 +1051,7 @@ public class ToolbarPhone extends ToolbarLayout * New Tab Page. */ private void updateLocationBarLayoutForExpansionAnimation() { @@ -26,7 +26,7 @@ index fdde4f4b600b90ba793c24018c19dc508e2d8009..dcf11139d267536a58498e98de79921b TraceEvent.begin("ToolbarPhone.updateLocationBarLayoutForExpansionAnimation"); if (isInTabSwitcherMode()) return; -@@ -1366,6 +1369,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC +@@ -1392,6 +1395,7 @@ public class ToolbarPhone extends ToolbarLayout canvas.restore(); } @@ -34,7 +34,7 @@ index fdde4f4b600b90ba793c24018c19dc508e2d8009..dcf11139d267536a58498e98de79921b // Draw the tab stack button and associated text if necessary. if (mTabSwitcherAnimationTabStackDrawable != null && mToggleTabStackButton != null && mUrlExpansionFraction != 1f) { -@@ -2158,6 +2162,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC +@@ -2188,6 +2192,7 @@ public class ToolbarPhone extends ToolbarLayout } else { populateUrlClearExpansionAnimatorSet(animators); } diff --git a/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch b/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch index 2f346c16e7ee..d9201c504a0f 100644 --- a/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch +++ b/patches/chrome-browser-ui-android-toolbar-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java -index cfe3a5761e43a064c9639aec18f482b66c35fc62..c77016ae84627f3aa7b4e41119694cebf4565e70 100644 +index ba4e8490ca42b169c109a7fa6b431dbb109712db..2aac12a835cae12a102a6b80fc1e6f6c76f4227c 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java -@@ -396,10 +396,12 @@ public class ToolbarTablet +@@ -397,10 +397,12 @@ public class ToolbarTablet mOfflineDownloader.downloadPage(getContext(), getToolbarDataProvider().getTab()); RecordUserAction.record("MobileToolbarDownloadPage"); } @@ -15,7 +15,7 @@ index cfe3a5761e43a064c9639aec18f482b66c35fc62..c77016ae84627f3aa7b4e41119694ceb String description = null; Context context = getContext(); Resources resources = context.getResources(); -@@ -505,6 +507,7 @@ public class ToolbarTablet +@@ -506,6 +508,7 @@ public class ToolbarTablet mLocationBar.getTabletCoordinator().tintBackground(textBoxColor); mLocationBar.updateVisualsForState(); setToolbarHairlineColor(color); diff --git a/patches/chrome-browser-ui-browser.cc.patch b/patches/chrome-browser-ui-browser.cc.patch index ab4080037d9c..c8f425c4fa53 100644 --- a/patches/chrome-browser-ui-browser.cc.patch +++ b/patches/chrome-browser-ui-browser.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index fdb96dee050670757ed4ce247bc0a12b01005d04..b123fb2ded7a23480ad3e7c1d2a946cf34391b62 100644 +index 9ba202563436566aa63897b9e702e131b4353664..f1e2d108a6983e084c677d00817abe7e5c2a0731 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -448,6 +448,7 @@ Browser* Browser::Create(const CreateParams& params) { +@@ -452,6 +452,7 @@ Browser* Browser::Create(const CreateParams& params) { // not possible, e.g. using the wrong profile or during shutdown. The caller // should handle this; see e.g. crbug.com/1141608 and crbug.com/1261628. CHECK_EQ(CreationStatus::kOk, GetCreationStatusForProfile(params.profile)); @@ -10,7 +10,7 @@ index fdb96dee050670757ed4ce247bc0a12b01005d04..b123fb2ded7a23480ad3e7c1d2a946cf return new Browser(params); } -@@ -458,7 +459,7 @@ Browser::Browser(const CreateParams& params) +@@ -462,7 +463,7 @@ Browser::Browser(const CreateParams& params) window_(nullptr), tab_strip_model_delegate_( std::make_unique(this)), diff --git a/patches/chrome-browser-ui-browser_navigator.cc.patch b/patches/chrome-browser-ui-browser_navigator.cc.patch index bf1f376d77d2..301b58775998 100644 --- a/patches/chrome-browser-ui-browser_navigator.cc.patch +++ b/patches/chrome-browser-ui-browser_navigator.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc -index 3b7f96e505e0ba32837b83be5473562e3e120452..b4433a1fd9b008741a0ef9d6e9d75405d93a0287 100644 +index e76824b5ba371d251882050677131cf04f1c41e6..f9d32865543f2a8407a4a790034691ff7e20d099 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc -@@ -585,6 +585,7 @@ base::WeakPtr Navigate(NavigateParams* params) { +@@ -587,6 +587,7 @@ base::WeakPtr Navigate(NavigateParams* params) { // Block any navigation requests in locked fullscreen mode. return nullptr; } @@ -10,7 +10,7 @@ index 3b7f96e505e0ba32837b83be5473562e3e120452..b4433a1fd9b008741a0ef9d6e9d75405 // Open System Apps in their standalone window if necessary. // TODO(crbug.com/1096345): Remove this code after we integrate with intent -@@ -922,6 +923,7 @@ bool IsHostAllowedInIncognito(const GURL& url) { +@@ -933,6 +934,7 @@ bool IsHostAllowedInIncognito(const GURL& url) { base::StringPiece host = url.host_piece(); if (scheme != content::kChromeUIScheme) return true; diff --git a/patches/chrome-browser-ui-browser_ui_prefs.cc.patch b/patches/chrome-browser-ui-browser_ui_prefs.cc.patch index 25e926d4cc4f..64925edbbcb8 100644 --- a/patches/chrome-browser-ui-browser_ui_prefs.cc.patch +++ b/patches/chrome-browser-ui-browser_ui_prefs.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc -index 1d312986c62def1b09ca502e02d755b56c6cdcb0..8e9b4707b730fb1f1bd060bb109bfba2b59488c5 100644 +index 83d3c4331fcdab2bdf62530423aa7517aef9aafb..b0658d21dd7f08a21460c485338a8f19e9b850a6 100644 --- a/chrome/browser/ui/browser_ui_prefs.cc +++ b/chrome/browser/ui/browser_ui_prefs.cc @@ -83,7 +83,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { diff --git a/patches/chrome-browser-ui-chrome_pages.cc.patch b/patches/chrome-browser-ui-chrome_pages.cc.patch index e95e94b420ba..7e7dbf1419ae 100644 --- a/patches/chrome-browser-ui-chrome_pages.cc.patch +++ b/patches/chrome-browser-ui-chrome_pages.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc -index 69bf9d2f105c6f4d0ad8d2be2ac60b3640fb53b9..fe5dd5f83ce2be38eafaa26e176122c56cee9acc 100644 +index 1995981bb0c9b2a7de30cf38300b2d79db347762..dc62f2380485a9fe7195a47d5f6c0539f6e565c8 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc -@@ -356,7 +356,7 @@ void ShowSlow(Browser* browser) { +@@ -357,7 +357,7 @@ void ShowSlow(Browser* browser) { #endif } diff --git a/patches/chrome-browser-ui-cocoa-main_menu_builder.mm.patch b/patches/chrome-browser-ui-cocoa-main_menu_builder.mm.patch index 6056d203ff28..5b6d1bcf078b 100644 --- a/patches/chrome-browser-ui-cocoa-main_menu_builder.mm.patch +++ b/patches/chrome-browser-ui-cocoa-main_menu_builder.mm.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/cocoa/main_menu_builder.mm b/chrome/browser/ui/cocoa/main_menu_builder.mm -index bcf4697bb530e67efc0482c01d5c0c5c0a3ce1f7..a531b87b66842de087bbfa6e8613ca4a27f7f9c5 100644 +index 24efb3e8abbbc0fd8ecd2b7a6088d362afb3d40b..01078b4ef0e870fb629fadc97b4dfd17e2631b02 100644 --- a/chrome/browser/ui/cocoa/main_menu_builder.mm +++ b/chrome/browser/ui/cocoa/main_menu_builder.mm @@ -109,6 +109,7 @@ NSMenuItem* BuildFileMenu(NSApplication* nsapp, diff --git a/patches/chrome-browser-ui-dialogs-outdated_upgrade_bubble.cc.patch b/patches/chrome-browser-ui-dialogs-outdated_upgrade_bubble.cc.patch index 83463938ce76..7625d8455fb0 100644 --- a/patches/chrome-browser-ui-dialogs-outdated_upgrade_bubble.cc.patch +++ b/patches/chrome-browser-ui-dialogs-outdated_upgrade_bubble.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/dialogs/outdated_upgrade_bubble.cc b/chrome/browser/ui/dialogs/outdated_upgrade_bubble.cc -index 448eb26ee4fffcbba6b2cc6ebe91c4d4e1cc5707..87f5ec73c863f53c787388767178f49d554ebeb6 100644 +index 00fde67c1f83e10cca9dabec89871d50122b5a91..2eca2fd7c8807916664fdfc303371552b578eea6 100644 --- a/chrome/browser/ui/dialogs/outdated_upgrade_bubble.cc +++ b/chrome/browser/ui/dialogs/outdated_upgrade_bubble.cc @@ -35,6 +35,8 @@ namespace { diff --git a/patches/chrome-browser-ui-extensions-icon_with_badge_image_source.cc.patch b/patches/chrome-browser-ui-extensions-icon_with_badge_image_source.cc.patch index 1cc03e1230d9..1ac559c28ccd 100644 --- a/patches/chrome-browser-ui-extensions-icon_with_badge_image_source.cc.patch +++ b/patches/chrome-browser-ui-extensions-icon_with_badge_image_source.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc -index 2a4de33fb97a91c8835ff9e171946dedbcb96c4a..b1def6b8dc9f48cac528bb0893e609ccbb1fbc6c 100644 +index ffa5e3e9b8fb003133e842eb4ecec47281bb795c..330a2ef72546d5dc2ee191a8df47d08fb1905f00 100644 --- a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc +++ b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc -@@ -190,6 +190,7 @@ void IconWithBadgeImageSource::Draw(gfx::Canvas* canvas) { +@@ -191,6 +191,7 @@ void IconWithBadgeImageSource::Draw(gfx::Canvas* canvas) { gfx::ImageSkiaRep rep = skia.GetRepresentation(canvas->image_scale()); if (rep.scale() != canvas->image_scale()) { skia.AddRepresentation( @@ -10,7 +10,7 @@ index 2a4de33fb97a91c8835ff9e171946dedbcb96c4a..b1def6b8dc9f48cac528bb0893e609cc ScaleImageSkiaRep(rep, extensions::ExtensionAction::ActionIconSize(), canvas->image_scale())); } -@@ -200,6 +201,7 @@ void IconWithBadgeImageSource::Draw(gfx::Canvas* canvas) { +@@ -201,6 +202,7 @@ void IconWithBadgeImageSource::Draw(gfx::Canvas* canvas) { (size().width() - extensions::ExtensionAction::ActionIconSize()) / 2.0); int y_offset = std::floor( (size().height() - extensions::ExtensionAction::ActionIconSize()) / 2.0); diff --git a/patches/chrome-browser-ui-tab_helpers.cc.patch b/patches/chrome-browser-ui-tab_helpers.cc.patch index 5cf5b22c6d0f..17279b2b52ab 100644 --- a/patches/chrome-browser-ui-tab_helpers.cc.patch +++ b/patches/chrome-browser-ui-tab_helpers.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc -index d9f7c6749b8b6a8e33745ead0d0d3650ea6d32eb..433fd078ab8d21349ec5ab58ad68917013a8d660 100644 +index 48fec16cdae0db5d125f8f06f853ed77db1d7f92..b365c9624b6487c3d85f5500ae8964668bf62b5b 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc -@@ -734,4 +734,5 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { +@@ -753,4 +753,5 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { // This is common code for all of us. PLEASE DO YOUR PART to keep it tidy and // organized. diff --git a/patches/chrome-browser-ui-tabs-tab_strip_model.h.patch b/patches/chrome-browser-ui-tabs-tab_strip_model.h.patch index 94ca5e004976..4a4acf2e97d3 100644 --- a/patches/chrome-browser-ui-tabs-tab_strip_model.h.patch +++ b/patches/chrome-browser-ui-tabs-tab_strip_model.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h -index a584cad57ba3264f944b180072613d61cc201207..455a4f573d9198ef1b38721f67217dafb58187ae 100644 +index 2158fa70a8c878124361420cf4b66994724bd5fd..6704b8671a64f9bcd001c8e1dd3f1cbc14b2fda1 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h -@@ -582,6 +582,7 @@ class TabStripModel : public TabGroupController { +@@ -580,6 +580,7 @@ class TabStripModel : public TabGroupController { // Serialise this object into a trace. void WriteIntoTrace(perfetto::TracedValue context) const; diff --git a/patches/chrome-browser-ui-views-bookmarks-bookmark_bar_view.cc.patch b/patches/chrome-browser-ui-views-bookmarks-bookmark_bar_view.cc.patch index 881a88fc6cf4..0bd0ea40174f 100644 --- a/patches/chrome-browser-ui-views-bookmarks-bookmark_bar_view.cc.patch +++ b/patches/chrome-browser-ui-views-bookmarks-bookmark_bar_view.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc -index dffad1e2edeb86577e90578afc406aba02c532d9..08cad27acef3cbec29b3df8903d752dd55b5664e 100644 +index a9f542230542bc65e2108d0e346c9cc8a6c6c199..fe197f36fa328336ff0f174dc4af6320169759b6 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc -@@ -1157,6 +1157,7 @@ void BookmarkBarView::Layout() { +@@ -1159,6 +1159,7 @@ void BookmarkBarView::Layout() { x = next_x; } } + BRAVE_LAYOUT - // Set the visibility of the tab group separator if there are groups and - // bookmarks. + const bool show_bookmarks_overflow = + bookmark_model_->loaded() && diff --git a/patches/chrome-browser-ui-views-bookmarks-bookmark_bubble_view.cc.patch b/patches/chrome-browser-ui-views-bookmarks-bookmark_bubble_view.cc.patch index 58aa042df822..44080bd601bf 100644 --- a/patches/chrome-browser-ui-views-bookmarks-bookmark_bubble_view.cc.patch +++ b/patches/chrome-browser-ui-views-bookmarks-bookmark_bubble_view.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc -index 673f2ed2d0a46b02049864d9da34242dd9c2a264..c91d3ad943f83c7c6b8afc31c8eca9c2e73bdbdc 100644 +index b374f3a4f307689006955ed8bdeb4f1a31eb66be..f1c95389a519adaddaa7956bd45e654618a070e3 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc -@@ -533,6 +533,7 @@ void BookmarkBubbleView::ShowBubble( +@@ -534,6 +534,7 @@ void BookmarkBubbleView::ShowBubble( auto bubble = std::make_unique( std::move(dialog_model), anchor_view, views::BubbleBorder::TOP_RIGHT); bookmark_bubble_ = bubble.get(); diff --git a/patches/chrome-browser-ui-views-frame-browser_view_layout.cc.patch b/patches/chrome-browser-ui-views-frame-browser_view_layout.cc.patch new file mode 100644 index 000000000000..49a4922fb7c3 --- /dev/null +++ b/patches/chrome-browser-ui-views-frame-browser_view_layout.cc.patch @@ -0,0 +1,12 @@ +diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc +index ab36dd2ae50e29afdf43f5c37a0b479216345c99..84d420579df4587ade0fdbb6c0db52bcc9961ab0 100644 +--- a/chrome/browser/ui/views/frame/browser_view_layout.cc ++++ b/chrome/browser/ui/views/frame/browser_view_layout.cc +@@ -68,6 +68,7 @@ bool ConvertedHitTest(views::View* src, views::View* dst, gfx::Point* point) { + DCHECK(src); + DCHECK(dst); + DCHECK(point); ++ BRAVE_BROWSER_VIEW_LAYOUT_CONVERTED_HIT_TEST + views::View::ConvertPointToTarget(src, dst, point); + return dst->HitTestPoint(*point); + } diff --git a/patches/chrome-browser-ui-views-location_bar-location_bar_view.cc.patch b/patches/chrome-browser-ui-views-location_bar-location_bar_view.cc.patch index eb09d47fed78..c1d087797249 100644 --- a/patches/chrome-browser-ui-views-location_bar-location_bar_view.cc.patch +++ b/patches/chrome-browser-ui-views-location_bar-location_bar_view.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc -index d5c32354b060badf92e1504b3e46980dca6eb740..5fe1cf31ca64b29703a30f72485bc33a7669629c 100644 +index 020073134f1ab091bb4fb54391df6804faf68841..39c17d5a7761c5ec5c4c29fa4d38ed5641004a2c 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc -@@ -754,6 +754,7 @@ void LocationBarView::Layout() { +@@ -756,6 +756,7 @@ void LocationBarView::Layout() { } }; diff --git a/patches/chrome-browser-ui-views-location_bar-location_bar_view.h.patch b/patches/chrome-browser-ui-views-location_bar-location_bar_view.h.patch index e4be63bdae6f..a59990d52638 100644 --- a/patches/chrome-browser-ui-views-location_bar-location_bar_view.h.patch +++ b/patches/chrome-browser-ui-views-location_bar-location_bar_view.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h -index 0e3f3edeff9f3b9132e15dd4a55d9df60a4a0756..eb2b466415a68a98151367b46f1611a88c651827 100644 +index 6b968634a1e79cee24d6f8848afc9fd34f0dbc46..740b07b91e150e340186c1850d66e7afd46286e8 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -109,6 +109,7 @@ class LocationBarView : public LocationBar, diff --git a/patches/chrome-browser-ui-views-location_bar-location_icon_view.cc.patch b/patches/chrome-browser-ui-views-location_bar-location_icon_view.cc.patch index 702cc5b32d69..69ba31614187 100644 --- a/patches/chrome-browser-ui-views-location_bar-location_icon_view.cc.patch +++ b/patches/chrome-browser-ui-views-location_bar-location_icon_view.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc -index c8ca3a7e265f5dc63fddfa2c1fabb6e79f076689..8b62151e7e822d6e934d1a14d3761643bf7a6c2b 100644 +index d39ffdf2f679d32a0e15a54dd077535e849200f5..ae04470c6f8dcc7275bf5bf9f6ef8b61dca3328d 100644 --- a/chrome/browser/ui/views/location_bar/location_icon_view.cc +++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc @@ -171,6 +171,7 @@ bool LocationIconView::GetShowText() const { diff --git a/patches/chrome-browser-ui-views-overlay-video_overlay_window_views.cc.patch b/patches/chrome-browser-ui-views-overlay-video_overlay_window_views.cc.patch index 249b9aa4dcdf..ab34673580b7 100644 --- a/patches/chrome-browser-ui-views-overlay-video_overlay_window_views.cc.patch +++ b/patches/chrome-browser-ui-views-overlay-video_overlay_window_views.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc -index 9e5e40c912c00b70d921d422ce141cd9d4a5bcd3..1211fb980fc28cc3fa8a6805846288edb27b3fbd 100644 +index 50c222d235461ecce1f3ccc8941293de41cc134c..d4abba637aaab916403a20f9101f1d0f5aa8fec8 100644 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc -@@ -666,6 +666,7 @@ void VideoOverlayWindowViews::UpdateMaxSize(const gfx::Rect& work_area) { +@@ -668,6 +668,7 @@ void VideoOverlayWindowViews::UpdateMaxSize(const gfx::Rect& work_area) { max_size_ = new_max_size; diff --git a/patches/chrome-browser-ui-views-page_info-page_info_view_factory.cc.patch b/patches/chrome-browser-ui-views-page_info-page_info_view_factory.cc.patch index 1ce034431065..6dd512d69fc3 100644 --- a/patches/chrome-browser-ui-views-page_info-page_info_view_factory.cc.patch +++ b/patches/chrome-browser-ui-views-page_info-page_info_view_factory.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc -index 57aa072f005a47373e6e379142d7aba7207d951e..802e419b20e57e23cf9346c3c2de3dec84981f67 100644 +index 63c61e4eabc1f36ada46fdd5b7415fbd024c0942..38d4440da0691acefb7c74174cccb15aee28e395 100644 --- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc +++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc -@@ -409,6 +409,7 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( +@@ -415,6 +415,7 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( const gfx::VectorIcon* icon = &gfx::kNoneIcon; switch (info.type) { diff --git a/patches/chrome-browser-ui-views-permissions-permission_prompt_bubble_base_view.cc.patch b/patches/chrome-browser-ui-views-permissions-permission_prompt_bubble_base_view.cc.patch index 848b7580517e..bbd64ccdad5c 100644 --- a/patches/chrome-browser-ui-views-permissions-permission_prompt_bubble_base_view.cc.patch +++ b/patches/chrome-browser-ui-views-permissions-permission_prompt_bubble_base_view.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc -index c2b922df0590d17fd84e2b6c95208fd566da1aef..f8423480cfcaf7cf298be42abf38aa3c851c24c7 100644 +index 44456785156b0fa20bfd25294ce2b04de9a35839..f403ab6d7cc699588b36fe76839891b2937f0052 100644 --- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc +++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc -@@ -197,6 +197,7 @@ PermissionPromptBubbleBaseView::PermissionPromptBubbleBaseView( +@@ -158,6 +158,7 @@ PermissionPromptBubbleBaseView::PermissionPromptBubbleBaseView( } SetProperty(views::kElementIdentifierKey, kMainViewId); diff --git a/patches/chrome-browser-ui-views-tabs-tab.cc.patch b/patches/chrome-browser-ui-views-tabs-tab.cc.patch index 324b73605f65..bea911748614 100644 --- a/patches/chrome-browser-ui-views-tabs-tab.cc.patch +++ b/patches/chrome-browser-ui-views-tabs-tab.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc -index 4908042cef26dae68dd45a61c6c640e753ed269e..f3957372bb667c9e252d66b4e39fcf295b7c8506 100644 +index 46f9031f7592249a380a16857a1be000f39d693f..058996be785c904082d7c0db6f49dc8c07ee8b02 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc -@@ -414,6 +414,7 @@ void Tab::Layout() { +@@ -418,6 +418,7 @@ void Tab::Layout() { int title_right = contents_rect.right(); if (showing_alert_indicator_) { title_right = alert_indicator_button_->x() - after_title_padding; @@ -10,7 +10,7 @@ index 4908042cef26dae68dd45a61c6c640e753ed269e..f3957372bb667c9e252d66b4e39fcf29 } else if (showing_close_button_) { // Allow the title to overlay the close button's empty border padding. title_right = close_x - after_title_padding; -@@ -1033,6 +1034,7 @@ void Tab::UpdateIconVisibility() { +@@ -1058,6 +1059,7 @@ void Tab::UpdateIconVisibility() { available_width -= favicon_width; showing_close_button_ = large_enough_for_close_button; diff --git a/patches/chrome-browser-ui-views-toolbar-toolbar_view.cc.patch b/patches/chrome-browser-ui-views-toolbar-toolbar_view.cc.patch index ea1616c91553..18b8739ecfed 100644 --- a/patches/chrome-browser-ui-views-toolbar-toolbar_view.cc.patch +++ b/patches/chrome-browser-ui-views-toolbar-toolbar_view.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc -index 2ea09fd7e8cc03d17942e843b25f027f4caea3af..c2f16e2273931e7140c30b3d3c1fb68916236229 100644 +index 26de912e300e9b8e53c6d87b74a023f15777630a..5e0c57513bddf1fbc152c1556f6268fad8f410f0 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -445,6 +445,7 @@ void ToolbarView::Init() { +@@ -455,6 +455,7 @@ void ToolbarView::Init() { container_view_->AddChildView(std::move(side_panel_button)); } diff --git a/patches/chrome-browser-ui-webui-BUILD.gn.patch b/patches/chrome-browser-ui-webui-BUILD.gn.patch index 56995bca0ea7..0641a2860bed 100644 --- a/patches/chrome-browser-ui-webui-BUILD.gn.patch +++ b/patches/chrome-browser-ui-webui-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/webui/BUILD.gn b/chrome/browser/ui/webui/BUILD.gn -index c450791517869cd1475cb3732195f72698b4eb99..8ca92d5777988202468d3e68975eed305883724e 100644 +index 3d6f82f1dfd5a521fa8cc8f2f2b51c130e2f7596..e7342ab7fe5d10d57062991c017956b548a47daa 100644 --- a/chrome/browser/ui/webui/BUILD.gn +++ b/chrome/browser/ui/webui/BUILD.gn -@@ -75,4 +75,5 @@ source_set("configs") { +@@ -76,4 +76,5 @@ source_set("configs") { deps += [ "//ash/webui/sample_system_web_app_ui" ] } } diff --git a/patches/chrome-browser-ui-webui-chrome_web_ui_controller_factory.cc.patch b/patches/chrome-browser-ui-webui-chrome_web_ui_controller_factory.cc.patch index afd69c51ec9a..3c61f58d3ee6 100644 --- a/patches/chrome-browser-ui-webui-chrome_web_ui_controller_factory.cc.patch +++ b/patches/chrome-browser-ui-webui-chrome_web_ui_controller_factory.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -index 182cb8d7e8486f401dfad3d672839f45de0698ee..22a9c42cf54587673821a45302897d6d629ffad1 100644 +index a7105e8a9406bd4523de3379c71ada75ce9f9a10..1f67da8618e1815df2de49461fc4d7b211435c9c 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -@@ -981,6 +981,7 @@ void ChromeWebUIControllerFactory::GetFaviconForURL( +@@ -986,6 +986,7 @@ void ChromeWebUIControllerFactory::GetFaviconForURL( // static ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() { diff --git a/patches/chrome-browser-ui-webui-downloads-downloads_ui.cc.patch b/patches/chrome-browser-ui-webui-downloads-downloads_ui.cc.patch index 5a97f5ccfa07..758729d3992c 100644 --- a/patches/chrome-browser-ui-webui-downloads-downloads_ui.cc.patch +++ b/patches/chrome-browser-ui-webui-downloads-downloads_ui.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/webui/downloads/downloads_ui.cc b/chrome/browser/ui/webui/downloads/downloads_ui.cc -index e56ad5469d6cded25cf3b37466973d6162cb4a50..8a49018ce3218ca3aba1a4abb5595fc9874c6512 100644 +index 9a8570ff1a770346a11e5f7781340bbbe2a3168b..6027d94f4715735f38235013c54ee34eb93418c2 100644 --- a/chrome/browser/ui/webui/downloads/downloads_ui.cc +++ b/chrome/browser/ui/webui/downloads/downloads_ui.cc @@ -60,6 +60,7 @@ namespace { diff --git a/patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch b/patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch index 2e0b15f3ff40..621c36c969ee 100644 --- a/patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch +++ b/patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch @@ -1,10 +1,10 @@ diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc -index cf6352455a01a1f6ac234eb58ee4c8d1333783f9..bc27e29f2cec81e20bba658801b6defc24974870 100644 +index dff2c49b830a5feb7f35ba1db89f70f83877b84e..5547ce8e403d6dc1ddb012f7b65260ee7633c12e 100644 --- a/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc -@@ -440,6 +440,7 @@ content::WebUIDataSource* CreateAndAddExtensionsSource(Profile* profile, - "safetyCheckShowReviewPanel", - base::FeatureList::IsEnabled(features::kSafetyCheckExtensions)); +@@ -442,6 +442,7 @@ content::WebUIDataSource* CreateAndAddExtensionsSource(Profile* profile, + source->AddBoolean("safetyHubShowReviewPanel", + base::FeatureList::IsEnabled(features::kSafetyHub)); + BRAVE_CREATE_EXTENSIONS_SOURCE return source; diff --git a/patches/chrome-browser-ui-webui-settings-people_handler.cc.patch b/patches/chrome-browser-ui-webui-settings-people_handler.cc.patch index e3bb4bde3b1e..622e2830510d 100644 --- a/patches/chrome-browser-ui-webui-settings-people_handler.cc.patch +++ b/patches/chrome-browser-ui-webui-settings-people_handler.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc -index a134e692f136fd468a9650b0ca08f9ce0ec658b2..1904f0358a403683dca8f30a3c73f6a9570df6f7 100644 +index 0ae5523054ab22de65d2f4dfdd156f8bb66062d3..73469fee4cef04d337871a571eb5824604200001 100644 --- a/chrome/browser/ui/webui/settings/people_handler.cc +++ b/chrome/browser/ui/webui/settings/people_handler.cc -@@ -875,6 +875,7 @@ void PeopleHandler::OnStateChanged(syncer::SyncService* sync_service) { +@@ -873,6 +873,7 @@ void PeopleHandler::OnStateChanged(syncer::SyncService* sync_service) { void PeopleHandler::BeforeUnloadDialogCancelled() { // The before unload dialog is only shown during the first sync setup. @@ -10,7 +10,7 @@ index a134e692f136fd468a9650b0ca08f9ce0ec658b2..1904f0358a403683dca8f30a3c73f6a9 DCHECK(IdentityManagerFactory::GetForProfile(profile_)->HasPrimaryAccount( signin::ConsentLevel::kSync)); syncer::SyncService* service = GetSyncService(); -@@ -924,6 +925,7 @@ base::Value::Dict PeopleHandler::GetSyncStatusDictionary() const { +@@ -922,6 +923,7 @@ base::Value::Dict PeopleHandler::GetSyncStatusDictionary() const { service && !disallowed_by_policy && service->IsSetupInProgress() && !service->GetUserSettings()->IsInitialSyncFeatureSetupComplete() && identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSync)); diff --git a/patches/chrome-browser-ui-webui-settings-settings_localized_strings_provider.cc.patch b/patches/chrome-browser-ui-webui-settings-settings_localized_strings_provider.cc.patch index a7e0b3ce1cf3..f827c3398bf4 100644 --- a/patches/chrome-browser-ui-webui-settings-settings_localized_strings_provider.cc.patch +++ b/patches/chrome-browser-ui-webui-settings-settings_localized_strings_provider.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -index 899ae48f57d2c1bc83aba77d70802f8c4a577c87..0fe36a25eaa6125c6c5bb3b8060140b99bad4057 100644 +index 5bd3bf17d56b99f651d1161e198c26e38a134254..27c2b316c15b85103499a3b4de2972ce28edbaeb 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -3533,6 +3533,7 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, +@@ -3630,6 +3630,7 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, policy_indicator::AddLocalizedStrings(html_source); AddSecurityKeysStrings(html_source); diff --git a/patches/chrome-browser-ui-webui-settings-site_settings_helper.cc.patch b/patches/chrome-browser-ui-webui-settings-site_settings_helper.cc.patch index 30d6429641ce..855fb5bcf889 100644 --- a/patches/chrome-browser-ui-webui-settings-site_settings_helper.cc.patch +++ b/patches/chrome-browser-ui-webui-settings-site_settings_helper.cc.patch @@ -1,16 +1,16 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc -index 9bc1f5089a76bb2a6ce0559c9074ca0995bc64f1..478e1c6194fb994f206191d375493b164d5334a0 100644 +index 8a6ff5638ca7d54625be88d22d50c67fe99004ee..a43376a957bd8aa378c801e4cbfcc921b69bbc01 100644 --- a/chrome/browser/ui/webui/settings/site_settings_helper.cc +++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc -@@ -198,6 +198,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { - {ContentSettingsType::COOKIE_CONTROLS_METADATA, nullptr}, - {ContentSettingsType::TPCD_SUPPORT, nullptr}, - {ContentSettingsType::TPCD_METADATA_GRANTS, nullptr}, +@@ -202,6 +202,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + // TODO(crbug.com/1011533): Update the name once the design is finalized + // for the integration with Safety Hub. + {ContentSettingsType::FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION, nullptr}, + BRAVE_CONTENT_SETTINGS_TYPE_GROUP_NAMES_LIST }; static_assert(std::size(kContentSettingsTypeGroupNames) == -@@ -461,6 +462,7 @@ bool HasRegisteredGroupName(ContentSettingsType type) { +@@ -465,6 +466,7 @@ bool HasRegisteredGroupName(ContentSettingsType type) { } ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { diff --git a/patches/chrome-chrome_repack_locales.gni.patch b/patches/chrome-chrome_repack_locales.gni.patch index 96b934fde644..c17d89d9f900 100644 --- a/patches/chrome-chrome_repack_locales.gni.patch +++ b/patches/chrome-chrome_repack_locales.gni.patch @@ -1,5 +1,5 @@ diff --git a/chrome/chrome_repack_locales.gni b/chrome/chrome_repack_locales.gni -index 7aa8989a0f47167440824f0531ee9956d2f24098..d7a9da068994a9450eca2655dd5c038be0c3f55f 100644 +index a1666413e61d3f0f19e45f05971d27d4828b70e2..0e1e18dac125a4c1139ed4c16aa4218767f9417d 100644 --- a/chrome/chrome_repack_locales.gni +++ b/chrome/chrome_repack_locales.gni @@ -40,6 +40,7 @@ template("chrome_repack_locales") { @@ -18,14 +18,3 @@ index 7aa8989a0f47167440824f0531ee9956d2f24098..d7a9da068994a9450eca2655dd5c038b if (defined(invoker.deps)) { deps += invoker.deps } -@@ -106,8 +108,8 @@ template("chrome_repack_locales") { - ] - } else { - source_patterns += [ -- "${root_gen_dir}/chrome/chromium_strings_", -- "${root_gen_dir}/components/strings/components_chromium_strings_", -+ "${root_gen_dir}/chrome/${branding_path_product}_strings_", -+ "${root_gen_dir}/components/strings/components_${branding_path_product}_strings_", - ] - } - diff --git a/patches/chrome-common-BUILD.gn.patch b/patches/chrome-common-BUILD.gn.patch index db0d5fcaa30c..ece8f61ac33e 100644 --- a/patches/chrome-common-BUILD.gn.patch +++ b/patches/chrome-common-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn -index e75d7bc0b01870f71f7a698c9620c24e66f8897c..4e7354c60e1d4948a564fdb62eb6402c141d3c4c 100644 +index cc6bcb172d31be01f4ee5e79904c3889f4df9a9f..3f3f637acf51fabbe0d10c36b3b2151631ee604d 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -97,6 +97,7 @@ source_set("channel_info") { +@@ -98,6 +98,7 @@ source_set("channel_info") { } else if (is_fuchsia) { sources += [ "channel_info_fuchsia.cc" ] } @@ -10,7 +10,7 @@ index e75d7bc0b01870f71f7a698c9620c24e66f8897c..4e7354c60e1d4948a564fdb62eb6402c } source_set("ini_parser") { -@@ -272,6 +273,7 @@ static_library("common_lib") { +@@ -274,6 +275,7 @@ static_library("common_lib") { if (enable_ppapi) { public_deps += [ "//ppapi/shared_impl" ] } @@ -18,10 +18,10 @@ index e75d7bc0b01870f71f7a698c9620c24e66f8897c..4e7354c60e1d4948a564fdb62eb6402c if (enable_extensions) { sources += [ -@@ -539,6 +541,7 @@ static_library("non_code_constants") { - "//printing/buildflags", - "//ui/base:buildflags", - ] +@@ -543,6 +545,7 @@ static_library("non_code_constants") { + if (is_win) { + sources += [ "chrome_icon_resources_win.h" ] + } + configs += [ "//brave/common:constants_configs" ] } diff --git a/patches/chrome-common-extensions-chrome_extensions_client.cc.patch b/patches/chrome-common-extensions-chrome_extensions_client.cc.patch index 5838928381f1..1da60da13f47 100644 --- a/patches/chrome-common-extensions-chrome_extensions_client.cc.patch +++ b/patches/chrome-common-extensions-chrome_extensions_client.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/common/extensions/chrome_extensions_client.cc b/chrome/common/extensions/chrome_extensions_client.cc -index 493161c29afc97feeb3f369fd65dd442024cd2f4..429f4ef2852a6712903a0561f5d21b9dd313bc6a 100644 +index 56e1198b3bd07badc97e3e494b9aa1e310f62e9b..0f190efec644237458139f118e2d7b1d2dc4d105 100644 --- a/chrome/common/extensions/chrome_extensions_client.cc +++ b/chrome/common/extensions/chrome_extensions_client.cc @@ -13,6 +13,7 @@ diff --git a/patches/chrome-installer-util-BUILD.gn.patch b/patches/chrome-installer-util-BUILD.gn.patch index 976f16107b50..4f2611c50fa0 100644 --- a/patches/chrome-installer-util-BUILD.gn.patch +++ b/patches/chrome-installer-util-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn -index eec8f3b69d89ac3f302e447951c9d9f2a492e030..02982455db04926f910658475f1ea12df2f122ad 100644 +index a743a4e9b1fea69a64239e59d7718ee84edad386..5cc718b11ff174e12eeda0ab3420659bff4b9dff 100644 --- a/chrome/installer/util/BUILD.gn +++ b/chrome/installer/util/BUILD.gn @@ -205,6 +205,7 @@ static_library("with_no_strings") { diff --git a/patches/chrome-installer-util-google_update_settings.cc.patch b/patches/chrome-installer-util-google_update_settings.cc.patch index 54471d6340bf..3ee11f97ae7c 100644 --- a/patches/chrome-installer-util-google_update_settings.cc.patch +++ b/patches/chrome-installer-util-google_update_settings.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc -index e43cc9fc2e804fae22aab1c25e59249016af8469..8e8f76b1caffce3759581b70f94d041abbe826d5 100644 +index 1f0d49fcfc2461bec787d70f589df05cb7b7a9d8..4c1f1df2484ffcab35607d17829ea7fbcc138e3b 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -32,7 +32,11 @@ using base::win::RegKey; diff --git a/patches/chrome-installer-util-shell_util.cc.patch b/patches/chrome-installer-util-shell_util.cc.patch index fee85f0f9830..179451108f27 100644 --- a/patches/chrome-installer-util-shell_util.cc.patch +++ b/patches/chrome-installer-util-shell_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc -index 595d30a92a0994015b1f9b3d7d425f96677f4a0c..e6b5eb9770ab4dabfb366ac03a62fe1de2a73d2b 100644 +index 7f20d494956cd5be760465356edd0ffea96f59d3..f0e8118ea51a744fd448927408bca27b3b2b3ae8 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc -@@ -370,6 +370,7 @@ void GetChromeProgIdEntries( +@@ -363,6 +363,7 @@ void GetChromeProgIdEntries( app_info.delegate_clsid = install_static::GetLegacyCommandExecuteImplClsid(); GetProgIdEntries(app_info, entries); @@ -10,7 +10,7 @@ index 595d30a92a0994015b1f9b3d7d425f96677f4a0c..e6b5eb9770ab4dabfb366ac03a62fe1d if (!app_info.delegate_clsid.empty()) { auto delegate_execute_entries = -@@ -465,6 +466,7 @@ void GetShellIntegrationEntries( +@@ -458,6 +459,7 @@ void GetShellIntegrationEntries( const std::wstring html_prog_id(GetBrowserProgId(suffix)); for (int i = 0; ShellUtil::kPotentialFileAssociations[i] != nullptr; i++) { @@ -18,7 +18,7 @@ index 595d30a92a0994015b1f9b3d7d425f96677f4a0c..e6b5eb9770ab4dabfb366ac03a62fe1d entries->push_back(std::make_unique( capabilities + L"\\FileAssociations", ShellUtil::kPotentialFileAssociations[i], html_prog_id)); -@@ -489,6 +491,7 @@ void GetAppExtRegistrationEntries( +@@ -482,6 +484,7 @@ void GetAppExtRegistrationEntries( std::wstring key_name = base::StrCat({ShellUtil::kRegClasses, kFilePathSeparator, ext, kFilePathSeparator, ShellUtil::kRegOpenWithProgids}); @@ -26,7 +26,7 @@ index 595d30a92a0994015b1f9b3d7d425f96677f4a0c..e6b5eb9770ab4dabfb366ac03a62fe1d entries->push_back( std::make_unique(key_name, prog_id, std::wstring())); } -@@ -1742,8 +1745,10 @@ const wchar_t* ShellUtil::kPotentialFileAssociations[] = { +@@ -1523,8 +1526,10 @@ const wchar_t* ShellUtil::kPotentialFileAssociations[] = { L".htm", L".html", L".pdf", L".shtml", L".svg", L".xht", L".xhtml", L".webp", nullptr}; const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", diff --git a/patches/chrome-renderer-BUILD.gn.patch b/patches/chrome-renderer-BUILD.gn.patch index 384e6ab8202d..5a4d95e3dcf8 100644 --- a/patches/chrome-renderer-BUILD.gn.patch +++ b/patches/chrome-renderer-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn -index 01c93bf7e64afc49c38a5a13c6f558efe1e3e5d9..1624b54d91ff51bbc6515ee7129f8bbeedcab48c 100644 +index 18b342e66f11a3c40a2243f424cc2ff7e825aad3..072074be162a9ca28888ab9093030a744d4c20a6 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn -@@ -233,6 +233,7 @@ static_library("renderer") { +@@ -234,6 +234,7 @@ static_library("renderer") { "//v8", ] diff --git a/patches/chrome-renderer-chrome_content_renderer_client.cc.patch b/patches/chrome-renderer-chrome_content_renderer_client.cc.patch index c309c7227571..23fa82268577 100644 --- a/patches/chrome-renderer-chrome_content_renderer_client.cc.patch +++ b/patches/chrome-renderer-chrome_content_renderer_client.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc -index c573a3908fd43f678af1ca5142c5f4258ff426bf..1aac3e7b57b4d213dc1d7ff21392b55671acba86 100644 +index 8ef09f60649bb8b593f644952c652506dcc431f1..bebee50eb167568a0ec9493eb795b9fbbe18e11a 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -588,7 +588,7 @@ void ChromeContentRendererClient::RenderFrameCreated( diff --git a/patches/chrome-test-BUILD.gn.patch b/patches/chrome-test-BUILD.gn.patch index 5906b610d2f2..b0e898dee485 100644 --- a/patches/chrome-test-BUILD.gn.patch +++ b/patches/chrome-test-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index a315f817a8977d36e52b8f7c81d9e6778d3dcca2..b524546144a3d9f1a2542e0b5b8c619f965ac082 100644 +index 317aa37c811c4b461cd8a4b8e321a820622df4c3..2aa803bce91f03c9f82beed15aaabfbba3f8fead 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -433,6 +433,7 @@ static_library("test_support") { +@@ -447,6 +447,7 @@ static_library("test_support") { "//ui/gl", ] diff --git a/patches/chrome-test-data-webui-settings-BUILD.gn.patch b/patches/chrome-test-data-webui-settings-BUILD.gn.patch index 4c664cdc3451..d1820bc03dbc 100644 --- a/patches/chrome-test-data-webui-settings-BUILD.gn.patch +++ b/patches/chrome-test-data-webui-settings-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/test/data/webui/settings/BUILD.gn b/chrome/test/data/webui/settings/BUILD.gn -index 3c6f511fc32a16e475334e7cba8077ec10ab1b40..0612bcd9be59910e8175ed34cbed785775e92780 100644 +index edbc87e12027daea89358b315036770f0a5a6c2f..bfe5f4e94089fb7a09c34b3b74f848126047f34c 100644 --- a/chrome/test/data/webui/settings/BUILD.gn +++ b/chrome/test/data/webui/settings/BUILD.gn -@@ -225,6 +225,7 @@ build_webui_tests("build") { +@@ -224,6 +224,7 @@ build_webui_tests("build") { ts_definitions += [ "//tools/typescript/definitions/quick_unlock_private.d.ts" ] } diff --git a/patches/chrome-tools-build-mac-BUILD.gn.patch b/patches/chrome-tools-build-mac-BUILD.gn.patch index 7662faa6e84a..3010b3151b43 100644 --- a/patches/chrome-tools-build-mac-BUILD.gn.patch +++ b/patches/chrome-tools-build-mac-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/tools/build/mac/BUILD.gn b/chrome/tools/build/mac/BUILD.gn -index 5f663d27fc5bdc2d54d9b5ec79fec0810ef5349f..172b719e5f34fad84b5c76e629e1dea0b6b66c84 100644 +index 94007792858a92b49b6ef76e21f2f48b72636033..278bb8cbae362bc0970843bb6cd906374b829043 100644 --- a/chrome/tools/build/mac/BUILD.gn +++ b/chrome/tools/build/mac/BUILD.gn @@ -17,6 +17,7 @@ if (current_toolchain != default_toolchain) { diff --git a/patches/chrome-tools-build-mac-infoplist_strings_util.cc.patch b/patches/chrome-tools-build-mac-infoplist_strings_util.cc.patch index e11f7611e932..1ea52511cbbd 100644 --- a/patches/chrome-tools-build-mac-infoplist_strings_util.cc.patch +++ b/patches/chrome-tools-build-mac-infoplist_strings_util.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/tools/build/mac/infoplist_strings_util.cc b/chrome/tools/build/mac/infoplist_strings_util.cc -index 57c5b13e8aefe45122ac9d4e47e2f2bdf0bac709..c1f6f661b0ab6b6d773aad96c3d453ef617e015d 100644 +index 1b5d070769ae24538f2e9427b7eda96d78952e2b..ef1ba86f73fe51081814040b6ea7ad4457ba18ff 100644 --- a/chrome/tools/build/mac/infoplist_strings_util.cc +++ b/chrome/tools/build/mac/infoplist_strings_util.cc @@ -153,6 +153,7 @@ int main(int argc, char* const argv[]) { diff --git a/patches/chrome-utility-BUILD.gn.patch b/patches/chrome-utility-BUILD.gn.patch index 7e4b4547a951..747d227688fe 100644 --- a/patches/chrome-utility-BUILD.gn.patch +++ b/patches/chrome-utility-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn -index bf29364c22715208cf40701e3ec7102d7d120cde..e0521460a6c6fba865c3d443f9b183e3d323747f 100644 +index 69dedb71cc24e08c66580189393790254dd0c879..052a638ff359f759e0fc963f2af740b00f0d0a7b 100644 --- a/chrome/utility/BUILD.gn +++ b/chrome/utility/BUILD.gn @@ -72,6 +72,8 @@ static_library("utility") { diff --git a/patches/components-BUILD.gn.patch b/patches/components-BUILD.gn.patch deleted file mode 100644 index 841c83643cf4..000000000000 --- a/patches/components-BUILD.gn.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/components/BUILD.gn b/components/BUILD.gn -index d8b86a56abc8409e9c0452ee671b02d1da06855d..5b6f00671345753070e4bb9541b106903f58b0c0 100644 ---- a/components/BUILD.gn -+++ b/components/BUILD.gn -@@ -775,7 +775,7 @@ repack("components_tests_pak") { - if (is_chrome_branded) { - sources += [ "${root_gen_dir}/components/strings/components_google_chrome_strings_en-US.pak" ] - } else { -- sources += [ "${root_gen_dir}/components/strings/components_chromium_strings_en-US.pak" ] -+ sources += [ "${root_gen_dir}/components/strings/components_${branding_path_product}_strings_en-US.pak" ] - } - } - diff --git a/patches/components-bookmarks-browser-bookmark_model.h.patch b/patches/components-bookmarks-browser-bookmark_model.h.patch index bc5e602fdaa9..eb31ef9a15b6 100644 --- a/patches/components-bookmarks-browser-bookmark_model.h.patch +++ b/patches/components-bookmarks-browser-bookmark_model.h.patch @@ -1,8 +1,8 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h -index 6e19fab5ed3efaa0767d657afa750c5e6c55f114..7c18cbf2b45374066d6338e634a42ddc02cd31e5 100644 +index 0a444438372d5393189867aec0aef447e9f6683a..e4549d79af38fa0d663bad17e4785cd8f24c1db1 100644 --- a/components/bookmarks/browser/bookmark_model.h +++ b/components/bookmarks/browser/bookmark_model.h -@@ -385,6 +385,7 @@ class BookmarkModel final : public BookmarkUndoProvider, +@@ -390,6 +390,7 @@ class BookmarkModel final : public BookmarkUndoProvider, // this is a no-op. Deletion is done asynchronously on a background thread. static void WipeAccountStorageForRollback(const base::FilePath& profile_path); diff --git a/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-ChosenObjectSettings.java.patch b/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-ChosenObjectSettings.java.patch index 1f02b6710968..1d3e54bba2a6 100644 --- a/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-ChosenObjectSettings.java.patch +++ b/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-ChosenObjectSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ChosenObjectSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ChosenObjectSettings.java -index 4bc352bcbaa114100bb0dd44b6d33c97b0812143..15c0f1e248e2d0f396275c7e6e566449a1d309d0 100644 +index a983dab3ca4faeb6648566dbbeb0ba828b70b25e..f672a5495ea12c19c014b04632b29009ade6fe63 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ChosenObjectSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ChosenObjectSettings.java @@ -139,7 +139,7 @@ public class ChosenObjectSettings diff --git a/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-SingleCategorySettings.java.patch b/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-SingleCategorySettings.java.patch index 8088bf31c88a..749287ef14a5 100644 --- a/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-SingleCategorySettings.java.patch +++ b/patches/components-browser_ui-site_settings-android-java-src-org-chromium-components-browser_ui-site_settings-SingleCategorySettings.java.patch @@ -1,8 +1,8 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java -index e71790e5af9a111938135cbf2a67dd4376192bcc..d47e7a099c9fd8f258c03a4d7052cbc0e748bd4e 100644 +index 6193b17744cb4c82e3655179347c2dda3e7acfa5..a771cdbb398fcfecef461ff61347a42a6e1010e9 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java -@@ -518,7 +518,7 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment +@@ -518,7 +518,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment if (queryHasChanged) getInfoForOrigins(); return true; } diff --git a/patches/components-browser_ui-widget-android-java-res-values-dimens.xml.patch b/patches/components-browser_ui-widget-android-java-res-values-dimens.xml.patch index fcbb5105833a..486b01259545 100644 --- a/patches/components-browser_ui-widget-android-java-res-values-dimens.xml.patch +++ b/patches/components-browser_ui-widget-android-java-res-values-dimens.xml.patch @@ -1,5 +1,5 @@ diff --git a/components/browser_ui/widget/android/java/res/values/dimens.xml b/components/browser_ui/widget/android/java/res/values/dimens.xml -index 289a377417fcac7f34ec54617af76b8843625ff2..3cdaa7139a3f565c90518bca6d49f2b6575cf378 100644 +index a27cabd66079560e6102c0f72384cbd744dc98ec..7a5063a152e7f7b7a1ef8e2b3c4872d11ed4414a 100644 --- a/components/browser_ui/widget/android/java/res/values/dimens.xml +++ b/components/browser_ui/widget/android/java/res/values/dimens.xml @@ -78,7 +78,7 @@ found in the LICENSE file. diff --git a/patches/components-browsing_data-core-BUILD.gn.patch b/patches/components-browsing_data-core-BUILD.gn.patch index bfc059cc27b6..6386451b24ee 100644 --- a/patches/components-browsing_data-core-BUILD.gn.patch +++ b/patches/components-browsing_data-core-BUILD.gn.patch @@ -1,11 +1,11 @@ diff --git a/components/browsing_data/core/BUILD.gn b/components/browsing_data/core/BUILD.gn -index 47b02706c77ba04fa994dd922e125a2e9bcd6119..020f099e7b07a563c7f0553fa774834ab33357d3 100644 +index b362eca9a018afd9a2453777e05eb698bda485d6..9170bc9d9738b6cf9a5c5872b9b9da999ba78897 100644 --- a/components/browsing_data/core/BUILD.gn +++ b/components/browsing_data/core/BUILD.gn -@@ -47,6 +47,7 @@ static_library("core") { - "//components/webdata/common", - "//ui/base", +@@ -49,6 +49,7 @@ static_library("core") { ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + import("//brave/components/browsing_data/core/sources.gni") deps += brave_components_browsing_data_core_deps } diff --git a/patches/components-content_settings-core-browser-BUILD.gn.patch b/patches/components-content_settings-core-browser-BUILD.gn.patch index 08a1c0256378..e2026d89193e 100644 --- a/patches/components-content_settings-core-browser-BUILD.gn.patch +++ b/patches/components-content_settings-core-browser-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/content_settings/core/browser/BUILD.gn b/components/content_settings/core/browser/BUILD.gn -index e774418d741d9cf856a8581de6685cbfea8dd2d4..50c3e24d658c3347f50002a695bd06a7004fee84 100644 +index a6cf882ea0f9a6dc76415b656b2324b8f22b4f55..cac80370930540fd35b2bb19eb14b0e1165a1651 100644 --- a/components/content_settings/core/browser/BUILD.gn +++ b/components/content_settings/core/browser/BUILD.gn -@@ -85,6 +85,7 @@ static_library("browser") { +@@ -87,6 +87,7 @@ static_library("browser") { } configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patches/components-content_settings-core-browser-content_settings_registry.cc.patch b/patches/components-content_settings-core-browser-content_settings_registry.cc.patch index f25a7c3926a9..1f8ebb703b9a 100644 --- a/patches/components-content_settings-core-browser-content_settings_registry.cc.patch +++ b/patches/components-content_settings-core-browser-content_settings_registry.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc -index 0486610875890ed1e35fb506459e21b214633a07..f8ea53db63b958f8b97a8d5fc5d8f16fe9782714 100644 +index f8abed2309f06409d1e75932760d44a863260280..3439706472c4ad785cd49fafcdca5ae600f82b95 100644 --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -629,6 +629,7 @@ void ContentSettingsRegistry::Init() { +@@ -630,6 +630,7 @@ void ContentSettingsRegistry::Init() { WebsiteSettingsRegistry::DESKTOP, ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); diff --git a/patches/components-content_settings-core-browser-content_settings_uma_util.cc.patch b/patches/components-content_settings-core-browser-content_settings_uma_util.cc.patch index b0aecc09c98a..696b7b686cc5 100644 --- a/patches/components-content_settings-core-browser-content_settings_uma_util.cc.patch +++ b/patches/components-content_settings-core-browser-content_settings_uma_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/content_settings/core/browser/content_settings_uma_util.cc b/components/content_settings/core/browser/content_settings_uma_util.cc -index bee86e7d29d36d24496b23a3dcda54a7ed2d6aa5..f1daf3c9cb657456c32300e25292976b9a1a3308 100644 +index 1b7ca43975e01627e035fe751a3c34bccec42671..1a738cc5b6fa8d5ddc9a2923eed5939098e32b72 100644 --- a/components/content_settings/core/browser/content_settings_uma_util.cc +++ b/components/content_settings/core/browser/content_settings_uma_util.cc -@@ -122,6 +122,7 @@ constexpr auto kHistogramValue = base::MakeFixedFlatMapIsTrackingMetadata()) { - return; // Sync processor not yet ready, don't sync. - } -+ BRAVE_TYPED_URL_SYNC_BRIDGE_ON_URL_VISITED_REPLACE_SHOULD_SYNC_VISIT - if (!ShouldSyncVisit(url_row.typed_count(), visit_row.transition)) { - return; - } diff --git a/patches/components-history-core-browser-sync-typed_url_sync_bridge_unittest.cc.patch b/patches/components-history-core-browser-sync-typed_url_sync_bridge_unittest.cc.patch deleted file mode 100644 index 4f86ea7dd416..000000000000 --- a/patches/components-history-core-browser-sync-typed_url_sync_bridge_unittest.cc.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc b/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc -index b396a2de48c821dcee672403709a179021cbe601..c223995a7a7920c8794fae293e32defb463070be 100644 ---- a/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc -+++ b/components/history/core/browser/sync/typed_url_sync_bridge_unittest.cc -@@ -347,6 +347,7 @@ class TypedURLSyncBridgeTest : public testing::Test { - typed_url_sync_bridge_->Init(); - typed_url_sync_bridge_->history_backend_observation_.Reset(); - fake_history_backend_->SetTypedURLSyncBridgeForTest(std::move(bridge)); -+ BRAVE_TEST_MEMBERS_INIT - } - - void TearDown() override { fake_history_backend_->Closing(); } -@@ -554,6 +555,7 @@ class TypedURLSyncBridgeTest : public testing::Test { - scoped_refptr fake_history_backend_; - raw_ptr typed_url_sync_bridge_ = nullptr; - NiceMock mock_processor_; -+ BRAVE_TEST_MEMBERS_DECLARE - }; - - // Add two typed urls locally and verify bridge can get them from GetAllData. diff --git a/patches/components-infobars-core-infobar_delegate.h.patch b/patches/components-infobars-core-infobar_delegate.h.patch index dee4e60a7aef..672fcd8d45fa 100644 --- a/patches/components-infobars-core-infobar_delegate.h.patch +++ b/patches/components-infobars-core-infobar_delegate.h.patch @@ -1,11 +1,11 @@ diff --git a/components/infobars/core/infobar_delegate.h b/components/infobars/core/infobar_delegate.h -index be20a21aa17688c9635d13a6b591cd817715c164..be3a6a526f47ed2fcd739452ecd8c8e1ba4e7912 100644 +index 0d6de9b9c5fb005e78a7342194fc4c5a38a2f6aa..6b79d970e59f69b62bcb5aaf39c18d7602a03557 100644 --- a/components/infobars/core/infobar_delegate.h +++ b/components/infobars/core/infobar_delegate.h -@@ -188,6 +188,7 @@ class InfoBarDelegate { - TAB_PICKUP_INFOBAR_DELEGATE = 114, +@@ -189,6 +189,7 @@ class InfoBarDelegate { LOCAL_TEST_POLICIES_APPLIED_INFOBAR = 115, BIDDING_AND_AUCTION_CONSENTED_DEBUGGING_DELEGATE = 116, + PARCEL_TRACKING_INFOBAR_DELEGATE = 117, + BRAVE_INFOBAR_DELEGATE_IDENTIFIERS }; diff --git a/patches/components-metrics-BUILD.gn.patch b/patches/components-metrics-BUILD.gn.patch index 7e22e4f9cfcb..335902f6195d 100644 --- a/patches/components-metrics-BUILD.gn.patch +++ b/patches/components-metrics-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn -index d6187539a6521c4c9caa669ea8211e034a5dacb7..117884cbed192907f30f751d3201fc8f8d78edfe 100644 +index b5c2637244026506ea41978ba970b7f5dee964a4..c781666f7beb88bc9507027a809214676ec52c33 100644 --- a/components/metrics/BUILD.gn +++ b/components/metrics/BUILD.gn -@@ -298,6 +298,7 @@ if (!is_cronet_build || is_ios) { +@@ -302,6 +302,7 @@ if (!is_cronet_build || is_ios) { "motherboard_metrics_provider.h", ] } diff --git a/patches/components-omnibox-browser-BUILD.gn.patch b/patches/components-omnibox-browser-BUILD.gn.patch index a4bad7b10e7c..93c241588ca8 100644 --- a/patches/components-omnibox-browser-BUILD.gn.patch +++ b/patches/components-omnibox-browser-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn -index 8759ddfafad7b0357b248e01ba32cdd347c71437..b97038e2bc90f840d08562c471fe17d8dacc2b6d 100644 +index cf1ca1b06fc31c20a9d2ed7d2d234413189845ea..933e9601580a5f54bbc2cd06bb2f37c0f1ae7a7a 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn -@@ -382,6 +382,7 @@ static_library("browser") { +@@ -361,6 +361,7 @@ static_library("browser") { "//ui/base", "//ui/gfx", ] + sources += brave_components_omnibox_browser_sources deps += brave_components_omnibox_browser_deps - if ((!is_android || enable_vr) && !is_ios) { - deps += [ ":vector_icons" ] + configs += [ "//build/config/compiler:wexit_time_destructors" ] + diff --git a/patches/components-omnibox-browser-autocomplete_controller.cc.patch b/patches/components-omnibox-browser-autocomplete_controller.cc.patch index c3e73dcf2574..558752e67211 100644 --- a/patches/components-omnibox-browser-autocomplete_controller.cc.patch +++ b/patches/components-omnibox-browser-autocomplete_controller.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc -index 13300c4a96e9ca8b2a663a0f24bd7f599285acf3..cbe166e540ea292137ab502c840e6e654354645d 100644 +index dc9606900a72c1cca7689dbf5f46c319f322cb4e..a345dddd3d2c4dc2fbc44798195867cd8c510a61 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc -@@ -853,6 +853,7 @@ void AutocompleteController::InitializeAsyncProviders(int provider_types) { +@@ -787,6 +787,7 @@ void AutocompleteController::InitializeAsyncProviders(int provider_types) { if (provider_types & AutocompleteProvider::TYPE_SEARCH) { search_provider_ = new SearchProvider(provider_client_.get(), this); providers_.push_back(search_provider_.get()); @@ -10,11 +10,11 @@ index 13300c4a96e9ca8b2a663a0f24bd7f599285acf3..cbe166e540ea292137ab502c840e6e65 } // Providers run in the order they're added. Add `HistoryURLProvider` after // `SearchProvider` because: -@@ -1137,6 +1138,7 @@ void AutocompleteController::SortCullAndAnnotateResult( - absl::optional default_match_to_preserve) { - result_.SortAndCull(input_, template_url_service_, triggered_feature_service_, - default_match_to_preserve); +@@ -1075,6 +1076,7 @@ void AutocompleteController::SortCullAndAnnotateResult( + internal_result_.SortAndCull(input_, template_url_service_, + triggered_feature_service_, + default_match_to_preserve); + BRAVE_AUTOCOMPLETE_CONTROLLER_UPDATE_RESULT #if DCHECK_IS_ON() - result_.Validate(); + internal_result_.Validate(); diff --git a/patches/components-omnibox-browser-omnibox_edit_model.cc.patch b/patches/components-omnibox-browser-omnibox_edit_model.cc.patch index fdae2297c866..271d838fc4de 100644 --- a/patches/components-omnibox-browser-omnibox_edit_model.cc.patch +++ b/patches/components-omnibox-browser-omnibox_edit_model.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc -index 24eeaac09aaa36a4931fa97808a136bec284f27f..d2ac9780799c3f84638ea925d0e6d0e8659cb7db 100644 +index 58f6474021b4b43b947392e8a3445d4929b9da5e..82557cdc633e5644d7529eae304f15456a9ff7d0 100644 --- a/components/omnibox/browser/omnibox_edit_model.cc +++ b/components/omnibox/browser/omnibox_edit_model.cc -@@ -526,6 +526,7 @@ void OmniboxEditModel::AdjustTextForCopy(int sel_min, +@@ -506,6 +506,7 @@ void OmniboxEditModel::AdjustTextForCopy(int sel_min, (*text == display_text_ || *text == url_for_editing_)) { *url_from_text = controller_->client()->GetLocationBarModel()->GetURL(); *write_url = true; diff --git a/patches/components-page_info-BUILD.gn.patch b/patches/components-page_info-BUILD.gn.patch index c38415514ca8..f777636e652c 100644 --- a/patches/components-page_info-BUILD.gn.patch +++ b/patches/components-page_info-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/components/page_info/BUILD.gn b/components/page_info/BUILD.gn -index b9c9b5f8d8ec256b1064a93414ec819b01cd2e25..da6b20696ad46e2aa693b3c9fc1eef7500048e9b 100644 +index 0e48718bf0fbd7a05374b725e4acb6486059528f..c2d0f453122a659eb70baf98c82deb0c637005e0 100644 --- a/components/page_info/BUILD.gn +++ b/components/page_info/BUILD.gn @@ -47,6 +47,7 @@ static_library("page_info") { diff --git a/patches/components-page_info-page_info.cc.patch b/patches/components-page_info-page_info.cc.patch index 3773cd037d49..2bd54809ba3f 100644 --- a/patches/components-page_info-page_info.cc.patch +++ b/patches/components-page_info-page_info.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc -index ee84486bd7d1cd054565e4455e0b59a09b9c283f..2ec26cf37ddc4ab601498366f250b49a95910bf8 100644 +index 88004c76e9a67e616107b1b437c75ddbee841bde..88aed8084a62469f0d162b2caae59565f4f55f17 100644 --- a/components/page_info/page_info.cc +++ b/components/page_info/page_info.cc -@@ -1237,6 +1237,7 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1244,6 +1244,7 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, // applies to permissions listed in |kPermissionType|. bool PageInfo::ShouldShowPermission( const PageInfo::PermissionInfo& info) const { diff --git a/patches/components-password_manager-core-browser-login_database.cc.patch b/patches/components-password_manager-core-browser-login_database.cc.patch index 2ca026821207..bf19fa0dfd0c 100644 --- a/patches/components-password_manager-core-browser-login_database.cc.patch +++ b/patches/components-password_manager-core-browser-login_database.cc.patch @@ -1,11 +1,11 @@ diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc -index a58337d53864254a2d73e912c93a2957582fb14a..84e48bb0ecaa8b3f99635e7c6dd879bb66a5458d 100644 +index 45da171cb5e3ee3fa2b7dfebeff32a587da98b50..862f1725741026ef6d836fc86aa89767bef7383c 100644 --- a/components/password_manager/core/browser/login_database.cc +++ b/components/password_manager/core/browser/login_database.cc -@@ -2349,6 +2349,7 @@ FormRetrievalResult LoginDatabase::StatementToForms( - - EncryptionResult result = InitPasswordFormFromStatement( - *statement, /*decrypt_and_fill_password_value=*/true, new_form.get()); +@@ -2345,6 +2345,7 @@ FormRetrievalResult LoginDatabase::StatementToForms( + std::u16string plaintext_password; + EncryptionResult result = + DecryptPasswordFromStatement(*statement, &plaintext_password); + BRAVE_STATEMENT_TO_FORMS if (result == ENCRYPTION_RESULT_SERVICE_FAILURE) { has_service_failure = true; diff --git a/patches/components-permissions-BUILD.gn.patch b/patches/components-permissions-BUILD.gn.patch index d9d6656e5601..c52033c37854 100644 --- a/patches/components-permissions-BUILD.gn.patch +++ b/patches/components-permissions-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/components/permissions/BUILD.gn b/components/permissions/BUILD.gn -index 8de1e9259054621c85f296a5dc4b083857f9217d..7b949087a775a22248533334b0e304325c2671c6 100644 +index ab31b610753ab643905386e2a68771ff560c2216..011ade6bea142d572dccf1d4c281cedf83d03f99 100644 --- a/components/permissions/BUILD.gn +++ b/components/permissions/BUILD.gn @@ -141,6 +141,7 @@ source_set("permissions") { diff --git a/patches/components-permissions-android-BUILD.gn.patch b/patches/components-permissions-android-BUILD.gn.patch index b67bada27217..703e3023964b 100644 --- a/patches/components-permissions-android-BUILD.gn.patch +++ b/patches/components-permissions-android-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/permissions/android/BUILD.gn b/components/permissions/android/BUILD.gn -index 519d89d616047a40bea707edd6234a10010cb2d2..4cf1cb73613c74b9207b8a5a28d5ec373a36122f 100644 +index 3b3278741f7fd936c2471938cd57c055b02acfd0..aef4155080bcb2598073c9435910ff4232d30fb1 100644 --- a/components/permissions/android/BUILD.gn +++ b/components/permissions/android/BUILD.gn -@@ -131,6 +131,7 @@ android_library("java") { +@@ -133,6 +133,7 @@ android_library("java") { "//ui/android:ui_java", ] diff --git a/patches/components-permissions-android-permission_prompt-permission_dialog_delegate.cc.patch b/patches/components-permissions-android-permission_prompt-permission_dialog_delegate.cc.patch index 771f1fd26578..aa295a589ba8 100644 --- a/patches/components-permissions-android-permission_prompt-permission_dialog_delegate.cc.patch +++ b/patches/components-permissions-android-permission_prompt-permission_dialog_delegate.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc -index 6e8491786f6d07b4a8512c09bd8a840b60890da3..3a71e9646593650b64f40d69950c04c37d7886b3 100644 +index 95938a9c1947c3350604f064c4997e9c4eeaa108..b1bb6b54c3a4af0e0602adb97e2e7b8a6b816bc6 100644 --- a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc +++ b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc -@@ -95,12 +95,14 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( +@@ -96,12 +96,14 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( void PermissionDialogDelegate::Accept(JNIEnv* env, const JavaParamRef& obj) { DCHECK(permission_prompt_); diff --git a/patches/components-permissions-permission_context_base.h.patch b/patches/components-permissions-permission_context_base.h.patch index af9a38ba9d9a..70a60b78b1fa 100644 --- a/patches/components-permissions-permission_context_base.h.patch +++ b/patches/components-permissions-permission_context_base.h.patch @@ -1,8 +1,8 @@ diff --git a/components/permissions/permission_context_base.h b/components/permissions/permission_context_base.h -index 5a4c04fd8a715b7dee5558a100865d344b945acc..216622bcedccdd9958c0b5d7b5bd527334ff56b3 100644 +index 506e1f7c8571fe91330041e1caf3eca5d733f8c1..ab7d541fb673172d060ccaa7f8aa758c22370a3d 100644 --- a/components/permissions/permission_context_base.h +++ b/components/permissions/permission_context_base.h -@@ -130,6 +130,7 @@ class PermissionContextBase : public content_settings::Observer { +@@ -136,6 +136,7 @@ class PermissionContextBase : public content_settings::Observer { return content_settings_type_; } diff --git a/patches/components-permissions-permission_util.cc.patch b/patches/components-permissions-permission_util.cc.patch index ec385f31eed8..4798968c71de 100644 --- a/patches/components-permissions-permission_util.cc.patch +++ b/patches/components-permissions-permission_util.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/permissions/permission_util.cc b/components/permissions/permission_util.cc -index 214e3be44aad3904dad2cff3eda7170c8e8a54db..82677c76234382b3da02453759e5d6f7c234d608 100644 +index afb346fc7191e9ccd6a14f04dc7dacbeadc7aca7..11df3b6cd1a4aa82e89774ce905cec15cacccd47 100644 --- a/components/permissions/permission_util.cc +++ b/components/permissions/permission_util.cc @@ -311,6 +311,7 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingTypeSafe( diff --git a/patches/components-permissions-request_type.cc.patch b/patches/components-permissions-request_type.cc.patch index baee1d9885f4..dcc517ac27c9 100644 --- a/patches/components-permissions-request_type.cc.patch +++ b/patches/components-permissions-request_type.cc.patch @@ -1,9 +1,9 @@ diff --git a/components/permissions/request_type.cc b/components/permissions/request_type.cc -index b2d7df958fce95f683b995e438e2b2116f68afb5..f760cb9858f33f2d6b21c5605fe5948fc6165941 100644 +index a95dbdcc477faaa0b00bb38e60b8f25c0c59322a..1154a9209ad86e30be17d4534f9c57aa9c8d910f 100644 --- a/components/permissions/request_type.cc +++ b/components/permissions/request_type.cc -@@ -397,6 +397,7 @@ const char* PermissionKeyForRequestType(permissions::RequestType request_type) { - return "window_placement"; +@@ -405,6 +405,7 @@ const char* PermissionKeyForRequestType(permissions::RequestType request_type) { + return "window_management"; } #endif + BRAVE_PERMISSION_KEY_FOR_REQUEST_TYPE diff --git a/patches/components-safe_browsing-core-common-safe_browsing_prefs.cc.patch b/patches/components-safe_browsing-core-common-safe_browsing_prefs.cc.patch index eff51cef6af8..7098d7d09d5d 100644 --- a/patches/components-safe_browsing-core-common-safe_browsing_prefs.cc.patch +++ b/patches/components-safe_browsing-core-common-safe_browsing_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc -index 6bfd832d3c5b573f2dda62c335dc4759cca521f1..1c9018723d72c98351c539860ede6bcb0f34a5be 100644 +index 7d1f25f491473ff8fbb1235fb0e12ac447aa0d51..7009c289031eb0f00be2a1678f27c015793fcdf3 100644 --- a/components/safe_browsing/core/common/safe_browsing_prefs.cc +++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc -@@ -181,6 +181,7 @@ bool IsSafeBrowsingEnabled(const PrefService& prefs) { +@@ -183,6 +183,7 @@ bool IsSafeBrowsingEnabled(const PrefService& prefs) { } bool IsEnhancedProtectionEnabled(const PrefService& prefs) { diff --git a/patches/components-search_engines-prepopulated_engines.json.patch b/patches/components-search_engines-prepopulated_engines.json.patch index 79369bc97d12..5d6d1333f546 100644 --- a/patches/components-search_engines-prepopulated_engines.json.patch +++ b/patches/components-search_engines-prepopulated_engines.json.patch @@ -1,8 +1,8 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json -index cdfa06094cfcdd9aee030deda03a47364b4d6b5b..aa4b689be4ca759c2770f271ab3fea83092fe9d7 100644 +index 8ab6a40d2e8d3529c2f8ce1eaeebdcbd28aaefd4..d750ffecf782bc856d709db1ab701fb5db9144d6 100644 --- a/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json -@@ -91,17 +91,6 @@ +@@ -102,17 +102,6 @@ "id": 68 }, @@ -20,8 +20,8 @@ index cdfa06094cfcdd9aee030deda03a47364b4d6b5b..aa4b689be4ca759c2770f271ab3fea83 "ecosia": { "name": "Ecosia", "keyword": "ecosia.org", -@@ -174,16 +163,6 @@ - "id": 102 +@@ -253,16 +242,6 @@ + "id": 108 }, - "qwant": { diff --git a/patches/components-signin-internal-identity_manager-BUILD.gn.patch b/patches/components-signin-internal-identity_manager-BUILD.gn.patch index 584696f769a0..a20b982d7814 100644 --- a/patches/components-signin-internal-identity_manager-BUILD.gn.patch +++ b/patches/components-signin-internal-identity_manager-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/signin/internal/identity_manager/BUILD.gn b/components/signin/internal/identity_manager/BUILD.gn -index 34e06e715719d2f4590e2156022667dd4c3df5a8..426aac7a3a2ba7267401e2f233064c53c4461e60 100644 +index b92e61eaf90842ad0cdbc152aa315b4934ef3510..31e9229a5816ebb112404893a7be1e4ff521b14d 100644 --- a/components/signin/internal/identity_manager/BUILD.gn +++ b/components/signin/internal/identity_manager/BUILD.gn -@@ -142,6 +142,7 @@ source_set("identity_manager") { +@@ -140,6 +140,7 @@ source_set("identity_manager") { "device_accounts_synchronizer_impl.h", ] } diff --git a/patches/components-strings-BUILD.gn.patch b/patches/components-strings-BUILD.gn.patch index 25bbb2e05850..36cad87e3fc4 100644 --- a/patches/components-strings-BUILD.gn.patch +++ b/patches/components-strings-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/strings/BUILD.gn b/components/strings/BUILD.gn -index 5ba77bfb9ff1d4a110802df37fbf11185088c837..c2813b12669a65471cbc3a412577bb8e57c7296e 100644 +index 62efcab467a0048760068c28b7d0be1236311746..b578fbc2723cd38f6a514f5e8c4a42e9dff0c427 100644 --- a/components/strings/BUILD.gn +++ b/components/strings/BUILD.gn -@@ -50,6 +50,7 @@ grit("components_strings") { +@@ -52,6 +52,7 @@ grit("components_strings") { if (is_android) { outputs += android_components_strings_java_resources } diff --git a/patches/components-sync-BUILD.gn.patch b/patches/components-sync-BUILD.gn.patch deleted file mode 100644 index 96e8100d3c71..000000000000 --- a/patches/components-sync-BUILD.gn.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn -index 62d18bc96a386992cde393add46748bcab29c0e4..a067524c9ca3293cae04f9219b0c94cb8919c480 100644 ---- a/components/sync/BUILD.gn -+++ b/components/sync/BUILD.gn -@@ -16,6 +16,7 @@ group("sync") { - if (is_chromeos) { - public_deps += [ "//components/sync/chromeos" ] - } -+ import("//brave/build/config/brave_build.gni") public_deps += brave_components_sync_deps - } - - static_library("test_support") { diff --git a/patches/components-sync-engine-BUILD.gn.patch b/patches/components-sync-engine-BUILD.gn.patch index eb2eb24780a2..1fc4072d91c6 100644 --- a/patches/components-sync-engine-BUILD.gn.patch +++ b/patches/components-sync-engine-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/components/sync/engine/BUILD.gn b/components/sync/engine/BUILD.gn -index 40738063d115db55e2e1b4614fe0fe7c486cdc2e..8d573d4cc2d9c7cd41cc5f21916ad1160bf9d669 100644 +index 7c50896ea6dbc85dbc49d1737e7210843ee9ba89..52f8972e3010ef124a2ae2b88feb6f464c134332 100644 --- a/components/sync/engine/BUILD.gn +++ b/components/sync/engine/BUILD.gn -@@ -160,6 +160,7 @@ static_library("engine") { +@@ -164,6 +164,7 @@ static_library("engine") { "traffic_logger.h", "update_handler.h", ] diff --git a/patches/components-sync-engine-model_type_worker.h.patch b/patches/components-sync-engine-model_type_worker.h.patch index ee7b5609dd5a..8e11ce73dbb6 100644 --- a/patches/components-sync-engine-model_type_worker.h.patch +++ b/patches/components-sync-engine-model_type_worker.h.patch @@ -1,5 +1,5 @@ diff --git a/components/sync/engine/model_type_worker.h b/components/sync/engine/model_type_worker.h -index 8f224468d3c34a11738ac468572fb77e52a7d815..1d8183048347576f0095cf4893df61df14a1f762 100644 +index 76e5212061c893fdcc09560f87d684b354f4db43..b021af60b621e520f4888413a797dc6c9dcfca9a 100644 --- a/components/sync/engine/model_type_worker.h +++ b/components/sync/engine/model_type_worker.h @@ -207,6 +207,7 @@ class ModelTypeWorker : public UpdateHandler, diff --git a/patches/components-sync-engine-sync_scheduler_impl.cc.patch b/patches/components-sync-engine-sync_scheduler_impl.cc.patch index 3a0d52a755a1..0c0fb17361ff 100644 --- a/patches/components-sync-engine-sync_scheduler_impl.cc.patch +++ b/patches/components-sync-engine-sync_scheduler_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/sync/engine/sync_scheduler_impl.cc b/components/sync/engine/sync_scheduler_impl.cc -index e4b65487f0c2d455d17ca2047df8cb660d5651bd..bce4a706e3e08939d1e83a6810bf9f6b67147bf2 100644 +index 3e28d80184ab06c1fb5a6a974ec05302e6fc4659..af066b19672eff325662bb4c497fcaeceb5a21a1 100644 --- a/components/sync/engine/sync_scheduler_impl.cc +++ b/components/sync/engine/sync_scheduler_impl.cc -@@ -512,6 +512,7 @@ void SyncSchedulerImpl::HandleFailure( +@@ -514,6 +514,7 @@ void SyncSchedulerImpl::HandleFailure( SDVLOG(2) << "Sync cycle failed. Will back off for " << wait_interval_->length.InMilliseconds() << "ms."; } diff --git a/patches/components-sync-engine-syncer.cc.patch b/patches/components-sync-engine-syncer.cc.patch index 9e0c4ce39bec..cd77bc3aafa8 100644 --- a/patches/components-sync-engine-syncer.cc.patch +++ b/patches/components-sync-engine-syncer.cc.patch @@ -1,12 +1,12 @@ diff --git a/components/sync/engine/syncer.cc b/components/sync/engine/syncer.cc -index 7df29f4570a31871bb77637f5f2bc6cd7cf676a3..352f8a3da7bf92f9a47f4bb3ea55063fd67d06d9 100644 +index 382a33e0e165ac9801b83d7ee290469c0722849a..170df65769202cb1513ca84047949ea5d0b7af4c 100644 --- a/components/sync/engine/syncer.cc +++ b/components/sync/engine/syncer.cc -@@ -188,6 +188,7 @@ SyncerError Syncer::BuildAndPostCommits(const ModelTypeSet& request_types, +@@ -247,6 +247,7 @@ SyncerError Syncer::BuildAndPostCommits(const ModelTypeSet& request_types, } nudge_tracker->RecordSuccessfulCommitMessage( commit->GetContributingDataTypes()); + BRAVE_SYNCER_BUILD_AND_POST_COMMITS_POLLER_CHECK } - return SyncerError(SyncerError::SYNCER_OK); + return SyncerError::Success(); diff --git a/patches/components-sync-engine-syncer_proto_util.cc.patch b/patches/components-sync-engine-syncer_proto_util.cc.patch index a680de620805..1282d15ee7fd 100644 --- a/patches/components-sync-engine-syncer_proto_util.cc.patch +++ b/patches/components-sync-engine-syncer_proto_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/sync/engine/syncer_proto_util.cc b/components/sync/engine/syncer_proto_util.cc -index 26e45bfa0c09d378ce97e76bb37082125586625a..1d46c0a228c29c9a395cf44ec9b50f7fab051e7e 100644 +index 913b875e2cbd0af05a4f6b2489e065984f924257..f8e980fbd160b1465ba6a4fa218d5f1a67570d49 100644 --- a/components/sync/engine/syncer_proto_util.cc +++ b/components/sync/engine/syncer_proto_util.cc -@@ -290,6 +290,7 @@ SyncerError SyncerProtoUtil::HandleClientToServerMessageResponse( +@@ -286,6 +286,7 @@ SyncerError SyncerProtoUtil::HandleClientToServerMessageResponse( SyncProtocolError sync_protocol_error = GetProtocolErrorFromResponse(response, cycle->context()); diff --git a/patches/components-sync-protocol-proto_visitors.h.patch b/patches/components-sync-protocol-proto_visitors.h.patch index 3214fc6827ec..987de778e025 100644 --- a/patches/components-sync-protocol-proto_visitors.h.patch +++ b/patches/components-sync-protocol-proto_visitors.h.patch @@ -1,8 +1,8 @@ diff --git a/components/sync/protocol/proto_visitors.h b/components/sync/protocol/proto_visitors.h -index 0bff939fbe2275d2ccf8ba98329cb3fe9f5f83a0..178f292c619cfa7768afb16e3470dbbe8e7f5d96 100644 +index 6d6e5208a51630b202e8ec9fb393d74ca08c1bc8..d01d613d9b2d2e6d5bad3aa62b083c0d0941ac6a 100644 --- a/components/sync/protocol/proto_visitors.h +++ b/components/sync/protocol/proto_visitors.h -@@ -509,6 +509,7 @@ VISIT_PROTO_FIELDS(const sync_pb::DeviceInfoSpecifics& proto) { +@@ -510,6 +510,7 @@ VISIT_PROTO_FIELDS(const sync_pb::DeviceInfoSpecifics& proto) { VISIT(manufacturer); VISIT(last_updated_timestamp); VISIT(feature_fields); @@ -10,7 +10,7 @@ index 0bff939fbe2275d2ccf8ba98329cb3fe9f5f83a0..178f292c619cfa7768afb16e3470dbbe VISIT(sharing_fields); VISIT(invalidation_fields); VISIT(paask_fields); -@@ -523,6 +524,7 @@ VISIT_PROTO_FIELDS(const sync_pb::FeatureSpecificFields& proto) { +@@ -524,6 +525,7 @@ VISIT_PROTO_FIELDS(const sync_pb::FeatureSpecificFields& proto) { VISIT(send_tab_to_self_receiving_enabled); } diff --git a/patches/components-sync-service-sync_service_impl.h.patch b/patches/components-sync-service-sync_service_impl.h.patch index 5aa078c11b5b..8746d1699722 100644 --- a/patches/components-sync-service-sync_service_impl.h.patch +++ b/patches/components-sync-service-sync_service_impl.h.patch @@ -1,8 +1,8 @@ diff --git a/components/sync/service/sync_service_impl.h b/components/sync/service/sync_service_impl.h -index 8b2dad4af2fb2c44f04dba3c58cb6a2745a5f3ac..8e7b9a4e7c257ad2720c8f4b49284c827dd8b444 100644 +index 7b08d4d75456d9d9269e612d3aa4ea79399c0dfc..e08ae1a8846458761ba6f93d413382640441f70b 100644 --- a/components/sync/service/sync_service_impl.h +++ b/components/sync/service/sync_service_impl.h -@@ -254,6 +254,7 @@ class SyncServiceImpl : public SyncService, +@@ -255,6 +255,7 @@ class SyncServiceImpl : public SyncService, bool IsSyncFeatureConsideredRequested() const override; private: diff --git a/patches/components-system_media_controls-linux-system_media_controls_linux.cc.patch b/patches/components-system_media_controls-linux-system_media_controls_linux.cc.patch index 3e1048ab68c3..706637c7de06 100644 --- a/patches/components-system_media_controls-linux-system_media_controls_linux.cc.patch +++ b/patches/components-system_media_controls-linux-system_media_controls_linux.cc.patch @@ -1,14 +1,17 @@ diff --git a/components/system_media_controls/linux/system_media_controls_linux.cc b/components/system_media_controls/linux/system_media_controls_linux.cc -index 46b9488bfc0d83060748b7d58d389124e09cb521..448b9a670fd9faf641cebed02bb020627d8653ea 100644 +index 45e17a2665ffbf96f7e8f47dbdfbf7fe5b841bca..8192772bf33d852c0a415e7e6ebb1e66aedd8c0e 100644 --- a/components/system_media_controls/linux/system_media_controls_linux.cc +++ b/components/system_media_controls/linux/system_media_controls_linux.cc -@@ -46,12 +46,12 @@ constexpr base::TimeDelta kUpdatePositionInterval = base::Milliseconds(100); +@@ -56,7 +56,7 @@ constexpr base::TimeDelta kUpdatePositionInterval = base::Milliseconds(100); const char kMprisAPINoTrackPath[] = "/org/mpris/MediaPlayer2/TrackList/NoTrack"; const char kMprisAPICurrentTrackPathFormatString[] = - "/org/chromium/MediaPlayer2/TrackList/Track%s"; + "/com/brave/MediaPlayer2/TrackList/Track%s"; + // Writes `bitmap` to a new temporary PNG file and returns a a pair of the file + // path and a managed base::ScopedTempFile bound to this sequence. This should +@@ -96,7 +96,7 @@ WriteBitmapToTmpFile(const SkBitmap& bitmap) { } // namespace const char kMprisAPIServiceNameFormatString[] = diff --git a/patches/components-translate-core-common-BUILD.gn.patch b/patches/components-translate-core-common-BUILD.gn.patch index 91292240014a..dd759cb19af0 100644 --- a/patches/components-translate-core-common-BUILD.gn.patch +++ b/patches/components-translate-core-common-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/components/translate/core/common/BUILD.gn b/components/translate/core/common/BUILD.gn -index fca423135b3037a09498be00981fcaa6e6803157..3c9591c2cb5974801bfeb69c73369c5715d884af 100644 +index 01d3be6b4c8368622f2b45a508ada446b5a7706c..da1486a65689ad37a5653d3e7e6d7a04fab8aeee 100644 --- a/components/translate/core/common/BUILD.gn +++ b/components/translate/core/common/BUILD.gn @@ -26,6 +26,8 @@ static_library("common") { diff --git a/patches/components-update_client-BUILD.gn.patch b/patches/components-update_client-BUILD.gn.patch index f279abea929a..b1e26a7601cd 100644 --- a/patches/components-update_client-BUILD.gn.patch +++ b/patches/components-update_client-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/components/update_client/BUILD.gn b/components/update_client/BUILD.gn -index 09913b7fa8f271a61674e5cbf7da8f6182803061..b491d5ae58f6680c824d3bf2d70cd6752bf4ee87 100644 +index de3060e8479f81aaf7733562780ccfbf7b86cb35..ae2c1c97397c2403570ab4663ea19e80f048ff2f 100644 --- a/components/update_client/BUILD.gn +++ b/components/update_client/BUILD.gn @@ -180,6 +180,7 @@ static_library("update_client") { diff --git a/patches/components-variations-variations_seed_store.cc.patch b/patches/components-variations-variations_seed_store.cc.patch index 76d3bc25b6f1..46c995878fed 100644 --- a/patches/components-variations-variations_seed_store.cc.patch +++ b/patches/components-variations-variations_seed_store.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc -index b12dd017dc36bd1fc8d646a40436dcab3c17e3d7..6b8eda118284cb89bee5e5caaeeb6ec97bdb79c8 100644 +index 6e6a1b12a39b468b0dfe66acc3fbf84638b4d7bf..fe8ace94b1e214426ecdd7fa386040c59376f795 100644 --- a/components/variations/variations_seed_store.cc +++ b/components/variations/variations_seed_store.cc -@@ -51,6 +51,7 @@ const base::FeatureParam kVariationsAsyncProcessing{ +@@ -58,6 +58,7 @@ const base::FeatureParam kVariationsAsyncProcessing{ // The ECDSA public key of the variations server for verifying variations seed // signatures. const uint8_t kPublicKey[] = { diff --git a/patches/content-browser-dom_storage-dom_storage_context_wrapper.cc.patch b/patches/content-browser-dom_storage-dom_storage_context_wrapper.cc.patch index 9746213d2585..ee8673293653 100644 --- a/patches/content-browser-dom_storage-dom_storage_context_wrapper.cc.patch +++ b/patches/content-browser-dom_storage-dom_storage_context_wrapper.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.cc b/content/browser/dom_storage/dom_storage_context_wrapper.cc -index 1a75aeec24e730fe1797a176be06da7868915b64..b6df80e5a8ab9bc5f92ae2f97261e09cc06e5f17 100644 +index 21f00384d1a55298f4e7fb6e92fd1cad8b36c63d..536ad1d80626781e341e6f1d9f34482277c056d4 100644 --- a/content/browser/dom_storage/dom_storage_context_wrapper.cc +++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc -@@ -309,6 +309,7 @@ bool DOMStorageContextWrapper::IsRequestValid( +@@ -310,6 +310,7 @@ bool DOMStorageContextWrapper::IsRequestValid( break; } } diff --git a/patches/content-browser-renderer_host-navigation_controller_impl.cc.patch b/patches/content-browser-renderer_host-navigation_controller_impl.cc.patch index 4bfac444f375..35fa63376e90 100644 --- a/patches/content-browser-renderer_host-navigation_controller_impl.cc.patch +++ b/patches/content-browser-renderer_host-navigation_controller_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc -index 6ef5de7eb9f4933b0d0bb3f25d2c5803bb1970f8..a15505ecfe4ba61903d0a14a2495ce763834873d 100644 +index 7547312d87cd7be3eb7c494901ecad02d34515bb..d47c1c5c47b153c3a67923cf7627e3b0b32d5416 100644 --- a/content/browser/renderer_host/navigation_controller_impl.cc +++ b/content/browser/renderer_host/navigation_controller_impl.cc -@@ -3593,16 +3593,17 @@ base::WeakPtr NavigationControllerImpl::NavigateWithoutEntry( +@@ -3592,16 +3592,17 @@ base::WeakPtr NavigationControllerImpl::NavigateWithoutEntry( // Note: we intentionally leave the pending entry in place for renderer debug // URLs, unlike the cases below where we clear it if the navigation doesn't // proceed. diff --git a/patches/content-browser-renderer_host-navigation_request.cc.patch b/patches/content-browser-renderer_host-navigation_request.cc.patch index d278cedf4d19..c8479704563d 100644 --- a/patches/content-browser-renderer_host-navigation_request.cc.patch +++ b/patches/content-browser-renderer_host-navigation_request.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index 5cf177fc73dd2b3038754b11d23ad637e7709f88..12d8a7794339327f3436ccdee8570a5b5e224728 100644 +index 68b50260715c2a56bacf0f2e856f761c793ff143..058ac11f602dff9a6d4a32b6e97688b505c91d10 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -3268,6 +3268,7 @@ void NavigationRequest::OnRequestRedirected( +@@ -3279,6 +3279,7 @@ void NavigationRequest::OnRequestRedirected( common_params_->url = redirect_info.new_url; common_params_->method = redirect_info.new_method; common_params_->referrer->url = GURL(redirect_info.new_referrer); @@ -10,7 +10,7 @@ index 5cf177fc73dd2b3038754b11d23ad637e7709f88..12d8a7794339327f3436ccdee8570a5b common_params_->referrer = Referrer::SanitizeForRequest( common_params_->url, *common_params_->referrer); -@@ -4883,6 +4884,7 @@ void NavigationRequest::OnStartChecksComplete( +@@ -4906,6 +4907,7 @@ void NavigationRequest::OnStartChecksComplete( headers.MergeFrom(TakeModifiedRequestHeaders()); begin_params_->headers = headers.ToString(); diff --git a/patches/content-browser-renderer_host-render_frame_host_impl.cc.patch b/patches/content-browser-renderer_host-render_frame_host_impl.cc.patch index 59f489015665..673ffd8c9822 100644 --- a/patches/content-browser-renderer_host-render_frame_host_impl.cc.patch +++ b/patches/content-browser-renderer_host-render_frame_host_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index af16b1053e1f42887bf0fde97bba30a377857872..27bf8028dd47dfa49cfb9a250d54d86eb1bc17d1 100644 +index 44ab3ea5a90eb31e2bea636c7d7a9aedc4b1823a..e3ae0437718ad234f2632ffdf46635106e173376 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8273,6 +8273,8 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8168,6 +8168,8 @@ void RenderFrameHostImpl::CreateNewWindow( dom_storage_context, params->session_storage_namespace_id); } diff --git a/patches/content-browser-resources-gpu-info_view.ts.patch b/patches/content-browser-resources-gpu-info_view.ts.patch index ec88c8aff520..5e70b73cda2c 100644 --- a/patches/content-browser-resources-gpu-info_view.ts.patch +++ b/patches/content-browser-resources-gpu-info_view.ts.patch @@ -1,5 +1,5 @@ diff --git a/content/browser/resources/gpu/info_view.ts b/content/browser/resources/gpu/info_view.ts -index 918bf8b4f710f0de5302266098faace06aab83b6..aea6893096e52141177042b79b24b8757d906c39 100644 +index 68b8b8e9c946cbe2eadb5b5bc89c8655ad4ffb89..066822fcafa7c43fd52270ce680f78455ef6b858 100644 --- a/content/browser/resources/gpu/info_view.ts +++ b/content/browser/resources/gpu/info_view.ts @@ -537,6 +537,7 @@ export class InfoViewElement extends CustomElement { diff --git a/patches/content-browser-web_contents-web_contents_impl.cc.patch b/patches/content-browser-web_contents-web_contents_impl.cc.patch index 207d94887fd2..fa7de74ba901 100644 --- a/patches/content-browser-web_contents-web_contents_impl.cc.patch +++ b/patches/content-browser-web_contents-web_contents_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 6f1581c517bf6c4526d7831d50ce2ad0bc8d7531..32266e1af0324e7d3a1b50aeeab4cfd6f5828300 100644 +index 355f0d796d3c6f0481a1a807b4f22113e09c8029..2bb427d03b5615f6bea36e37a4af9a4c1b96a253 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4326,7 +4326,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4382,7 +4382,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( // Save the window for later if we're not suppressing the opener (since it // will be shown immediately). diff --git a/patches/content-browser-webui-web_ui_impl.cc.patch b/patches/content-browser-webui-web_ui_impl.cc.patch index 61c2b8eec6c9..11747bb6375c 100644 --- a/patches/content-browser-webui-web_ui_impl.cc.patch +++ b/patches/content-browser-webui-web_ui_impl.cc.patch @@ -1,10 +1,10 @@ diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc -index 2e7ce7db58a032081d49790b937ba0daef90ffc3..49f5bc68fccbfff04e7ed772f97cbb56ff38c0fc 100644 +index 15559900c52f7c697593720b6842826ec760d33b..d75a7a7f874e7693a4360c647db4606ea1b4f0e1 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc -@@ -82,6 +82,7 @@ WebUIImpl::WebUIImpl(WebContents* web_contents) - web_contents_(web_contents), - web_contents_observer_(new WebUIMainFrameObserver(this, web_contents_)) { +@@ -83,6 +83,7 @@ WebUIImpl::WebUIImpl(WebContents* web_contents) + web_contents_observer_( + std::make_unique(this, web_contents_)) { DCHECK(web_contents_); + BRAVE_WEB_UI_IMPL } diff --git a/patches/content-common-BUILD.gn.patch b/patches/content-common-BUILD.gn.patch index 1ea778b25b57..2ae85323d3b1 100644 --- a/patches/content-common-BUILD.gn.patch +++ b/patches/content-common-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn -index 9c9f6d58a8e5c1ed14eb60c722667d1a24d2c6fa..3470d80982a94b943f611c37ad5fe6ce6deedea0 100644 +index 0c72e7f246f3d0b46c4902dfbe0f9ec647e47c26..9e88a05886777314a3aa5326de52d33a10fb6ac6 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn @@ -67,6 +67,7 @@ source_set("common") { diff --git a/patches/content-common-frame.mojom.patch b/patches/content-common-frame.mojom.patch index 69b219889547..43dbf4b57ca7 100644 --- a/patches/content-common-frame.mojom.patch +++ b/patches/content-common-frame.mojom.patch @@ -1,8 +1,8 @@ diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index 3ddc93e18d353d5af31e28f8f8e682ea813db21c..2f968ed079f6cb04b6a90f0f4bc4dfa360f5bdf3 100644 +index e1d6dffca2e718f9e9b67525a1fe09abedfe077c..ec4605f6795d63a130adb418941dc9aa00e96de2 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom -@@ -574,6 +574,7 @@ struct CreateNewWindowParams { +@@ -552,6 +552,7 @@ struct CreateNewWindowParams { // Whether the opener will be suppressed in the new window, in which case // scripting the new window is not allowed. bool opener_suppressed; diff --git a/patches/content-public-browser-content_browser_client.h.patch b/patches/content-public-browser-content_browser_client.h.patch index cb5186a894f7..01b9c3dafe5e 100644 --- a/patches/content-public-browser-content_browser_client.h.patch +++ b/patches/content-public-browser-content_browser_client.h.patch @@ -1,8 +1,8 @@ diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index a6e922be7e68644ad1cfe64462712c0430c6749a..2c36598384733d9ad0d8e37c9c068a49466c2b65 100644 +index 8b4b26ed9f976438754c5ada0bd6193cf02891a5..174ecd90402bd55140ec33e2d29750c9d6a2920c 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -2216,6 +2216,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2242,6 +2242,7 @@ class CONTENT_EXPORT ContentBrowserClient { virtual ui::AXMode GetAXModeForBrowserContext( BrowserContext* browser_context); diff --git a/patches/content-renderer-render_frame_impl.cc.patch b/patches/content-renderer-render_frame_impl.cc.patch index 287ef57fa192..17ddd98d2233 100644 --- a/patches/content-renderer-render_frame_impl.cc.patch +++ b/patches/content-renderer-render_frame_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index ab92d5b8f710661d8b1c863423f0c0f7928646ba..36fbca713f83be765162aae67f85f7d90868449b 100644 +index 47a2bc8e75e24ca61772f65140bbb2f868e63788..471cae6e9f013037d00b783bcb6aed4a563e2070 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4531,6 +4531,7 @@ bool RenderFrameImpl::ShouldUseUserAgentOverride() const { +@@ -4498,6 +4498,7 @@ bool RenderFrameImpl::ShouldUseUserAgentOverride() const { // Temporarily return early and fix properly as part of // https://crbug.com/426555. if (web_view->MainFrame()->IsWebRemoteFrame()) diff --git a/patches/content-renderer-render_thread_impl.cc.patch b/patches/content-renderer-render_thread_impl.cc.patch index 3cebd3ee8f25..d5a483395c28 100644 --- a/patches/content-renderer-render_thread_impl.cc.patch +++ b/patches/content-renderer-render_thread_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 328ed025f6b71c34f2855a5a2983dee7e7081c11..fe6c1d2f3266faf7f5239bbfb59e3cdb187593ca 100644 +index 3c3ebfeec280e4d489121c4cfeba37c299753cd0..24ca41c201842e69a58b31f0fc2b3b613c7768e6 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -941,6 +941,7 @@ void RenderThreadImpl::InitializeRenderer( +@@ -903,6 +903,7 @@ void RenderThreadImpl::InitializeRenderer( } void RenderThreadImpl::RegisterSchemes() { diff --git a/patches/extensions-browser-api-web_request-extension_web_request_event_router.cc.patch b/patches/extensions-browser-api-web_request-extension_web_request_event_router.cc.patch index f24bb30ac2b2..843e1fbb3ba3 100644 --- a/patches/extensions-browser-api-web_request-extension_web_request_event_router.cc.patch +++ b/patches/extensions-browser-api-web_request-extension_web_request_event_router.cc.patch @@ -1,5 +1,5 @@ diff --git a/extensions/browser/api/web_request/extension_web_request_event_router.cc b/extensions/browser/api/web_request/extension_web_request_event_router.cc -index a8f8bf4e930361ca1f348b3684b8c0461a840ad3..eb134802a57d4ec2687172b09907a98feb23a16b 100644 +index 49b904570d579e01ca26e95b83f117124b66d6b6..9ba3bb69801010fbabdd2a89452a546fbb409096 100644 --- a/extensions/browser/api/web_request/extension_web_request_event_router.cc +++ b/extensions/browser/api/web_request/extension_web_request_event_router.cc @@ -1183,6 +1183,7 @@ ExtensionWebRequestEventRouter::OnAuthRequired( diff --git a/patches/extensions-common-api-_api_features.json.patch b/patches/extensions-common-api-_api_features.json.patch index 4fccbb1aa793..ed8cf4ae185c 100644 --- a/patches/extensions-common-api-_api_features.json.patch +++ b/patches/extensions-common-api-_api_features.json.patch @@ -1,8 +1,8 @@ diff --git a/extensions/common/api/_api_features.json b/extensions/common/api/_api_features.json -index ddf66ad5d842b1af5811c1ab521700396d01813f..7e246c45b9dff2cc8ddeb1697c9b0713df3294c0 100644 +index 54b6f448914bde46f7147ff503671655acb7d3b3..5e0615be15b1ba23961d1928ffea5889c5554ccd 100644 --- a/extensions/common/api/_api_features.json +++ b/extensions/common/api/_api_features.json -@@ -635,6 +635,7 @@ +@@ -634,6 +634,7 @@ "matches": [ "chrome://password-change/*", "chrome://file-manager/*" diff --git a/patches/google_apis-google_api_keys.cc.patch b/patches/google_apis-google_api_keys.cc.patch index 13a20bf43192..698c1596dd44 100644 --- a/patches/google_apis-google_api_keys.cc.patch +++ b/patches/google_apis-google_api_keys.cc.patch @@ -1,8 +1,8 @@ diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc -index dd27a1b0f7618fbfadf218cebf218733c17a5b9f..683aa3e722c518896b7b05383090654b27a73669 100644 +index 49c396d69d17236560751307e01dc79ea9693b3a..686ec82034a7cef46ce9faa07ea0df40663d3be2 100644 --- a/google_apis/google_api_keys.cc +++ b/google_apis/google_api_keys.cc -@@ -216,6 +216,7 @@ class APIKeyCache { +@@ -228,6 +228,7 @@ class APIKeyCache { #if BUILDFLAG(SUPPORT_EXTERNAL_GOOGLE_API_KEY) void set_api_key(const std::string& api_key) { api_key_ = api_key; } #endif diff --git a/patches/headless-BUILD.gn.patch b/patches/headless-BUILD.gn.patch deleted file mode 100644 index 712f21488b2f..000000000000 --- a/patches/headless-BUILD.gn.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/headless/BUILD.gn b/headless/BUILD.gn -index d329d589ef552b798049e2419c98b3f2f79a837f..6415b33bf87293de315be7fc942db661978d34a0 100644 ---- a/headless/BUILD.gn -+++ b/headless/BUILD.gn -@@ -96,7 +96,7 @@ repack("resource_pack_strings") { - if (is_chrome_branded) { - sources += [ "${root_gen_dir}/components/strings/components_google_chrome_strings_en-US.pak" ] - } else { -- sources += [ "${root_gen_dir}/components/strings/components_chromium_strings_en-US.pak" ] -+ sources += [ "${root_gen_dir}/components/strings/components_${branding_path_product}_strings_en-US.pak" ] - } - - deps = [ diff --git a/patches/ios-chrome-app-BUILD.gn.patch b/patches/ios-chrome-app-BUILD.gn.patch index 88a94187d867..0f7e0bd60af0 100644 --- a/patches/ios-chrome-app-BUILD.gn.patch +++ b/patches/ios-chrome-app-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn -index d104fc75d518428acdab00ad9881c2245b114704..f23b7177470d753c078ca4f15e62d2e149883a30 100644 +index 73839800df48b1cda8c2b75b2d3368e8bf522def..9cf1cab9437accc46eb82ef4ba32d697e51e8868 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn -@@ -729,8 +729,7 @@ chrome_app("chrome") { +@@ -735,8 +735,7 @@ chrome_app("chrome") { # (see https://crbug.com/1394553 for details of the build failure). This # is a stop-gap solution. if (target_environment == "catalyst" || diff --git a/patches/ios-chrome-browser-shared-model-prefs-browser_prefs.mm.patch b/patches/ios-chrome-browser-shared-model-prefs-browser_prefs.mm.patch index 764cdf16c7e3..155e0089a378 100644 --- a/patches/ios-chrome-browser-shared-model-prefs-browser_prefs.mm.patch +++ b/patches/ios-chrome-browser-shared-model-prefs-browser_prefs.mm.patch @@ -1,27 +1,27 @@ diff --git a/ios/chrome/browser/shared/model/prefs/browser_prefs.mm b/ios/chrome/browser/shared/model/prefs/browser_prefs.mm -index 6ee67529756cf1c2856253cc5ff7a3c4997ab3a4..1852a7e73224fb37495329a172eeb767436a8e1b 100644 +index 90086b2fd3575155daa16c896c2be453313c33d7..afb83c5e51834c04c0b973a096f205d640904c1b 100644 --- a/ios/chrome/browser/shared/model/prefs/browser_prefs.mm +++ b/ios/chrome/browser/shared/model/prefs/browser_prefs.mm -@@ -322,6 +322,7 @@ void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { - // refactored to use the new Safety Check Manager. - registry->RegisterTimePref(prefs::kIosSettingsSafetyCheckLastRunTime, - base::Time()); +@@ -350,6 +350,7 @@ void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { + registry->RegisterIntegerPref(kAppStoreRatingTotalDaysOnChromeKey, 0); + registry->RegisterListPref(kAppStoreRatingActiveDaysInPastWeekKey); + registry->RegisterTimePref(kAppStoreRatingLastShownPromoDayKey, base::Time()); + BRAVE_REGISTER_LOCAL_STATE_PREFS } void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { -@@ -512,6 +513,7 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { - - // Register prefs used to skip too frequent History Sync Opt-In prompt. - history_sync::RegisterBrowserStatePrefs(registry); +@@ -553,6 +554,7 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { + // Preference related to feed. + registry->RegisterTimePref(kActivityBucketLastReportedDateKey, base::Time()); + registry->RegisterBooleanPref(kSyncRequested, false); + BRAVE_REGISTER_BROWSER_STATE_PREFS } // This method should be periodically pruned of year+ old migrations. -@@ -600,6 +602,7 @@ void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { - invalidation::InvalidatorRegistrarWithMemory::ClearDeprecatedPrefs(prefs); - invalidation::PerUserTopicSubscriptionManager::ClearDeprecatedPrefs(prefs); - invalidation::FCMInvalidationService::ClearDeprecatedPrefs(prefs); +@@ -708,6 +710,7 @@ void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { + + // Added 10/2023. + prefs->ClearPref(kSyncRequested); + BRAVE_MIGRATE_OBSOLETE_BROWSER_STATE_PREFS } diff --git a/patches/ios-chrome-browser-sync-sync_service_factory.mm.patch b/patches/ios-chrome-browser-sync-model-sync_service_factory.mm.patch similarity index 53% rename from patches/ios-chrome-browser-sync-sync_service_factory.mm.patch rename to patches/ios-chrome-browser-sync-model-sync_service_factory.mm.patch index 871b2cd661df..da304ce49463 100644 --- a/patches/ios-chrome-browser-sync-sync_service_factory.mm.patch +++ b/patches/ios-chrome-browser-sync-model-sync_service_factory.mm.patch @@ -1,7 +1,7 @@ -diff --git a/ios/chrome/browser/sync/sync_service_factory.mm b/ios/chrome/browser/sync/sync_service_factory.mm -index de6b49b5ab55d37cd55b57877cccfcf994af0628..ee4938602728ac1267952d7de9291a3bceab1bd8 100644 ---- a/ios/chrome/browser/sync/sync_service_factory.mm -+++ b/ios/chrome/browser/sync/sync_service_factory.mm +diff --git a/ios/chrome/browser/sync/model/sync_service_factory.mm b/ios/chrome/browser/sync/model/sync_service_factory.mm +index c909f633d9f4847ecec73ea0d6f7b15be75ef68c..25266da9431dccaeb7bd92a9116a7d95abeb68dc 100644 +--- a/ios/chrome/browser/sync/model/sync_service_factory.mm ++++ b/ios/chrome/browser/sync/model/sync_service_factory.mm @@ -97,7 +97,7 @@ std::unique_ptr BuildSyncService(web::BrowserState* context) { init_params.debug_identifier = browser_state->GetDebugName(); diff --git a/patches/mojo-public-tools-bindings-checks-mojom_attributes_check.py.patch b/patches/mojo-public-tools-bindings-checks-mojom_attributes_check.py.patch index 88f6a990a3e8..6ac0b6bb6277 100644 --- a/patches/mojo-public-tools-bindings-checks-mojom_attributes_check.py.patch +++ b/patches/mojo-public-tools-bindings-checks-mojom_attributes_check.py.patch @@ -1,5 +1,5 @@ diff --git a/mojo/public/tools/bindings/checks/mojom_attributes_check.py b/mojo/public/tools/bindings/checks/mojom_attributes_check.py -index 3a2d2a3bffc898ad083e0c8d191159e4d56ff39f..77b1598edc88ef6272c8a71711847831a18ab476 100644 +index 77638f2d7e7082232ac7120f05fcb08f1f78d7f1..a582d832d09bbb58bfbed6aa5156640cadc149cb 100644 --- a/mojo/public/tools/bindings/checks/mojom_attributes_check.py +++ b/mojo/public/tools/bindings/checks/mojom_attributes_check.py @@ -7,6 +7,7 @@ import mojom.generate.check as check diff --git a/patches/net-BUILD.gn.patch b/patches/net-BUILD.gn.patch index c292ca35a1e2..841c207825ce 100644 --- a/patches/net-BUILD.gn.patch +++ b/patches/net-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/net/BUILD.gn b/net/BUILD.gn -index f0493cfd8456000f88f1536e908fdc8ace227a28..06daf7bb2625610670494a295c73d1d206179e37 100644 +index d118c5eb32477ea9007ead268830a76a84eab5cd..5d8077dd38104e403e73ea6f4e87a44051c35ee8 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -1160,6 +1160,7 @@ component("net") { +@@ -1158,6 +1158,7 @@ component("net") { "reporting/reporting_uploader.h", ] } diff --git a/patches/net-cookies-canonical_cookie.cc.patch b/patches/net-cookies-canonical_cookie.cc.patch index 1436df41dcc5..c23f25950715 100644 --- a/patches/net-cookies-canonical_cookie.cc.patch +++ b/patches/net-cookies-canonical_cookie.cc.patch @@ -1,8 +1,8 @@ diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc -index 089443aab299000b7a10b42b90f3367318aa7730..2469311431c23816a773536d3eadfbe48dfe8603 100644 +index 3c2bd0edc19569e60454826c36ce6b01cb720b9e..e7c48e907db1855dded2166af8f691739133dc09 100644 --- a/net/cookies/canonical_cookie.cc +++ b/net/cookies/canonical_cookie.cc -@@ -514,6 +514,7 @@ base::Time CanonicalCookie::ValidateAndAdjustExpiryDate( +@@ -515,6 +515,7 @@ base::Time CanonicalCookie::ValidateAndAdjustExpiryDate( // * network_handler.cc::MakeCookieFromProtocolValues fixed_creation_date = base::Time::Now(); } diff --git a/patches/net-dns-BUILD.gn.patch b/patches/net-dns-BUILD.gn.patch index 693d600b69d8..ec489dc8e842 100644 --- a/patches/net-dns-BUILD.gn.patch +++ b/patches/net-dns-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn -index 6eb142954e6a9b2a3937dbf3ae733f330865c9da..51803878a2102be4cfe8185fe55299a7c2ebe2c3 100644 +index f36bf682ffdeaf69da34a4f9e18465dde4e3a9a3..a15286f7dc22cfd8fd07928feba55564a6f7a9f5 100644 --- a/net/dns/BUILD.gn +++ b/net/dns/BUILD.gn @@ -98,6 +98,7 @@ source_set("dns") { diff --git a/patches/net-http-transport_security_state.cc.patch b/patches/net-http-transport_security_state.cc.patch index fef0377e58ad..bb5686380ff9 100644 --- a/patches/net-http-transport_security_state.cc.patch +++ b/patches/net-http-transport_security_state.cc.patch @@ -1,8 +1,8 @@ diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc -index 84d67ed5cd3b994f9bebcf13025a132ff310f7e4..6c64de818aaa335433d93ebbec92b958cd596d5e 100644 +index 7ea8987ce6ec3eb5993187a36d1bd27f1cde8cb4..e0781e6ab922ab6fd5227f209661dc651cb8c499 100644 --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc -@@ -382,6 +382,7 @@ TransportSecurityState::TransportSecurityState( +@@ -392,6 +392,7 @@ TransportSecurityState::TransportSecurityState( // others don't end up with pins that cannot be easily updated. #if !BUILDFLAG(GOOGLE_CHROME_BRANDING) || BUILDFLAG(IS_IOS) enable_static_pins_ = false; diff --git a/patches/sandbox-policy-win-sandbox_win.cc.patch b/patches/sandbox-policy-win-sandbox_win.cc.patch index feaae60b2ad2..a1b500ae8357 100644 --- a/patches/sandbox-policy-win-sandbox_win.cc.patch +++ b/patches/sandbox-policy-win-sandbox_win.cc.patch @@ -1,8 +1,8 @@ diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc -index 3add6ba6997a36738bd0421641c91c477936241a..5967d028bed18f1b1e4fdd108b537bb24704216a 100644 +index fc31388dc32322c2a7a77b8d468bacfcb3e28b23..75248e04a2ca14f3924eef919466faea1f3cc26a 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc -@@ -717,6 +717,7 @@ ResultCode LaunchWithoutSandbox( +@@ -726,6 +726,7 @@ ResultCode LaunchWithoutSandbox( base::Process* process) { base::LaunchOptions options; options.handles_to_inherit = handles_to_inherit; diff --git a/patches/services-network-cookie_manager.cc.patch b/patches/services-network-cookie_manager.cc.patch index e695fb2ec4e7..630b28705f07 100644 --- a/patches/services-network-cookie_manager.cc.patch +++ b/patches/services-network-cookie_manager.cc.patch @@ -1,8 +1,8 @@ diff --git a/services/network/cookie_manager.cc b/services/network/cookie_manager.cc -index 6c804ec1092afbec3e23759077e2e9b02f8c136f..003f2d437f72a56f672522d5fbe2b136f96084c8 100644 +index b43998a09b981e9e8b467f03c387a30bc4b3715f..efa008717690df1a3eb5c7a209a4e09ac3024fae 100644 --- a/services/network/cookie_manager.cc +++ b/services/network/cookie_manager.cc -@@ -406,6 +406,7 @@ CookieDeletionInfo DeletionFilterToInfo(mojom::CookieDeletionFilterPtr filter) { +@@ -414,6 +414,7 @@ CookieDeletionInfo DeletionFilterToInfo(mojom::CookieDeletionFilterPtr filter) { delete_info.name = std::move(filter->cookie_name); delete_info.url = std::move(filter->url); delete_info.host = std::move(filter->host_name); diff --git a/patches/services-network-cors-cors_url_loader.cc.patch b/patches/services-network-cors-cors_url_loader.cc.patch index b04d5c647087..bd14cd30ad63 100644 --- a/patches/services-network-cors-cors_url_loader.cc.patch +++ b/patches/services-network-cors-cors_url_loader.cc.patch @@ -1,8 +1,8 @@ diff --git a/services/network/cors/cors_url_loader.cc b/services/network/cors/cors_url_loader.cc -index 9314bc134c9a47d362e0a7ca27be2a1f1e54ae03..b2ae6c80403477e60c755fd333ca44de4779d0f0 100644 +index 9ea8a48462d8b2436f28aa14c489a39b19717098..b59976fec32330c82eb549a1f035da75f6a045a8 100644 --- a/services/network/cors/cors_url_loader.cc +++ b/services/network/cors/cors_url_loader.cc -@@ -820,6 +820,7 @@ void CorsURLLoader::StartRequest() { +@@ -822,6 +822,7 @@ void CorsURLLoader::StartRequest() { (fetch_cors_flag_ || (request_.method != net::HttpRequestHeaders::kGetMethod && request_.method != net::HttpRequestHeaders::kHeadMethod))) { diff --git a/patches/services-network-public-cpp-BUILD.gn.patch b/patches/services-network-public-cpp-BUILD.gn.patch index f154a68d3405..0bdf2160d38e 100644 --- a/patches/services-network-public-cpp-BUILD.gn.patch +++ b/patches/services-network-public-cpp-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn -index 1ffcf713159f42639f664411471f2f2ffe135c97..45a8d8aededa7ee69fa72ccdd84d9a5034aa1bb3 100644 +index 36fef15c6ac43000f6a8e9d5283b6aabb19663ea..b2f110868c9ddfdff729a3d6bc391d154d4a1364 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn -@@ -189,6 +189,7 @@ component("cpp") { +@@ -187,6 +187,7 @@ component("cpp") { "//services/proxy_resolver/public/mojom", ] diff --git a/patches/third_party-android_deps-BUILD.gn.patch b/patches/third_party-android_deps-BUILD.gn.patch index e3341212f9d9..ce41bb9d1160 100644 --- a/patches/third_party-android_deps-BUILD.gn.patch +++ b/patches/third_party-android_deps-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn -index a3c3f30248b91a035e5bc0ad9d32fe5a3b94326a..0a9116e7478c59e2ba45ca1347e10fdcf328ad58 100644 +index 279c07239a8dd4bbea7edeb9a396dc4ad920ca68..a7c8498c7c5a37638a2cf062bed61aebc57e0262 100644 --- a/third_party/android_deps/BUILD.gn +++ b/third_party/android_deps/BUILD.gn -@@ -464,6 +464,7 @@ java_prebuilt("com_google_auto_value_auto_value_annotations_java") { +@@ -465,6 +465,7 @@ java_prebuilt("com_google_auto_value_auto_value_annotations_java") { ":*", "//third_party/androidx:*", ] diff --git a/patches/third_party-blink-renderer-bindings-core-v8-v8_script_runner.cc.patch b/patches/third_party-blink-renderer-bindings-core-v8-v8_script_runner.cc.patch index 2419cc9614c8..016713e2e8d9 100644 --- a/patches/third_party-blink-renderer-bindings-core-v8-v8_script_runner.cc.patch +++ b/patches/third_party-blink-renderer-bindings-core-v8-v8_script_runner.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc b/third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc -index f9549008635e07d66a507c1db7d455f17d3551c9..2339bae5d48d93b9ea5387067439c4394caad038 100644 +index 9e64e825dd91f95ab53fde2b6127505335334b19..a14cf84d2dd8b91f9531d76d868ff6cbb0a6ded8 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc -@@ -218,7 +218,7 @@ int GetMicrotasksScopeDepth(v8::Isolate* isolate, +@@ -246,7 +246,7 @@ int GetMicrotasksScopeDepth(v8::Isolate* isolate, } // namespace @@ -11,7 +11,7 @@ index f9549008635e07d66a507c1db7d455f17d3551c9..2339bae5d48d93b9ea5387067439c439 ScriptState* script_state, const ClassicScript& classic_script, v8::ScriptOrigin origin, -@@ -262,7 +262,7 @@ v8::MaybeLocal V8ScriptRunner::CompileScript( +@@ -290,7 +290,7 @@ v8::MaybeLocal V8ScriptRunner::CompileScript( return script; } diff --git a/patches/third_party-blink-renderer-bindings-generated_in_modules.gni.patch b/patches/third_party-blink-renderer-bindings-generated_in_modules.gni.patch index f06e948a0ac3..ab96201226be 100644 --- a/patches/third_party-blink-renderer-bindings-generated_in_modules.gni.patch +++ b/patches/third_party-blink-renderer-bindings-generated_in_modules.gni.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni -index f1916c51f3b1d516e3abc81f2260cea12f6fd6ea..6ea364349ee1dfabad22d8554e94327e46f213c5 100644 +index c465f78ddbfa9e8b92be0fafd25f9d083a54e8d9..06f171121c637ad1e7abe27d25219fd0ba9e0c7c 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni -@@ -2860,6 +2860,7 @@ generated_interface_sources_in_modules = [ +@@ -2866,6 +2866,7 @@ generated_interface_sources_in_modules = [ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_webgl_sub_image.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_webgl_sub_image.h", ] diff --git a/patches/third_party-blink-renderer-bindings-idl_in_modules.gni.patch b/patches/third_party-blink-renderer-bindings-idl_in_modules.gni.patch index 480bab107ed6..f8cdeae95d61 100644 --- a/patches/third_party-blink-renderer-bindings-idl_in_modules.gni.patch +++ b/patches/third_party-blink-renderer-bindings-idl_in_modules.gni.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/bindings/idl_in_modules.gni b/third_party/blink/renderer/bindings/idl_in_modules.gni -index 3f966143497fd1ce6c0b8ddae2fde7b2d47652ea..770327952357b180a4caa5a3e8aaec3196274013 100644 +index 13c5b2d4c561d6b0d175a6f4fc580e502045a77f..671567454baaa339d64a6c9e164d78943343fe87 100644 --- a/third_party/blink/renderer/bindings/idl_in_modules.gni +++ b/third_party/blink/renderer/bindings/idl_in_modules.gni -@@ -1227,6 +1227,7 @@ static_idl_files_in_modules = [ +@@ -1228,6 +1228,7 @@ static_idl_files_in_modules = [ "//third_party/blink/renderer/modules/xr/xr_webgl_layer_init.idl", "//third_party/blink/renderer/modules/xr/xr_webgl_sub_image.idl", ] diff --git a/patches/third_party-blink-renderer-bindings-scripts-bind_gen-interface.py.patch b/patches/third_party-blink-renderer-bindings-scripts-bind_gen-interface.py.patch index 6a1f483ee059..f034937f3724 100644 --- a/patches/third_party-blink-renderer-bindings-scripts-bind_gen-interface.py.patch +++ b/patches/third_party-blink-renderer-bindings-scripts-bind_gen-interface.py.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py -index 80d594c125bd32f8cef2e22d4f5c0617460a9371..ac44d627a12f634b502a07801a47dd337250ec2b 100644 +index a913b474320128ccf6a2a83c371fffa7e1540a69..5811f0da45feddb11164a14ec2fe7a12641f6e92 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py -@@ -7787,3 +7787,4 @@ def generate_interfaces(task_queue): +@@ -7529,3 +7529,4 @@ def generate_interfaces(task_queue): "InitIDLInterfacesForTesting", "init_idl_interfaces_for_testing", for_testing=True) diff --git a/patches/third_party-blink-renderer-core-BUILD.gn.patch b/patches/third_party-blink-renderer-core-BUILD.gn.patch index 841f1cae1bbd..8b3f3feac088 100644 --- a/patches/third_party-blink-renderer-core-BUILD.gn.patch +++ b/patches/third_party-blink-renderer-core-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn -index d06b485aebb64def0f082b4f1627c7b69b91a29c..e983fa2d1082860e57f7d8e7eae61c4d7a595203 100644 +index 77c1ee82fc5cca302148445fb6f2f975bb41c23e..ff0638035461ad5a128927d7cb79e39825f23a51 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn -@@ -399,6 +399,7 @@ component("core") { +@@ -404,6 +404,7 @@ component("core") { "Carbon.framework", ] } diff --git a/patches/third_party-blink-renderer-core-dom-events-event_target.cc.patch b/patches/third_party-blink-renderer-core-dom-events-event_target.cc.patch index 8efad4b8fa4f..33dd0e50b4a3 100644 --- a/patches/third_party-blink-renderer-core-dom-events-event_target.cc.patch +++ b/patches/third_party-blink-renderer-core-dom-events-event_target.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/dom/events/event_target.cc b/third_party/blink/renderer/core/dom/events/event_target.cc -index b50afe96d2e2790ed91403c0a5bb143637cead76..224ba30a17ca1575a7c031a1d90dfe32c8044405 100644 +index bee8b3e5b50dbfb85a3e5b1d62f9f9ba2e0cd1ba..b7139ad2ea11f6340fd6567127392df0ba00011c 100644 --- a/third_party/blink/renderer/core/dom/events/event_target.cc +++ b/third_party/blink/renderer/core/dom/events/event_target.cc -@@ -478,6 +478,7 @@ bool EventTarget::AddEventListenerInternal( +@@ -479,6 +479,7 @@ bool EventTarget::AddEventListenerInternal( event_type, listener, options, ®istered_listener); if (added) { CHECK(registered_listener); @@ -10,7 +10,7 @@ index b50afe96d2e2790ed91403c0a5bb143637cead76..224ba30a17ca1575a7c031a1d90dfe32 if (options->hasSignal()) { // Instead of passing the entire |options| here, which could create a // circular reference due to |options| holding a Member, just -@@ -640,6 +641,7 @@ bool EventTarget::RemoveEventListenerInternal( +@@ -641,6 +642,7 @@ bool EventTarget::RemoveEventListenerInternal( ®istered_listener)) { return false; } diff --git a/patches/third_party-blink-renderer-core-frame-dom_window.h.patch b/patches/third_party-blink-renderer-core-frame-dom_window.h.patch index 8f437e7f0334..f15b0b50ff5b 100644 --- a/patches/third_party-blink-renderer-core-frame-dom_window.h.patch +++ b/patches/third_party-blink-renderer-core-frame-dom_window.h.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/frame/dom_window.h b/third_party/blink/renderer/core/frame/dom_window.h -index 4787918edaf3495351c2e50d22f522d870eb7b58..6716ac810f34d16f269d48145361cea61cbcb677 100644 +index d2de262bb6aa6ca54f0df4ff30d085a30b3e74ac..f31d7347d49f20acb25299d34fdde7b153060321 100644 --- a/third_party/blink/renderer/core/frame/dom_window.h +++ b/third_party/blink/renderer/core/frame/dom_window.h -@@ -193,6 +193,7 @@ class CORE_EXPORT DOMWindow : public EventTarget { +@@ -191,6 +191,7 @@ class CORE_EXPORT DOMWindow : public WindowProperties { void DisconnectFromFrame() { frame_ = nullptr; } diff --git a/patches/third_party-blink-renderer-core-html-canvas-canvas_async_blob_creator.cc.patch b/patches/third_party-blink-renderer-core-html-canvas-canvas_async_blob_creator.cc.patch index c95ec92b1566..5c35b2864cea 100644 --- a/patches/third_party-blink-renderer-core-html-canvas-canvas_async_blob_creator.cc.patch +++ b/patches/third_party-blink-renderer-core-html-canvas-canvas_async_blob_creator.cc.patch @@ -1,5 +1,5 @@ diff --git a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc b/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc -index 55a81b142ec864f4fd16be2dc5f9eea10687ab87..07e34ce26fd2aff861cd6282ebbf84488b3f5a02 100644 +index e3a0c7a8250b145b4e42cb079d3479784272e5e5..5d685d7f7eaddde103af1a39c688ae473f0d06b7 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc +++ b/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc @@ -209,6 +209,7 @@ CanvasAsyncBlobCreator::CanvasAsyncBlobCreator( diff --git a/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.cc.patch b/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.cc.patch index 38ecdde3a292..8e1ecceac8a7 100644 --- a/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.cc.patch +++ b/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc -index 3a4a1fbcc1ef3a8b7e454076a0e6ce9efa775e9e..147cb250de2a92e91a94b14074c0b50b89080c57 100644 +index 91970745c9151194d41b63aa2f5e0f3b266acc5a..733be1ef94e3c86788fa46aec477f63210665c6b 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc -@@ -1170,6 +1170,7 @@ String HTMLCanvasElement::ToDataURLInternal( +@@ -1157,6 +1157,7 @@ String HTMLCanvasElement::ToDataURLInternal( if (!data_buffer) return String("data:,"); diff --git a/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.h.patch b/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.h.patch index 9a427dc389a2..d642fcccb219 100644 --- a/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.h.patch +++ b/patches/third_party-blink-renderer-core-html-canvas-html_canvas_element.h.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h -index fa8f2ded75f0c3de33afd11634aa8f0b5c80d3a1..87e56290ce925b7f1f0a914eafd013347c532296 100644 +index 2b6490f2f828dc17a177ee2443f9caabb628a713..2063e10e3f9fc77f227a5fa20ed33e51151f623b 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h -@@ -316,6 +316,7 @@ class CORE_EXPORT HTMLCanvasElement final +@@ -317,6 +317,7 @@ class CORE_EXPORT HTMLCanvasElement final bool ShouldDisableAccelerationBecauseOfReadback() const; diff --git a/patches/third_party-blink-renderer-core-loader-mixed_content_checker.cc.patch b/patches/third_party-blink-renderer-core-loader-mixed_content_checker.cc.patch index 515040df363f..323e0b91534c 100644 --- a/patches/third_party-blink-renderer-core-loader-mixed_content_checker.cc.patch +++ b/patches/third_party-blink-renderer-core-loader-mixed_content_checker.cc.patch @@ -1,5 +1,5 @@ diff --git a/third_party/blink/renderer/core/loader/mixed_content_checker.cc b/third_party/blink/renderer/core/loader/mixed_content_checker.cc -index 9740fcb48303171f40192cab4e9087c28f6edb58..10761b01ecb4b7c24145002ba7d1726ca37b3335 100644 +index 61f92a3d374319bbc7f9eda3d10cfde5056937a2..8b19db10aedc7752715afd39052a89825794cd29 100644 --- a/third_party/blink/renderer/core/loader/mixed_content_checker.cc +++ b/third_party/blink/renderer/core/loader/mixed_content_checker.cc @@ -270,6 +270,7 @@ bool RequestIsSubframeSubresource(Frame* frame) { diff --git a/patches/third_party-blink-renderer-core-loader-mixed_content_checker.h.patch b/patches/third_party-blink-renderer-core-loader-mixed_content_checker.h.patch index cb4bf393e9d5..111b48d997eb 100644 --- a/patches/third_party-blink-renderer-core-loader-mixed_content_checker.h.patch +++ b/patches/third_party-blink-renderer-core-loader-mixed_content_checker.h.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/loader/mixed_content_checker.h b/third_party/blink/renderer/core/loader/mixed_content_checker.h -index 21731cfb406e9c46d9fdaf0b840a74b2facbd894..8a379ff962193d83daa7e3893f31c1d7bacc22f5 100644 +index ae26697491949cc06b7efb036d0ea9cbe9740e87..a6da7314b6695e77297b6f5da192324acff5b830 100644 --- a/third_party/blink/renderer/core/loader/mixed_content_checker.h +++ b/third_party/blink/renderer/core/loader/mixed_content_checker.h -@@ -98,7 +98,6 @@ class CORE_EXPORT MixedContentChecker final { +@@ -99,7 +99,6 @@ class CORE_EXPORT MixedContentChecker final { static bool IsWebSocketAllowed(WorkerFetchContext&, const KURL&); static bool IsMixedContent(const SecurityOrigin*, const KURL&); diff --git a/patches/third_party-blink-renderer-core-permissions_policy-permissions_policy_features.json5.patch b/patches/third_party-blink-renderer-core-permissions_policy-permissions_policy_features.json5.patch index fbe25cc9974e..590d0f24d940 100644 --- a/patches/third_party-blink-renderer-core-permissions_policy-permissions_policy_features.json5.patch +++ b/patches/third_party-blink-renderer-core-permissions_policy-permissions_policy_features.json5.patch @@ -1,10 +1,10 @@ diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 -index 8066dafa639c5d6e6cc4b954b778de1e9ddf3c93..59f6b4f87b7845e0ca93a62fc5162a7d9c87ec98 100644 +index d85afb91d6568d819e3d11aaaf64e92c9f3be6f8..049184b8a864a4365a34853a547daa4cb49c2977 100644 --- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 +++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 @@ -428,5 +428,13 @@ - // Parser also accepts "window-management" alias (crbug.com/1328581). - permissions_policy_name: "window-placement", + // Parser also accepts "window-placement" alias (crbug.com/1328581). + permissions_policy_name: "window-management", }, + { + name: "Ethereum", diff --git a/patches/third_party-blink-renderer-core-probe-BUILD.gn.patch b/patches/third_party-blink-renderer-core-probe-BUILD.gn.patch index 9f0ea3c7b29f..2a0a74e49734 100644 --- a/patches/third_party-blink-renderer-core-probe-BUILD.gn.patch +++ b/patches/third_party-blink-renderer-core-probe-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/third_party/blink/renderer/core/probe/BUILD.gn b/third_party/blink/renderer/core/probe/BUILD.gn -index 81e01c4d71515468d10a5f2e5e5a4b8cecca2279..236c147b87dd8495cb7282b9aec40a5976306bb6 100644 +index 63dd606c335db95925047ef6d448b4aadf644d47..71287891f64edd2381bb9f2d3d00d8363228e6d1 100644 --- a/third_party/blink/renderer/core/probe/BUILD.gn +++ b/third_party/blink/renderer/core/probe/BUILD.gn @@ -34,6 +34,7 @@ template("probe_generator") { diff --git a/patches/third_party-blink-renderer-core-script-script_loader.cc.patch b/patches/third_party-blink-renderer-core-script-script_loader.cc.patch index b2b009508082..82c4dce984fe 100644 --- a/patches/third_party-blink-renderer-core-script-script_loader.cc.patch +++ b/patches/third_party-blink-renderer-core-script-script_loader.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/core/script/script_loader.cc b/third_party/blink/renderer/core/script/script_loader.cc -index 2e2ce4cbd72d6b6847d5b228531657f5a0b192ea..900b6458502858a7ca214a5088526a1cb3713b69 100644 +index 0c2bb469e0bb1ad74f7e2c9e40e8458c9a56e301..68d1d3f58c8b463d93052a3cfe8b553ee5fe5f7d 100644 --- a/third_party/blink/renderer/core/script/script_loader.cc +++ b/third_party/blink/renderer/core/script/script_loader.cc -@@ -727,6 +727,7 @@ PendingScript* ScriptLoader::PrepareScript( +@@ -726,6 +726,7 @@ PendingScript* ScriptLoader::PrepareScript( parser_state, credentials_mode, referrer_policy, fetch_priority_hint, render_blocking_behavior, RejectCoepUnsafeNone(false)); diff --git a/patches/third_party-blink-renderer-modules-BUILD.gn.patch b/patches/third_party-blink-renderer-modules-BUILD.gn.patch index 7bd571ed3f02..b259d45ff4a8 100644 --- a/patches/third_party-blink-renderer-modules-BUILD.gn.patch +++ b/patches/third_party-blink-renderer-modules-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn -index 55b20f0065a8ba84f40305592567397be4491fd5..d71052bf686536be516a570ef5a1cf7b4e936d65 100644 +index 7bb7e10fdf59cc028a1c09b9403acc36b41b6e93..1f7bd673224ee41aad60a1bb328dac9123e5e3cd 100644 --- a/third_party/blink/renderer/modules/BUILD.gn +++ b/third_party/blink/renderer/modules/BUILD.gn @@ -19,6 +19,7 @@ if (is_ios) { diff --git a/patches/third_party-blink-renderer-modules-canvas-canvas2d-base_rendering_context_2d.cc.patch b/patches/third_party-blink-renderer-modules-canvas-canvas2d-base_rendering_context_2d.cc.patch index 2eb5648da21a..b2242a6490cf 100644 --- a/patches/third_party-blink-renderer-modules-canvas-canvas2d-base_rendering_context_2d.cc.patch +++ b/patches/third_party-blink-renderer-modules-canvas-canvas2d-base_rendering_context_2d.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc -index f09459b0b67c37d307c70a516731d05db49f49b8..83cbc9acdb3810fc6bc59d1b14d32fc3d25624ce 100644 +index 93026f739af5b163a7e7a8623cac71b5395560a9..132d21644118bbde7bcd5fcfbb26ded5ad693017 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc +++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc -@@ -2047,6 +2047,7 @@ ImageData* BaseRenderingContext2D::getImageData( +@@ -2046,6 +2046,7 @@ ImageData* BaseRenderingContext2D::getImageData( } ImageData* BaseRenderingContext2D::getImageDataInternal( @@ -10,7 +10,7 @@ index f09459b0b67c37d307c70a516731d05db49f49b8..83cbc9acdb3810fc6bc59d1b14d32fc3 int sx, int sy, int sw, -@@ -2189,6 +2190,7 @@ ImageData* BaseRenderingContext2D::getImageDataInternal( +@@ -2188,6 +2189,7 @@ ImageData* BaseRenderingContext2D::getImageDataInternal( DCHECK(!bounds.intersect(SkIRect::MakeXYWH(sx, sy, sw, sh))); } } @@ -18,7 +18,7 @@ index f09459b0b67c37d307c70a516731d05db49f49b8..83cbc9acdb3810fc6bc59d1b14d32fc3 return image_data; } -@@ -2858,6 +2860,7 @@ TextMetrics* BaseRenderingContext2D::measureText(const String& text) { +@@ -2857,6 +2859,7 @@ TextMetrics* BaseRenderingContext2D::measureText(const String& text) { return MakeGarbageCollected(); } diff --git a/patches/third_party-blink-renderer-modules-mediastream-media_devices.cc.patch b/patches/third_party-blink-renderer-modules-mediastream-media_devices.cc.patch index e02e6cb0e58a..07dcef574b6b 100644 --- a/patches/third_party-blink-renderer-modules-mediastream-media_devices.cc.patch +++ b/patches/third_party-blink-renderer-modules-mediastream-media_devices.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/modules/mediastream/media_devices.cc b/third_party/blink/renderer/modules/mediastream/media_devices.cc -index 963bfe70c3a53e7e5e72b300da1e60b8f0f0d403..0938f2d5460b3c6ce01d3240eeefe2feb39e1bf4 100644 +index a309e51ee13bf829c0b472b42c40437ccd213bad..39a25429e6185091f3e245ea6af0d5b8b68d16e7 100644 --- a/third_party/blink/renderer/modules/mediastream/media_devices.cc +++ b/third_party/blink/renderer/modules/mediastream/media_devices.cc -@@ -1005,6 +1005,7 @@ void MediaDevices::DevicesEnumerated( +@@ -1008,6 +1008,7 @@ void MediaDevices::DevicesEnumerated( } } diff --git a/patches/third_party-blink-renderer-modules-scheduler-scheduled_action.cc.patch b/patches/third_party-blink-renderer-modules-scheduler-scheduled_action.cc.patch index f5a4d13ebd64..b59df5e43913 100644 --- a/patches/third_party-blink-renderer-modules-scheduler-scheduled_action.cc.patch +++ b/patches/third_party-blink-renderer-modules-scheduler-scheduled_action.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/modules/scheduler/scheduled_action.cc b/third_party/blink/renderer/modules/scheduler/scheduled_action.cc -index 83bccd730d8af40e162bc0b0f6f4b78ddcca2244..18a8f071d4b4bd73a001c3f8e36f9f3a73e650e8 100644 +index ce9e2f4e17976dc1b2bce77afb5f732d51f84ed9..ff457ff8ba5279c701368ad34f361fac261f9383 100644 --- a/third_party/blink/renderer/modules/scheduler/scheduled_action.cc +++ b/third_party/blink/renderer/modules/scheduler/scheduled_action.cc -@@ -89,6 +89,7 @@ ScheduledAction::ScheduledAction(ScriptState* script_state, +@@ -88,6 +88,7 @@ ScheduledAction::ScheduledAction(ScriptState* script_state, } else { UseCounter::Count(target, WebFeature::kScheduledActionIgnored); } diff --git a/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch b/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch index 37ae7e925e39..713951a40cfb 100644 --- a/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch +++ b/patches/third_party-blink-renderer-modules-webgl-webgl_rendering_context_base.cc.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e41346b8bc67a 100644 +index b85b1e9497365f77ba8418ac40403d6f8070f06b..5ad6aa987a15b7c80bc8c98ae05cd027de8d8d35 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -3169,6 +3169,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveAttrib( +@@ -3171,6 +3171,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveAttrib( GLuint index) { if (!ValidateWebGLProgramOrShader("getActiveAttrib", program)) return nullptr; @@ -10,7 +10,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 GLuint program_id = ObjectNonZero(program); GLint max_name_length = -1; ContextGL()->GetProgramiv(program_id, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, -@@ -3200,6 +3201,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveUniform( +@@ -3202,6 +3203,7 @@ WebGLActiveInfo* WebGLRenderingContextBase::getActiveUniform( GLuint index) { if (!ValidateWebGLProgramOrShader("getActiveUniform", program)) return nullptr; @@ -18,7 +18,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 GLuint program_id = ObjectNonZero(program); GLint max_name_length = -1; ContextGL()->GetProgramiv(program_id, GL_ACTIVE_UNIFORM_MAX_LENGTH, -@@ -3230,6 +3232,7 @@ absl::optional>> +@@ -3232,6 +3234,7 @@ absl::optional>> WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) { if (!ValidateWebGLProgramOrShader("getAttachedShaders", program)) return absl::nullopt; @@ -26,7 +26,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 HeapVector> shader_objects; for (GLenum shaderType : {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER}) { -@@ -3244,6 +3247,7 @@ GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, +@@ -3246,6 +3249,7 @@ GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, const String& name) { if (!ValidateWebGLProgramOrShader("getAttribLocation", program)) return -1; @@ -34,7 +34,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!ValidateLocationLength("getAttribLocation", name)) return -1; if (!ValidateString("getAttribLocation", name)) -@@ -3277,6 +3281,7 @@ ScriptValue WebGLRenderingContextBase::getBufferParameter( +@@ -3279,6 +3283,7 @@ ScriptValue WebGLRenderingContextBase::getBufferParameter( GLenum pname) { if (isContextLost() || !ValidateBufferTarget("getBufferParameter", target)) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -42,7 +42,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 switch (pname) { case GL_BUFFER_USAGE: { -@@ -3417,6 +3422,7 @@ ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter( +@@ -3419,6 +3424,7 @@ ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter( return ScriptValue::CreateNull(script_state->GetIsolate()); } @@ -50,7 +50,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!framebuffer_binding_ || !framebuffer_binding_->Object()) { SynthesizeGLError(GL_INVALID_OPERATION, kFunctionName, "no framebuffer bound"); -@@ -3813,6 +3819,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, +@@ -3815,6 +3821,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, "invalid parameter name, OES_standard_derivatives not enabled"); return ScriptValue::CreateNull(script_state->GetIsolate()); case WebGLDebugRendererInfo::kUnmaskedRendererWebgl: @@ -58,7 +58,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (ExtensionEnabled(kWebGLDebugRendererInfoName)) { if (IdentifiabilityStudySettings::Get()->ShouldSampleType( blink::IdentifiableSurface::Type::kWebGLParameter)) { -@@ -3828,6 +3835,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, +@@ -3830,6 +3837,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* script_state, "invalid parameter name, WEBGL_debug_renderer_info not enabled"); return ScriptValue::CreateNull(script_state->GetIsolate()); case WebGLDebugRendererInfo::kUnmaskedVendorWebgl: @@ -66,7 +66,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (ExtensionEnabled(kWebGLDebugRendererInfoName)) { if (IdentifiabilityStudySettings::Get()->ShouldSampleType( blink::IdentifiableSurface::Type::kWebGLParameter)) { -@@ -3955,6 +3963,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( +@@ -3965,6 +3973,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( // intended to prevent applications from entering an infinite polling loop. if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR) return WebGLAny(script_state, true); @@ -74,7 +74,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!ValidateWebGLProgramOrShader("getProgramParamter", program)) { return ScriptValue::CreateNull(script_state->GetIsolate()); } -@@ -4010,6 +4019,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( +@@ -4020,6 +4029,7 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( String WebGLRenderingContextBase::getProgramInfoLog(WebGLProgram* program) { if (!ValidateWebGLProgramOrShader("getProgramInfoLog", program)) return String(); @@ -82,7 +82,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 GLStringQuery query(ContextGL()); return query.Run(ObjectNonZero(program)); } -@@ -4020,6 +4030,7 @@ ScriptValue WebGLRenderingContextBase::getRenderbufferParameter( +@@ -4030,6 +4040,7 @@ ScriptValue WebGLRenderingContextBase::getRenderbufferParameter( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -90,7 +90,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (target != GL_RENDERBUFFER) { SynthesizeGLError(GL_INVALID_ENUM, "getRenderbufferParameter", "invalid target"); -@@ -4071,6 +4082,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( +@@ -4081,6 +4092,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( // intended to prevent applications from entering an infinite polling loop. if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR) return WebGLAny(script_state, true); @@ -98,7 +98,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!ValidateWebGLProgramOrShader("getShaderParameter", shader)) { return ScriptValue::CreateNull(script_state->GetIsolate()); } -@@ -4102,6 +4114,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( +@@ -4112,6 +4124,7 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( String WebGLRenderingContextBase::getShaderInfoLog(WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("getShaderInfoLog", shader)) return String(); @@ -106,7 +106,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 GLStringQuery query(ContextGL()); return query.Run(ObjectNonZero(shader)); } -@@ -4132,6 +4145,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( +@@ -4142,6 +4155,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( GLint precision = 0; ContextGL()->GetShaderPrecisionFormat(shader_type, precision_type, range, &precision); @@ -114,7 +114,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 auto* result = MakeGarbageCollected( range[0], range[1], precision); if (IdentifiabilityStudySettings::Get()->ShouldSampleType( -@@ -4144,6 +4158,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( +@@ -4154,6 +4168,7 @@ WebGLShaderPrecisionFormat* WebGLRenderingContextBase::getShaderPrecisionFormat( String WebGLRenderingContextBase::getShaderSource(WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("getShaderSource", shader)) return String(); @@ -122,7 +122,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 return EnsureNotNull(shader->Source()); } -@@ -4169,6 +4184,7 @@ ScriptValue WebGLRenderingContextBase::getTexParameter( +@@ -4179,6 +4194,7 @@ ScriptValue WebGLRenderingContextBase::getTexParameter( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -130,7 +130,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!ValidateTextureBinding("getTexParameter", target)) return ScriptValue::CreateNull(script_state->GetIsolate()); switch (pname) { -@@ -4203,6 +4219,7 @@ ScriptValue WebGLRenderingContextBase::getUniform( +@@ -4213,6 +4229,7 @@ ScriptValue WebGLRenderingContextBase::getUniform( const WebGLUniformLocation* uniform_location) { if (!ValidateWebGLProgramOrShader("getUniform", program)) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -138,7 +138,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 DCHECK(uniform_location); if (uniform_location->Program() != program) { SynthesizeGLError(GL_INVALID_OPERATION, "getUniform", -@@ -4462,6 +4479,7 @@ WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation( +@@ -4472,6 +4489,7 @@ WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation( const String& name) { if (!ValidateWebGLProgramOrShader("getUniformLocation", program)) return nullptr; @@ -146,7 +146,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (!ValidateLocationLength("getUniformLocation", name)) return nullptr; if (!ValidateString("getUniformLocation", name)) -@@ -4486,6 +4504,7 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib( +@@ -4496,6 +4514,7 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib( GLenum pname) { if (isContextLost()) return ScriptValue::CreateNull(script_state->GetIsolate()); @@ -154,7 +154,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 if (index >= max_vertex_attribs_) { SynthesizeGLError(GL_INVALID_VALUE, "getVertexAttrib", "index out of range"); -@@ -4563,6 +4582,7 @@ int64_t WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, +@@ -4573,6 +4592,7 @@ int64_t WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, GLenum pname) { if (isContextLost()) return 0; @@ -162,7 +162,7 @@ index be97bf6e0a41f48d7fecce491a2324f2c7655852..69ebda6132fb20b6aa76cf27d73e4134 GLvoid* result = nullptr; // NOTE: If pname is ever a value that returns more than 1 element // this will corrupt memory. -@@ -4922,6 +4942,7 @@ void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, +@@ -4932,6 +4952,7 @@ void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, int64_t offset) { if (isContextLost()) return; diff --git a/patches/third_party-blink-renderer-platform-BUILD.gn.patch b/patches/third_party-blink-renderer-platform-BUILD.gn.patch index 5f06c95b539b..53efa8fcab19 100644 --- a/patches/third_party-blink-renderer-platform-BUILD.gn.patch +++ b/patches/third_party-blink-renderer-platform-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn -index 5ecdd70e2152ac90159cd98a7fb20a5128931ca0..ef4df9103c75b59669f96410ab3f81fe0e996f51 100644 +index 8c710aafbf4a06c640cef9daaf9e979e443504fe..e24a9696fdbc849a8500f32c19b75de07c519f48 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -1849,6 +1849,7 @@ component("platform") { +@@ -1838,6 +1838,7 @@ component("platform") { configs -= [ "//build/config/compiler:default_symbols" ] configs += blink_symbols_config diff --git a/patches/third_party-rust-itoa-v0_4-BUILD.gn.patch b/patches/third_party-rust-itoa-v0_4-BUILD.gn.patch deleted file mode 100644 index b2012b74697a..000000000000 --- a/patches/third_party-rust-itoa-v0_4-BUILD.gn.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/third_party/rust/itoa/v0_4/BUILD.gn b/third_party/rust/itoa/v0_4/BUILD.gn -index c3426bb2fa7d5a45be45d743d5971e2680b1870c..7cd4f2f73f6d15e2035cd114d5f5033c5d6d39d7 100644 ---- a/third_party/rust/itoa/v0_4/BUILD.gn -+++ b/third_party/rust/itoa/v0_4/BUILD.gn -@@ -36,4 +36,5 @@ cargo_crate("lib") { - library_configs += [ "//build/config/compiler:no_chromium_code" ] - executable_configs -= [ "//build/config/compiler:chromium_code" ] - executable_configs += [ "//build/config/compiler:no_chromium_code" ] -+ features = [ "std" ] - } diff --git a/patches/third_party-rust-serde-v1-BUILD.gn.patch b/patches/third_party-rust-serde-v1-BUILD.gn.patch index b120a29bde5c..af3fd6997a3e 100644 --- a/patches/third_party-rust-serde-v1-BUILD.gn.patch +++ b/patches/third_party-rust-serde-v1-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/third_party/rust/serde/v1/BUILD.gn b/third_party/rust/serde/v1/BUILD.gn -index d0ca46e3b1f2867098e01121892b5c90dbdfa825..73bda1ba3fe2530f8a4541472311ed14ab4384a5 100644 +index 911bd0ed33e71c6c7c93cccebd5bb9ff108c0a87..c7cdd2a5ae699be0dc12ea26de9b5251203d9db6 100644 --- a/third_party/rust/serde/v1/BUILD.gn +++ b/third_party/rust/serde/v1/BUILD.gn -@@ -59,4 +59,5 @@ cargo_crate("lib") { +@@ -58,4 +58,5 @@ cargo_crate("lib") { ] build_root = "crate/build.rs" build_sources = [ "crate/build.rs" ] diff --git a/patches/third_party/catapult/telemetry-telemetry-internal-actions-action_runner.py.patch b/patches/third_party/catapult/telemetry-telemetry-internal-actions-action_runner.py.patch index 86bb43b6c8d7..273f1cebbf54 100644 --- a/patches/third_party/catapult/telemetry-telemetry-internal-actions-action_runner.py.patch +++ b/patches/third_party/catapult/telemetry-telemetry-internal-actions-action_runner.py.patch @@ -1,5 +1,5 @@ diff --git a/telemetry/telemetry/internal/actions/action_runner.py b/telemetry/telemetry/internal/actions/action_runner.py -index 8d9e98ff1e546588f69935a688249b97fbb0992e..ca2912fa87beb576e35a0a5b453fd03b14d590fb 100644 +index 0e3a354bb417130f3efc654968634aac2b3fe944..415a52542216f0ce56b86089833f205b6867b16e 100644 --- a/telemetry/telemetry/internal/actions/action_runner.py +++ b/telemetry/telemetry/internal/actions/action_runner.py @@ -41,7 +41,7 @@ import py_utils diff --git a/patches/third_party/devtools-frontend/src/front_end-panels-application-ApplicationPanelSidebar.ts.patch b/patches/third_party/devtools-frontend/src/front_end-panels-application-ApplicationPanelSidebar.ts.patch index d80e1973d242..bdc81ea99dcd 100644 --- a/patches/third_party/devtools-frontend/src/front_end-panels-application-ApplicationPanelSidebar.ts.patch +++ b/patches/third_party/devtools-frontend/src/front_end-panels-application-ApplicationPanelSidebar.ts.patch @@ -1,5 +1,5 @@ diff --git a/front_end/panels/application/ApplicationPanelSidebar.ts b/front_end/panels/application/ApplicationPanelSidebar.ts -index ab4b086f80a2efba3b5ac7edf2d1d6e70394339a..29e0ef9da7ce781e9cb8b4d4e4af858ae3e6fa93 100644 +index cef76a94f4dbdc356c0a847bb27399dbcac023cb..e510fb7a9f7b17fb6b60ed8d3736d75cc8855849 100644 --- a/front_end/panels/application/ApplicationPanelSidebar.ts +++ b/front_end/panels/application/ApplicationPanelSidebar.ts @@ -483,6 +483,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe diff --git a/patches/tools-gritsettings-resource_ids.spec.patch b/patches/tools-gritsettings-resource_ids.spec.patch index 52dc5f77c9e3..2b93002495e8 100644 --- a/patches/tools-gritsettings-resource_ids.spec.patch +++ b/patches/tools-gritsettings-resource_ids.spec.patch @@ -1,5 +1,5 @@ diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec -index e65fe348a1b7eaed2871cc811cb8c7a40dc9f92b..b1240acd93b5a8946e2aeff33b3f1151dc203ef3 100644 +index 99322038017ccbb65ced6a8d49ed6a2c7815caed..b442f79ea28af06f3bfe657587b886892aed09bd 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec @@ -38,6 +38,9 @@ @@ -12,7 +12,7 @@ index e65fe348a1b7eaed2871cc811cb8c7a40dc9f92b..b1240acd93b5a8946e2aeff33b3f1151 "chrome/app/google_chrome_strings.grd": { "messages": [800], }, -@@ -260,7 +263,7 @@ +@@ -268,7 +271,7 @@ "includes": [3060], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/history/resources.grd": { @@ -21,7 +21,7 @@ index e65fe348a1b7eaed2871cc811cb8c7a40dc9f92b..b1240acd93b5a8946e2aeff33b3f1151 "includes": [3080], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/identity_internals/resources.grd": { -@@ -391,7 +394,7 @@ +@@ -403,7 +406,7 @@ "includes": [3710], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/settings/resources.grd": { @@ -30,7 +30,7 @@ index e65fe348a1b7eaed2871cc811cb8c7a40dc9f92b..b1240acd93b5a8946e2aeff33b3f1151 "includes": [3720], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/settings_shared/resources.grd": { -@@ -884,6 +887,9 @@ +@@ -908,6 +911,9 @@ "components/components_chromium_strings.grd": { "messages": [6020], }, diff --git a/patches/tools-licenses-licenses.py.patch b/patches/tools-licenses-licenses.py.patch index 803f378e0292..92b8ecdbf6bf 100644 --- a/patches/tools-licenses-licenses.py.patch +++ b/patches/tools-licenses-licenses.py.patch @@ -1,5 +1,5 @@ diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py -index 9a34155c5066b5e8c08c205170d48afb0f4caa92..1c5e2677689ff823b2618236a769238fd98d4dc8 100755 +index 9535c354a29fb5f5e98fdc60edeff2bdac40d69f..240e47b300333f0cfd4fdaef1572e7ee657d8169 100755 --- a/tools/licenses/licenses.py +++ b/tools/licenses/licenses.py @@ -41,6 +41,7 @@ _REPOSITORY_ROOT = os.path.abspath( @@ -10,7 +10,7 @@ index 9a34155c5066b5e8c08c205170d48afb0f4caa92..1c5e2677689ff823b2618236a769238f # Paths from the root of the tree to directories to skip. PRUNE_PATHS = set([ -@@ -426,6 +427,7 @@ SPECIAL_CASES = { +@@ -414,6 +415,7 @@ SPECIAL_CASES = { "License File": ["//third_party/selenium-atoms/LICENSE.closure"], }, } @@ -18,7 +18,7 @@ index 9a34155c5066b5e8c08c205170d48afb0f4caa92..1c5e2677689ff823b2618236a769238f # These buildtools/third_party directories only contain # chromium build files. The actual third_party source files and their -@@ -710,7 +712,8 @@ def FindThirdPartyDirs(prune_paths, root, extra_third_party_dirs=None): +@@ -829,7 +831,8 @@ def FindThirdPartyDirs(prune_paths, root, extra_third_party_dirs=None): if skip in dirs: dirs.remove(skip) @@ -28,13 +28,13 @@ index 9a34155c5066b5e8c08c205170d48afb0f4caa92..1c5e2677689ff823b2618236a769238f # Add all subdirectories that are not marked for skipping. for dir in dirs: dirpath = os.path.join(path, dir) -@@ -959,7 +962,8 @@ def GenerateCredits(file_template_file, - enable_warnings=enable_warnings) - if not metadata: +@@ -1087,7 +1090,8 @@ def GenerateCredits(file_template_file, + enable_warnings=enable_warnings) + if not directory_metadata: continue - except LicenseError: + except LicenseError as e: + CheckBraveMissingLicense(target_os, path, e) - # TODO(phajdan.jr): Convert to fatal error (http://crbug.com/39240). + # TODO(phajdan.jr): Convert to fatal error (https://crbug.com/39240). continue - if metadata['Shipped'] == NO: + diff --git a/patches/tools-metrics-histograms-metadata-histogram_suffixes_list.xml.patch b/patches/tools-metrics-histograms-metadata-histogram_suffixes_list.xml.patch index bc9484a37ac1..a70edccce308 100644 --- a/patches/tools-metrics-histograms-metadata-histogram_suffixes_list.xml.patch +++ b/patches/tools-metrics-histograms-metadata-histogram_suffixes_list.xml.patch @@ -1,8 +1,8 @@ diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml -index f5d80ee2fe271abda05ffaad457702ee795deee5..2835548d1e9be1dd48bd391da64f4da2aa24b564 100644 +index 6d0bd0d429ff35eec7aca9bb23a09046a484242c..b30cb7d1044d0b1313fdb7fcac2d668aa4911c94 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml -@@ -3467,6 +3467,7 @@ chromium-metrics-reviews@google.com. +@@ -3446,6 +3446,7 @@ chromium-metrics-reviews@google.com. diff --git a/patches/ui-accessibility-platform-ax_platform_node_cocoa.mm.patch b/patches/ui-accessibility-platform-ax_platform_node_cocoa.mm.patch index e31506e568c5..59ecac4f2d83 100644 --- a/patches/ui-accessibility-platform-ax_platform_node_cocoa.mm.patch +++ b/patches/ui-accessibility-platform-ax_platform_node_cocoa.mm.patch @@ -1,8 +1,8 @@ diff --git a/ui/accessibility/platform/ax_platform_node_cocoa.mm b/ui/accessibility/platform/ax_platform_node_cocoa.mm -index 62291c7edd6cbd26e8040a633509eea1605c4ebf..598f32a00ed35741973915d1bd6d7743f465a007 100644 +index 39b59f0dd2fc0f69b3c6ce624f3dd3e96036ce5a..a3755a3adb09d5160c7ac7961578260d4a6ed814 100644 --- a/ui/accessibility/platform/ax_platform_node_cocoa.mm +++ b/ui/accessibility/platform/ax_platform_node_cocoa.mm -@@ -2586,6 +2586,7 @@ void CollectAncestorRoles( +@@ -2587,6 +2587,7 @@ void CollectAncestorRoles( if (!_node) return nil; diff --git a/patches/ui-native_theme-native_theme_win.cc.patch b/patches/ui-native_theme-native_theme_win.cc.patch index adcefb092b8f..73c108bfd1ee 100644 --- a/patches/ui-native_theme-native_theme_win.cc.patch +++ b/patches/ui-native_theme-native_theme_win.cc.patch @@ -1,8 +1,8 @@ diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 595b7185832126dd3d8ca85c445b835e5969adcb..fcc7d08dc1cf25944ed93ff22363a9e3b4f32641 100644 +index 50647269ec84f1a543132b3d102152a40e1e65e1..fc155091ef566d400b6047ae1e3ebb4c3a313e45 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -1664,6 +1664,7 @@ void NativeThemeWin::UpdateDarkModeStatus() { +@@ -1667,6 +1667,7 @@ void NativeThemeWin::UpdateDarkModeStatus() { &apps_use_light_theme); dark_mode_enabled = (apps_use_light_theme == 0); } diff --git a/patches/ui-webui-resources-cr_elements-cr_shared_vars.css.patch b/patches/ui-webui-resources-cr_elements-cr_shared_vars.css.patch index 921bd259e8fb..5e14e514f085 100644 --- a/patches/ui-webui-resources-cr_elements-cr_shared_vars.css.patch +++ b/patches/ui-webui-resources-cr_elements-cr_shared_vars.css.patch @@ -1,5 +1,5 @@ diff --git a/ui/webui/resources/cr_elements/cr_shared_vars.css b/ui/webui/resources/cr_elements/cr_shared_vars.css -index c4ad462feb42871f029a696b515a1ecdcc2ea993..c7f6cd9049902cd05f7dc2aca8b75150212817ca 100644 +index 74e49a365ab4d8ad6c627e32f0b045f10ae6c2c3..a532532d2f8a6ddc1a71746c5d71c039d80657cb 100644 --- a/ui/webui/resources/cr_elements/cr_shared_vars.css +++ b/ui/webui/resources/cr_elements/cr_shared_vars.css @@ -5,6 +5,7 @@ diff --git a/patches/ui-webui-resources-tools-bundle_js.py.patch b/patches/ui-webui-resources-tools-bundle_js.py.patch index 429ea8bda929..0a1e901ac2f0 100644 --- a/patches/ui-webui-resources-tools-bundle_js.py.patch +++ b/patches/ui-webui-resources-tools-bundle_js.py.patch @@ -1,8 +1,8 @@ diff --git a/ui/webui/resources/tools/bundle_js.py b/ui/webui/resources/tools/bundle_js.py -index 24a9ee401a97e1ce8ad1f20b6496dfcc80b1096c..639a282e2eb413a945c3ac0eec1c262bb1631b5d 100755 +index 4370434c4d968afdbca7c9d70d81cb00e5462ea2..c87400ab2c8bdc5b9a9afa2000a413d978d11138 100755 --- a/ui/webui/resources/tools/bundle_js.py +++ b/ui/webui/resources/tools/bundle_js.py -@@ -292,5 +292,6 @@ def main(argv): +@@ -296,5 +296,6 @@ def main(argv): _update_dep_file(args.input, args, dep_file_header, manifest) diff --git a/patches/v8/BUILD.gn.patch b/patches/v8/BUILD.gn.patch index ad2973df7af1..7ff917c12fb9 100644 --- a/patches/v8/BUILD.gn.patch +++ b/patches/v8/BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/BUILD.gn b/BUILD.gn -index dd97c4f922c81a65bdc401e251612333ca63ee78..95a848560ceb9f2d74e95c7e35603c02871417f2 100644 +index 025203d66c73a835b2d178c007b8a6cfe180bfec..18bd166c723f003c24103e8afa50974bbce365c5 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -732,6 +732,7 @@ config("internal_config_base") { +@@ -730,6 +730,7 @@ config("internal_config_base") { "$target_gen_dir", "$target_gen_dir/include", ] @@ -10,7 +10,7 @@ index dd97c4f922c81a65bdc401e251612333ca63ee78..95a848560ceb9f2d74e95c7e35603c02 } config("internal_config") { -@@ -2999,6 +3000,7 @@ v8_header_set("v8_headers") { +@@ -2996,6 +2997,7 @@ v8_header_set("v8_headers") { ":cppgc_headers", ":v8_version", ] diff --git a/patches/v8/src-codegen-compiler.cc.patch b/patches/v8/src-codegen-compiler.cc.patch index c799ca46434c..66e01750755c 100644 --- a/patches/v8/src-codegen-compiler.cc.patch +++ b/patches/v8/src-codegen-compiler.cc.patch @@ -1,8 +1,8 @@ diff --git a/src/codegen/compiler.cc b/src/codegen/compiler.cc -index 3204e37c88ee1402cd4db0b95a1734cac0acac2f..dbe8625a0a1ec1660e54af1cc38e08018ec098e7 100644 +index 547ece66021a6352594c28995892ebff4539d0a4..8ce19b896bd3a191ba43c85d5306cc95fd87d1c1 100644 --- a/src/codegen/compiler.cc +++ b/src/codegen/compiler.cc -@@ -2989,6 +2989,7 @@ MaybeHandle Compiler::GetFunctionFromEval( +@@ -2986,6 +2986,7 @@ MaybeHandle Compiler::GetFunctionFromEval( } } DCHECK(is_compiled_scope.is_compiled()); diff --git a/patches/weblayer-public-java-AndroidManifest.xml.patch b/patches/weblayer-public-java-AndroidManifest.xml.patch deleted file mode 100644 index b7df761c55a1..000000000000 --- a/patches/weblayer-public-java-AndroidManifest.xml.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/weblayer/public/java/AndroidManifest.xml b/weblayer/public/java/AndroidManifest.xml -index 42673261661131d458c36d2905f2ae42294a0379..7d3db4018d6f4aaf3b644492ebef551372c7b086 100644 ---- a/weblayer/public/java/AndroidManifest.xml -+++ b/weblayer/public/java/AndroidManifest.xml -@@ -29,7 +29,9 @@ found in the LICENSE file. - - - -+ - - - diff --git a/resources/resource_ids.spec b/resources/resource_ids.spec index eeabe223f256..83faca84e20c 100644 --- a/resources/resource_ids.spec +++ b/resources/resource_ids.spec @@ -4,213 +4,213 @@ { "SRCDIR": "../..", "brave/common/extensions/api/brave_api_resources.grd": { - "includes": [50700], + "includes": [52700], }, "brave/components/resources/brave_components_resources.grd": { - "includes": [50710], + "includes": [52710], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_adblock/brave_adblock.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [50900], + "includes": [52900], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_new_tab/brave_new_tab.grd": { "META": {"sizes": {"includes": [50]}}, - "includes": [50920], + "includes": [52920], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_welcome/brave_welcome.grd": { "META": {"sizes": {"includes": [20]}}, - "includes": [50970], + "includes": [52970], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/browser/resources/settings/brave_settings_resources.grd": { "META": {"sizes": {"includes": [20]}}, - "includes": [50990], + "includes": [52990], }, "brave/app/brave_generated_resources.grd": { - "includes": [51000], - "messages": [51050], + "includes": [53000], + "messages": [53050], }, "brave/app/theme/brave_theme_resources.grd": { - "structures": [52000], + "structures": [54000], }, "brave/app/theme/brave_unscaled_resources.grd": { - "includes": [52100], + "includes": [54100], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_webtorrent/brave_webtorrent.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [52110], + "includes": [54110], }, "brave/components/brave_webtorrent/resources.grd": { - "includes": [52120], + "includes": [54120], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_rewards_panel/brave_rewards_panel.grd": { "META": {"sizes": {"includes": [20]}}, - "includes": [52130], + "includes": [54130], }, "brave/components/brave_rewards/resources/brave_rewards_static_resources.grd": { - "includes": [52150], + "includes": [54150], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_rewards_page/brave_rewards_page.grd": { "META": {"sizes": {"includes": [20]}}, - "includes": [52160], + "includes": [54160], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_rewards_internals/brave_rewards_internals.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [52180], + "includes": [54180], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_rewards_tip/brave_rewards_tip.grd": { "META": {"sizes": {"includes": [20]}}, - "includes": [52190], + "includes": [54190], }, "brave/components/resources/brave_components_strings.grd": { - "messages": [52250], + "messages": [54250], }, "brave/components/brave_ads/resources/bat_ads_resources.grd": { - "includes": [54750] + "includes": [56750] }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_page/brave_wallet_page.grd": { "META": {"sizes": {"includes": [200]}}, - "includes": [54760], + "includes": [56760], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-ethereum_remote_client_page/ethereum_remote_client_page.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [54960], + "includes": [56960], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_panel/brave_wallet_panel.grd": { "META": {"sizes": {"includes": [200]}}, - "includes": [54970], + "includes": [56970], }, "brave/components/brave_extension/extension/resources.grd": { - "includes": [55250], + "includes": [57250], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_extension/brave_extension.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55270], + "includes": [57270], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-webcompat_reporter/webcompat_reporter.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55280], + "includes": [57280], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-ipfs/ipfs.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55290], + "includes": [57290], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-cosmetic_filters/cosmetic_filters.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55300], + "includes": [57300], }, "brave/components/tor/resources/tor_static_resources.grd": { - "includes": [55310], + "includes": [57310], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-tor_internals/tor_internals.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55320], + "includes": [57320], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_script/brave_wallet_script.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55330], + "includes": [57330], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_vpn_panel/brave_vpn_panel.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55340], + "includes": [57340], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_shields_panel/brave_shields_panel.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55350], + "includes": [57350], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-trezor_bridge/trezor_bridge.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55360], + "includes": [57360], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-market_display/market_display.grd": { "META": {"sizes": {"includes": [100]}}, - "includes": [55370], + "includes": [57370], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_private_new_tab/brave_private_new_tab.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55470], + "includes": [57470], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-playlist/playlist.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55480], + "includes": [57480], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-ledger_bridge/ledger_bridge.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55490], + "includes": [57490], }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-nft_display/nft_display.grd": { "META": {"sizes": {"includes": [40]}}, - "includes": [55500], + "includes": [57500], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-cookie_list_opt_in/cookie_list_opt_in.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55540], + "includes": [57540], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_speedreader_toolbar/brave_speedreader_toolbar.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55550], + "includes": [57550], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_adblock_internals/brave_adblock_internals.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55560], + "includes": [57560], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-commands/commands.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [55570], + "includes": [57570], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_swap_page/brave_wallet_swap_page.grd": { "META": {"sizes": {"includes": [150]}}, - "includes": [55580], + "includes": [57580], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_send_page/brave_wallet_send_page.grd": { "META": {"sizes": {"includes": [100]}}, - "includes": [55720], + "includes": [57720], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_deposit_page/brave_wallet_deposit_page.grd": { "META": {"sizes": {"includes": [100]}}, - "includes": [55820], + "includes": [57820], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_wallet_fund_wallet_page/brave_wallet_fund_wallet_page.grd": { "META": {"sizes": {"includes": [100]}}, - "includes": [55920], + "includes": [57920], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-tip_panel/tip_panel.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [56020] + "includes": [58020] }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-ai_chat_ui/ai_chat_ui.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [56030], + "includes": [58030], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-skus_internals/skus_internals.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [56040], + "includes": [58040], }, "<(SHARED_INTERMEDIATE_DIR)/brave/web-ui-brave_news_internals/brave_news_internals.grd": { "META": {"sizes": {"includes": [10]}}, - "includes": [56050], + "includes": [58050], } } diff --git a/test/BUILD.gn b/test/BUILD.gn index 7c724bdb76c1..fc77d45c6b24 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -105,8 +105,6 @@ test("brave_unit_tests") { "//brave/chromium_src/chrome/browser/lookalikes/lookalike_url_navigation_throttle_unittest.cc", "//brave/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc", "//brave/chromium_src/components/autofill/core/browser/autofill_experiments_unittest.cc", - "//brave/chromium_src/components/history/core/browser/sync/brave_typed_url_sync_bridge_unittest.cc", - "//brave/chromium_src/components/history/core/browser/sync/chromium_typed_url_sync_bridge_unittest.cc", "//brave/chromium_src/components/variations/service/field_trial_unittest.cc", "//brave/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc", "//brave/chromium_src/services/network/public/cpp/cors/cors_unittest.cc", @@ -231,6 +229,7 @@ test("brave_unit_tests") { "//brave/components/de_amp/browser/test:unit_tests", "//brave/components/debounce/browser/test:unit_tests", "//brave/components/embedder_support:unit_tests", + "//brave/components/history/core/browser/sync:unit_tests", "//brave/components/ipfs/buildflags", "//brave/components/ipfs/test:brave_ipfs_unit_tests", "//brave/components/json:brave_json_unit_tests", @@ -1229,6 +1228,7 @@ if (is_android) { deps = [ "//base:base_java", "//base:base_java_test_support", + "//base:base_shared_preferences_java", "//brave/components/brave_wallet/common:mojom_java", "//chrome/android:chrome_apk_pak_assets", "//chrome/browser/android/lifecycle:java", @@ -1242,6 +1242,7 @@ if (is_android) { "//chrome/browser/profiles/android:java", "//chrome/browser/safe_browsing/android:java", "//chrome/browser/safety_check/android:java", + "//chrome/browser/search_engines/android:java", "//chrome/browser/settings:test_support_java", "//chrome/browser/tab:java", "//chrome/browser/tabmodel:java", diff --git a/test/filters/browser_tests.filter b/test/filters/browser_tests.filter index 030ea6b600de..2bd24c985819 100644 --- a/test/filters/browser_tests.filter +++ b/test/filters/browser_tests.filter @@ -96,6 +96,7 @@ -OmniboxPrerenderDefaultPrerender2BrowserTest.PrerenderFunctionsCheckWithDefaultFlag # These tests fail because kPrerender2 feature is disabled. +-All/HostedAppTestWithPrerendering.* -NoCancelSearchPreloadUnifiedBrowserTest.SuggestionChangeAfterStartPrerender -NoCancelSearchPreloadUnifiedFallbackBrowserTest.OpenPrefetchedResponseInBackgroundedTab -NoCancelSearchPreloadUnifiedFallbackBrowserTest.ServingToPrerenderingUntilCompletion @@ -305,6 +306,8 @@ # These tests fail because the primary account consent level is null instead of # signin::ConsentLevel::kSignin +-LocalWebApprovalsEnabled/SupervisedUserIframeFilterTest.*/* +-PasswordStatusCheckServiceBaseTest.CheckTimeUpdatedAfterRunScheduledInThePast -PowerBookmarkBubbleViewBrowserTest.InvokeUi_bookmark_details_on_trackable_product -TurnSyncOnHelperBrowserTest.PrimaryAccountResetAfterSyncOptInFlowAborted/* -TurnSyncOnHelperBrowserTest.UndoSyncRemoveAccount @@ -314,6 +317,12 @@ -SupervisedUserBlockModeTest.OpenBlockedURLInNewTab -SupervisedUserBlockModeTest.SendAccessRequestOnBlockedURL -SupervisedUserBlockModeTest.Unblock +-SupervisedUserNavigationThrottleFencedFramesTest.BlockFencedFrame +-SupervisedUserNavigationThrottleTest.AllowFamiliesDotGoogleDotComAccess +-SupervisedUserNavigationThrottleTest.BlockMainFrameWithInterstitial +-SupervisedUserNavigationThrottleTest.DisallowPrerendering +-SupervisedUserNavigationThrottleTest.DontBlockSubFrame +-SupervisedUserNavigationThrottleTest.NoNavigationObserverBlock -SupervisedUserURLFilterPrerenderingTest.OnURLChecked -SupervisedUserURLFilterTest.BlockNewTabAfterLoading -SupervisedUserURLFilterTest.BlockThenUnblock @@ -326,10 +335,18 @@ # These tests fail because we patch # AccountConsistencyModeManager::ComputeAccountConsistencyMethod to return # AccountConsistencyMethod::kDisabled +-All/SupervisedUserExtensionWebstorePrivateApiTest.InstallBlockedWhenPermissionsToggleOff/* +-All/SupervisedUserExtensionWebstorePrivateApiTest.NoParentPermissionRequiredForTheme/* +-All/SupervisedUserExtensionWebstorePrivateApiTest.ParentPermissionCanceled/* -ContextMenuWithFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsDisabledForUrlsBlockedByAsyncCheckerForChild +-ContextMenuWithFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsDisabledForUrlsNotAccessibleForChildWithFiltering -ContextMenuWithFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsEnabledForUrlsAllowedByAsyncCheckerForChild -ContextMenuWithoutFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsDisabledForUrlsBlockedByAsyncCheckerForChild +-ContextMenuWithoutFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsDisabledForUrlsNotAccessibleForChild -ContextMenuWithoutFilteringForSupervisedUsersBrowserTest.SaveLinkAsEntryIsEnabledForUrlsAllowedByAsyncCheckerForChild +-ExtensionManagementApiTestSupervised.ParentBlockedExtensionEnable +-ExtensionManagementApiTestSupervised.ParentPermissionGrantedForEnable +-ExtensionManagementApiTestSupervised.ParentPermissionNotGrantedForEnable # These tests fail because "Isolated Web Apps are not enabled, or Isolated Web # App Developer Mode is not enabled or blocked by policy." @@ -353,15 +370,22 @@ # These tests fail because of the Ephemeral Storage (they pass with # kBraveEphemeralStorage feature disabled). +-All/UpdaterServiceCookiePrefsBrowserTest.NoSpecificBlockedCookieSpecs/* +-All/UpdaterServiceCookiePrefsBrowserTest.NoSpecificBlockedCookieSpecs_AltRegularProfile/* +-All/UpdaterServiceCookiePrefsBrowserTest.NoSpecificBlockedCookieSpecs_GuestProfile/* +-All/UpdaterServiceCookiePrefsBrowserTest.NoSpecificBlockedCookieSpecs_IncognitoProfile/* -RequestStorageAccessForOriginBrowserTest.* -RequestStorageAccessForOriginEnabledBrowserTest.* -RequestStorageAccessForOriginWithCHIPSBrowserTest.* -RequestStorageAccessForOriginWithFirstPartySetsBrowserTest.* -RequestStorageAccessForOriginWithFirstPartySetsDisabledBrowserTest.* +-RequestStorageAccessForWithFirstPartySetsBrowserTest.PermissionQueryCrossSiteFrame +-RequestStorageAccessForWithFirstPartySetsBrowserTest.Permission_AutodeniedForServiceDomain -StorageAccessAPIForOriginBrowserTest.* -StorageAccessAPIForOriginWithFirstPartySetsBrowserTest.* --StorageAccessAPIWithCHIPSBrowserTest.* -StorageAccessAPIWith3PCEnabledBrowserTest.AllowedByUserBypass +-StorageAccessAPIWithCHIPSBrowserTest.* +-StorageAccessAPIWithFirstPartySetsAndPromptsBrowserTest.Permission_GrantedForServiceDomain/* # These tests fail because they expect the record of a cookie to go to the # "Standard" histogram mode, but instead it goes to the "Block3PC" mode. @@ -379,6 +403,7 @@ -BackgroundPage/ExtensionPreferenceApiTest.OnChange/0 -BackgroundPage/ExtensionPreferenceApiTest.OnChangeSplit/0 -BackgroundPage/ExtensionPreferenceApiTest.Standard/0 +-BackgroundPage/ExtensionPreferenceApiTest.ThirdPartyCookiesAllowed/0 -EventPage/ExtensionPreferenceApiEventPageTest.ThirdPartyCookiesAllowed/0 -ThirdPartyPartitionedStorageAccessibilityCanBeDisabledTest.Basic/* -ThirdPartyPartitionedStorageAccessibilitySharedWorkerTest.* @@ -570,9 +595,15 @@ # These tests fail because of the following CHECK in identity_test_utils.cc: # identity_manager->AreRefreshTokensLoaded() +-EnterpriseSigninServiceTest.CurrentlyActiveTabIsAlreadyLoginPage +-EnterpriseSigninServiceTest.DoesNothingIfPolicyNotSet +-EnterpriseSigninServiceTest.OpensNewTabOnSyncPaused -EnterpriseWelcomeUIDialogPixelTest.InvokeUi_default/* -EnterpriseWelcomeUIWindowPixelTest.InvokeUi_default/* -ForceSigninProfilePickerCreationFlowBrowserTest.ForceSigninAbortedBySyncDeclined +-ForceSigninProfilePickerCreationFlowBrowserTest.ForceSigninReauthNavigateBackShouldAbort +-ForceSigninProfilePickerCreationFlowBrowserTest.ForceSigninReauthSuccessful +-ForceSigninProfilePickerCreationFlowBrowserTest.ForceSigninReauthWithAnotherAccount -ForceSigninProfilePickerCreationFlowBrowserTest.ForceSigninSuccessful -GaiaRemoteConsentFlowParamBrowserTest.* -PasswordRevampedManagementBubbleBrowserTest.InvokeUi_ManagePasswordBubbleWithRevampedDesign/* @@ -588,6 +619,7 @@ -All/SupervisedUserServiceBrowserTest.ProfileName/Regular -All/SupervisedUserServiceBrowserTest.ProfileName/Supervised -IpProtectionAuthTokenProviderBrowserTest.NetworkServiceCanRequestTokens +-IpProtectionConfigProviderBrowserTest.BackoffTimeResetAfterProfileAvailabilityChange -IpProtectionConfigProviderBrowserTest.ExpectedReceiverSetStateAfterNetworkServiceCrash -IpProtectionConfigProviderBrowserTest.NetworkServiceCanRequestTokens -PersonalizedHintsFetcherBrowserTest.NoUserSignIn @@ -633,16 +665,18 @@ # These tests fail on CI but pass locally -All/PermissionPromptBubbleBaseViewBrowserTest.InvokeUi_storage_access/* -AutoPictureInPictureTabHelperBrowserTest.ImmediatelyClosesAutopipIfTabIsAlreadyFocused --AutoPictureInPictureTabHelperBrowserTest.OpensAndClosesVideoAutopip -AutoPictureInPictureTabHelperBrowserTest.RespectsAutoPictureInPictureContentSetting -AutoPictureInPictureTabHelperBrowserTest.ShowsMostRecentlyHiddenTab +-AutoPictureInPictureWithVideoPlaybackBrowserTest.OpensAndClosesVideoAutopip -DeviceChooserExtensionBrowserTests/DeviceChooserExtensionBrowserTest.ChooserAnchoredToExtensionIcon/WebHid -DeviceChooserExtensionBrowserTests/DeviceChooserExtensionBrowserTest.ChooserAnchoredToExtensionIcon/WebUsb -InstallPreloadedVerifiedAppCommandTest.SuccessCrossOriginManifest -InstallPreloadedVerifiedAppCommandTest.SuccessNewInstall -InstallPreloadedVerifiedAppCommandTest.SuccessWithManifestId +-LcpBreakdownTimingsTest.* -MetricIntegrationTest.FirstInputDelay -MetricIntegrationTest.LargestContentfulPaint +-PreinstalledWebAppManagerBrowserTest.PreinstalledAppsPrefInstall # Brave disables Session Cookies restore when ContinueWhereILeftOff is enabled. -ContinueWhereILeftOffTest.SessionCookies @@ -654,11 +688,7 @@ # These tests fail with "Check failed: value. Trying to read an unregistered # pref: brave.rewards.notifications" --PdfOcrMenuObserverTest.CheckUmaWhenTurnOffPdfOcrFromContextMenu --PdfOcrMenuObserverTest.CheckUmaWhenTurnOnPdfOcrAlwaysFromContextMenu --PdfOcrMenuObserverTest.CheckUmaWhenTurnOnPdfOcrOnceFromContextMenu --PdfOcrMenuObserverTest.PdfOcrItemNotShownWithoutScreenReader --PdfOcrMenuObserverTest.PdfOcrItemShownWithScreenReaderEnabled +-PdfOcrMenuObserverTest.* # These tests failed because we enable download bubble features by default. # safe_browsing::kDownloadBubble, safe_browsing::kDownloadBubbleV2 @@ -680,6 +710,9 @@ # This test crashes because we have kOptimizationHints feature disabled. -PageInfoBubbleViewAboutThisSiteAllowNonMsbbBrowserTest.AboutThisSiteWithoutOptinAndWithNonMsbbUsers +-SegmentationPlatformTest.NullModelUpdateForUnknownModelShouldBeNoOp +-SegmentationPlatformTest.ReceiveModelUpdateFromOptimizationGuide +-SegmentationPlatformTest.ReceiveNullModelUpdateFromOptimizationGuide -VisualSearchSuggestionsServiceBrowserTest.VisualSearchSuggestionsServiceEnabled # These tests fail because we do not show the profile type selection screen in @@ -754,7 +787,8 @@ -ThreadProfilerBrowserTest.* # These fail because we disable kPartitionedCookies --All/BrowsingDataModelBrowserTest.PartitionedLocalStorageRemoved/* +-All/BrowsingDataModelBrowserTest.LocalStorageRemovedBasedOnPartition/* +-All/EligibilityServiceBrowserTest.EligibilityChanged_NetworkContextUpdated/* -ReadAnythingAppControllerTest.* -StorageAccessAPIEnterprisePolicyBrowserTest.PartitionedStorage/* -StorageAccessAPIWithNoRequiredTopLevelInteractionBrowserTest.TopLevelUserInteractionNotRequired @@ -809,10 +843,6 @@ -CommerceHintFeatureDefaultWithGeoTest.EnableWithGeo -NewTabPageUtilBrowserTest.EnableCartByToT -# These tests fail in CI, but they are also going away in CR115 so this filter -# can be removed at that time --ExtensionActionRunnerWithUserHostControlsBrowserTest.HandleUserSiteSettingModified_ExtensionHasNoAccess - # These tests fail because we don't support the search companion. -CompanionPage* -SidePanelCompanion2BrowserEnabledTest.FeatureEnabled @@ -912,6 +942,17 @@ -PrivacySandboxAttestationsBrowserTest.* -PrivacySandboxSettingsAttestPrivateAggregationInProtectedAudienceBrowserTest.* +# This test fails because we disable +# content_settings::features::kTrackingProtection3pcd +-All/ExperimentManagerImplSyntheticTrialTest.RegistersSyntheticTrial/* + +# These tests fail because we enable features::kDestroyProfileOnBrowserClose +-WebAppProfileDeletionTest_WebContentsGracefulShutdown.DataRetrieverWebAppInfoFetching +-WebAppProfileDeletionTest_WebContentsGracefulShutdown.IconDownloading +-WebAppProfileDeletionTest_WebContentsGracefulShutdown.UrlLoading +-WebAppProfileDeletionTest_WebContentsGracefulShutdown.DataRetrieverIconFetch +-WebAppProfileDeletionTest_WebContentsGracefulShutdown.DataRetrieverInstallabilityFetch + # Tests below this point have not been diagnosed or had issues created yet. -_/WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled.* -AccessCodeCastHandlerBrowserTest.* diff --git a/test/filters/unit_tests-linux.filter b/test/filters/unit_tests-linux.filter index 51f32879cc19..b01ec4f9b13e 100644 --- a/test/filters/unit_tests-linux.filter +++ b/test/filters/unit_tests-linux.filter @@ -17,14 +17,15 @@ -Impl/TrialComparisonCertVerifierControllerTest.OfficialBuildTrialEnabledTwoClients/1 -Impl/TrialComparisonCertVerifierControllerTest.OfficialBuildTrialEnabledUmaOnly/1 -# These fail because OsIntegrationTestOverride::IsRunOnOsLoginEnabled on Linux -# hard-codes "chrome-" into the shortcut name and the shortcut start with -# "brave-". +# These fail because OsIntegrationTestOverride::GetShortcutPath and +# OsIntegrationTestOverride::IsRunOnOsLoginEnabled on Linux hard-codes "chrome-" +# into the shortcut name but our shortcut starts with "brave-". -All/InstallAppLocallyCommandTest.BasicBehavior/OSIntegrationSubManagers_Disabled -All/InstallAppLocallyCommandTest.BasicBehavior/OSIntegrationSubManagers_SaveStateAndExecute -All/InstallAppLocallyCommandTest.BasicBehavior/OSIntegrationSubManagers_SaveStateToDB -All/RunOnOsLoginSubManagerExecuteTest.* -All/ShortcutSubManagerExecuteTest.* +-WebAppPolicyForceUnregistrationTest.* -ChromeBrowsingDataRemoverDelegateTest.* -ChromePaths.* diff --git a/test/filters/unit_tests.filter b/test/filters/unit_tests.filter index 276012ea4bf1..90dae0c07cbc 100644 --- a/test/filters/unit_tests.filter +++ b/test/filters/unit_tests.filter @@ -50,12 +50,13 @@ -CookieControlsUserBypassTest.SiteCounts -CoreTabHelperWindowUnitTest.SearchWithLens_LensPingEnabled_TriggersLensPing -CustomizeChromeFeaturePromoHelperTest.* +-DeleteAddressProfileDialogControllerImplTest.* +-DoesFirstPartyPrecedeThirdPartyTest.* -DownloadBubbleRowListViewTest.AddRow -DownloadBubbleRowListViewTest.RemoveRow --DownloadBubbleRowViewTest.CopyAcceleratorCopiesFile --DownloadBubbleRowViewTest.MainButtonPressed --DownloadBubbleRowViewTest.UpdateTimeFromCompletedDownload --DownloadBubbleRowViewTest.OnlyEnabledQuickActionsVisible +-DownloadBubbleRowViewTest.* +-DownloadToolbarButtonViewTest.* +-EditAddressProfileDialogControllerImplTest.* -ExpsRegistrationSuccessObserverTest.IPHNotShownForChromeUrls -ExtensionActionViewControllerFeatureUnitTest.* -ExtensionActionViewControllerFeatureWithPermittedSitesUnitTest.GetHoverCardStatus @@ -65,6 +66,7 @@ -ExtensionMenuItemViewTest.* -ExtensionsSitePermissionsPageViewUnitTest.* -ExtensionsToolbarControlsWithPermittedSitesUnitTest.RequestAccessButtonVisibilityOnPermittedSites +-FileSystemAccessRestorePermissionBubbleViewTest.* -FirstShowAndReshow/MandatoryReauthBubbleControllerImplMetricsTest.* -FirstShowAndReshow/MandatoryReauthBubbleControllerOptInBubbleMetricsTest.* -HighEfficiencyBubbleViewMemorySavingsImprovementsTest.* @@ -92,10 +94,12 @@ -ProfileManagementNavigationThrottleTest.* -ProfileTokenNavigationThrottleTest.* -ProfileTokenWebSigninInterceptorTest.* +-ReadAnythingCoordinatorScreen2xDataCollectionModeTest.OnBrowserSetLastActive_SidePanelIsVisible -SaveCvcBubbleLoggingTest.Metrics_* -SavedTabGroupModelListenerTest.CreatesRemovesBrowserListener -SavedTabGroupModelListenerTest.GetTabStripModelWithTabGroupId -SaveIbanBubbleControllerImplTest.LocalIbanSavedSuccessfully +-SidePanelPinningCoordinatorTest.SidePanelTitleUpdates -SidePanelToolbarContainerTest.* -TabHelperUnitTest.ClearsExtensionOnUnload -TabHelperUnitTest.ReloadRequired_BlockAllExtensions @@ -223,6 +227,11 @@ # This test fails because we disable the privacy sandbox -PrivacySandboxServiceTest.MetricsLoggingOccursCorrectly +# These tests fail because we disable +# privacy_sandbox::kEnforcePrivacySandboxAttestations +-PrivacySandboxAttestationsHistograms/PrivacySandboxAttestationsHistogramsTest.*/* +-PrivacySandboxAttestationsInstallerFeatureEnabledTest.* + # This test fails because we intentionally disable the Federated Credential # Management API via features::kFedCm -FederatedIdentityApiPermissionContextTest.WhitelistedSiteForThirdPartyCookies @@ -256,6 +265,7 @@ -All/CustomizeChromePageHandlerSetThemeTest.*/* -CustomizeChromePageHandlerTest.* -CustomizeChromePageHandlerWithModulesTest.* +-CustomizeChromePageHandlerWithWallpaperSearchTest.* -CWSInfoServiceTest.* -LocalTabHandlerTest.* -PermissionPromptBubbleTwoOriginsViewTest.DiesIfPermissionNotAllowed @@ -263,6 +273,7 @@ -PermissionPromptBubbleTwoOriginsViewTest.TitleMentionsTwoOriginsAndPermission -SavedTabGroupKeyedServiceUnitTest.* -TabLifecycleUnitTest.CannotDiscardPictureInPictureWindow +-TabOrganizationServiceTest.* # These tests fail because we disable the media router via # prefs::kEnableMediaRouter @@ -337,7 +348,8 @@ -ContentAnalysisDelegateResultHandlingTest.Test/8 -ManagementUIHandlerTests.ThreatReportingInfo -# These fail because we disable safe browsing enhanced protection. +# These tests fail because we disable safe browsing enhanced protection and +# patch safe_browsing::IsEnhancedProtectionEnabled to return false -All/ClientSideDetectionServiceTest.GetNumReportTestESB/1 -All/ClientSideDetectionServiceTest.GetNumReportTestESB/2 -All/ClientSideDetectionServiceTest.GetNumReportTestESB/3 @@ -348,7 +360,11 @@ -All/ClientSideDetectionServiceTest.TestReceivingImageEmbedderUpdatesAfterResubscription/5 -All/ClientSideDetectionServiceTest.TestReceivingImageEmbedderUpdatesAfterResubscription/7 -ChromePingManagerFactoryTest.ShouldFetchAccessTokenForReport_Yes +-DownloadBubblePrefsTest.EnhancedProtectionEnabled +-EnhancedProtectionDownloadTest.* -NotificationMetricsLoggerTest.PersistentNotificationSize +-SafetyHubHandlerTest.HandleGetSafeBrowsingCardData_EnabledEnhanced +-SafetyHubHandlerTest.HandleGetSafeBrowsingState_EnabledEnhanced # These fail because we have journeys/history clusters disabled. -HistoryClustersHandlerTest.OpenVisitUrlsInTabGroup @@ -403,10 +419,6 @@ # Page Info cookies view. -PageInfoBubbleViewCookiesSubpageTest.TextsOnButtonsAreCorrect -# This test fails because we patch safe_browsing::IsEnhancedProtectionEnabled to -# return false --SafetyHubHandlerTest.HandleGetSafeBrowsingState_EnabledEnhanced - # This test times out because we Disable "Use a prediction service to load # pages more quickly" (via prefetch::prefs::kNetworkPredictionOptions pref) -NavigationPredictorUserInteractionsTest.ProcessPointerEventUsingMLModel @@ -415,6 +427,14 @@ # privacy_sandbox::kEnforcePrivacySandboxAttestations feature -PrivacySandboxAttestationsInstallerFeatureEnabledTest.* +# This test fails because we disable kPartitionedCookies +-ExtensionCookiesTest.PartitionKeySerialization + +# These tests fail a CalledOnValidSequence check when calling FindPreference +-BrowserPrefsTest.MigrateObsoleteProfilePrefSyncRequestedDefaultValue +-BrowserPrefsTest.MigrateObsoleteProfilePrefSyncRequestedSetToFalse +-BrowserPrefsTest.MigrateObsoleteProfilePrefSyncRequestedSetToTrue + # Tests below this point have not been diagnosed or had issues created yet. -AboutFlagsHistogramTest.* -AboutFlagsTest.* @@ -546,13 +566,11 @@ -DevToolsUIBindingsTest.* -DevToolsUIDataSourceTest.* -DocumentOverlayWindowViewsTest.* --DownloadBubblePrefsTest.EnhancedProtectionEnabled -DownloadProtectionServiceTest.* -DownloadRequestMakerTest.* -DownloadShelfWebViewTest.* -DownloadTargetDeterminerTest.* -DurableStoragePermissionContextTest.* --EnhancedProtectionDownloadTest.* -ExistingBaseSubMenuModelTest.* -ExistingTabGroupSubMenuModelTest.* -ExistingWindowSubMenuModelTest.* diff --git a/third_party/rust/Cargo.toml b/third_party/rust/Cargo.toml index 84c60f34faa4..7c32ac42a005 100644 --- a/third_party/rust/Cargo.toml +++ b/third_party/rust/Cargo.toml @@ -677,7 +677,7 @@ path = "itertools/v0_10/crate" package = "itertools" [patch.crates-io.itoa_v0_4] -path = "../../../third_party/rust/itoa/v0_4/crate" +path = "itoa/v0_4/crate" package = "itoa" [patch.crates-io.itoa_v1] diff --git a/third_party/rust/cssparser/v0_27/BUILD.gn b/third_party/rust/cssparser/v0_27/BUILD.gn index 8a4b98fe05a6..37a726ff3fbe 100644 --- a/third_party/rust/cssparser/v0_27/BUILD.gn +++ b/third_party/rust/cssparser/v0_27/BUILD.gn @@ -46,10 +46,10 @@ cargo_crate("lib") { deps = [ "//brave/third_party/rust/cssparser_macros/v0_6:lib", "//brave/third_party/rust/dtoa_short/v0_3:lib", + "//brave/third_party/rust/itoa/v0_4:lib", "//brave/third_party/rust/matches/v0_1:lib", "//brave/third_party/rust/phf/v0_8:lib", "//brave/third_party/rust/smallvec/v1:lib", - "//third_party/rust/itoa/v0_4:lib", ] build_deps = [ "//third_party/rust/proc_macro2/v1:lib", diff --git a/third_party/rust/cssparser/v0_28/BUILD.gn b/third_party/rust/cssparser/v0_28/BUILD.gn index 19cefdf56f83..fa5d956ae4d1 100644 --- a/third_party/rust/cssparser/v0_28/BUILD.gn +++ b/third_party/rust/cssparser/v0_28/BUILD.gn @@ -46,10 +46,10 @@ cargo_crate("lib") { deps = [ "//brave/third_party/rust/cssparser_macros/v0_6:lib", "//brave/third_party/rust/dtoa_short/v0_3:lib", + "//brave/third_party/rust/itoa/v0_4:lib", "//brave/third_party/rust/matches/v0_1:lib", "//brave/third_party/rust/phf/v0_8:lib", "//brave/third_party/rust/smallvec/v1:lib", - "//third_party/rust/itoa/v0_4:lib", ] build_deps = [ "//third_party/rust/proc_macro2/v1:lib", diff --git a/third_party/rust/http/v0_1/BUILD.gn b/third_party/rust/http/v0_1/BUILD.gn index 535263aa8fbd..caf8f5f49887 100644 --- a/third_party/rust/http/v0_1/BUILD.gn +++ b/third_party/rust/http/v0_1/BUILD.gn @@ -61,6 +61,6 @@ cargo_crate("lib") { deps = [ "//brave/third_party/rust/bytes/v0_4:lib", "//brave/third_party/rust/fnv/v1:lib", - "//third_party/rust/itoa/v0_4:lib", + "//brave/third_party/rust/itoa/v0_4:lib", ] } diff --git a/third_party/rust/itoa/v0_4/BUILD.gn b/third_party/rust/itoa/v0_4/BUILD.gn new file mode 100644 index 000000000000..b6ebc4dd0783 --- /dev/null +++ b/third_party/rust/itoa/v0_4/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# @generated from third_party/rust/BUILD.gn.hbs by tools/crates/gnrt. +# Do not edit! + +import("//build/rust/cargo_crate.gni") + +cargo_crate("lib") { + crate_name = "itoa" + epoch = "0.4" + crate_type = "rlib" + + # Only for usage from third-party crates. Add the crate to + # third_party.toml to use it from first-party code. + visibility = [ "//brave/third_party/rust/*" ] + crate_root = "crate/src/lib.rs" + sources = [ + "//brave/third_party/rust/itoa/v0_4/crate/benches/bench.rs", + "//brave/third_party/rust/itoa/v0_4/crate/src/lib.rs", + "//brave/third_party/rust/itoa/v0_4/crate/src/udiv128.rs", + "//brave/third_party/rust/itoa/v0_4/crate/tests/test.rs", + ] + inputs = [ "//brave/third_party/rust/itoa/v0_4/crate/README.md" ] + + # Unit tests skipped. Generate with --with-tests to include them. + build_native_rust_unit_tests = false + edition = "2015" + cargo_pkg_version = "0.4.8" + cargo_pkg_authors = "David Tolnay " + cargo_pkg_name = "itoa" + cargo_pkg_description = + "Fast functions for printing integer primitives to an io::Write" + library_configs -= [ "//build/config/compiler:chromium_code" ] + library_configs += [ "//build/config/compiler:no_chromium_code" ] + executable_configs -= [ "//build/config/compiler:chromium_code" ] + executable_configs += [ "//build/config/compiler:no_chromium_code" ] + features = [ "std" ] +} diff --git a/third_party/rust/itoa/v0_4/README.chromium b/third_party/rust/itoa/v0_4/README.chromium new file mode 100644 index 000000000000..94b1eb94684a --- /dev/null +++ b/third_party/rust/itoa/v0_4/README.chromium @@ -0,0 +1,7 @@ +Name: itoa +URL: https://crates.io/crates/itoa +Description: Fast functions for printing integer primitives to an io::Write +Version: 0.4.8 +Security Critical: yes +Shipped: yes +License: Apache 2.0 diff --git a/third_party/rust/itoa/v0_4/crate/.cargo_vcs_info.json b/third_party/rust/itoa/v0_4/crate/.cargo_vcs_info.json new file mode 100644 index 000000000000..8da2e20e4252 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/.cargo_vcs_info.json @@ -0,0 +1,5 @@ +{ + "git": { + "sha1": "de247d6ac25d2e62d4cbd195f064ed4af35fd4eb" + } +} diff --git a/third_party/rust/itoa/v0_4/crate/.clippy.toml b/third_party/rust/itoa/v0_4/crate/.clippy.toml new file mode 100644 index 000000000000..8e17d8074c41 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/.clippy.toml @@ -0,0 +1 @@ +msrv = "1.0.0" diff --git a/third_party/rust/itoa/v0_4/crate/.github/FUNDING.yml b/third_party/rust/itoa/v0_4/crate/.github/FUNDING.yml new file mode 100644 index 000000000000..750707701cda --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/.github/FUNDING.yml @@ -0,0 +1 @@ +github: dtolnay diff --git a/third_party/rust/itoa/v0_4/crate/.github/workflows/ci.yml b/third_party/rust/itoa/v0_4/crate/.github/workflows/ci.yml new file mode 100644 index 000000000000..e0f85851516f --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + pull_request: + schedule: [cron: "40 1 * * *"] + +jobs: + test: + name: Rust ${{matrix.rust}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [nightly, beta, stable, 1.26.0] + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{matrix.rust}} + - run: cargo build + - run: cargo build --features i128 + - run: cargo test --features i128 + - run: cargo test --features i128 --release + - run: cargo build --no-default-features --features i128 + - run: cargo test --tests --no-default-features --features i128 + - run: cargo test --tests --no-default-features --features i128 --release + - run: cargo bench --no-run --features i128 + if: matrix.rust == 'nightly' + + mintest: + name: Rust 1.20.0 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@1.20.0 + - run: cargo test + + msrv: + name: Rust 1.0.0 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@1.0.0 + - run: cargo build + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@clippy + - run: cargo clippy -- -Dclippy::all -Dclippy::pedantic diff --git a/third_party/rust/itoa/v0_4/crate/.gitignore b/third_party/rust/itoa/v0_4/crate/.gitignore new file mode 100644 index 000000000000..a9d37c560c6a --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/third_party/rust/itoa/v0_4/crate/Cargo.toml b/third_party/rust/itoa/v0_4/crate/Cargo.toml new file mode 100644 index 000000000000..02b43829ce38 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/Cargo.toml @@ -0,0 +1,29 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +name = "itoa" +version = "0.4.8" +authors = ["David Tolnay "] +exclude = ["performance.png"] +description = "Fast functions for printing integer primitives to an io::Write" +documentation = "https://docs.rs/itoa" +readme = "README.md" +categories = ["value-formatting"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/dtolnay/itoa" +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[features] +default = ["std"] +i128 = [] +std = [] diff --git a/third_party/rust/itoa/v0_4/crate/Cargo.toml.orig b/third_party/rust/itoa/v0_4/crate/Cargo.toml.orig new file mode 100644 index 000000000000..2781d7c91465 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/Cargo.toml.orig @@ -0,0 +1,19 @@ +[package] +name = "itoa" +version = "0.4.8" # remember to update html_root_url +authors = ["David Tolnay "] +license = "MIT OR Apache-2.0" +description = "Fast functions for printing integer primitives to an io::Write" +repository = "https://github.com/dtolnay/itoa" +documentation = "https://docs.rs/itoa" +categories = ["value-formatting"] +readme = "README.md" +exclude = ["performance.png"] + +[features] +default = ["std"] +i128 = [] +std = [] + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] diff --git a/third_party/rust/itoa/v0_4/crate/LICENSE-APACHE b/third_party/rust/itoa/v0_4/crate/LICENSE-APACHE new file mode 100644 index 000000000000..16fe87b06e80 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/third_party/rust/itoa/v0_4/crate/LICENSE-MIT b/third_party/rust/itoa/v0_4/crate/LICENSE-MIT new file mode 100644 index 000000000000..31aa79387f27 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/third_party/rust/itoa/v0_4/crate/README.md b/third_party/rust/itoa/v0_4/crate/README.md new file mode 100644 index 000000000000..cff3bb327997 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/README.md @@ -0,0 +1,96 @@ +itoa +==== + +[github](https://github.com/dtolnay/itoa) +[crates.io](https://crates.io/crates/itoa) +[docs.rs](https://docs.rs/itoa) +[build status](https://github.com/dtolnay/itoa/actions?query=branch%3Amaster) + +This crate provides fast functions for printing integer primitives to an +[`io::Write`] or a [`fmt::Write`]. The implementation comes straight from +[libcore] but avoids the performance penalty of going through +[`fmt::Formatter`]. + +See also [`dtoa`] for printing floating point primitives. + +*Version requirement: rustc 1.0+* + +[`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html +[`fmt::Write`]: https://doc.rust-lang.org/core/fmt/trait.Write.html +[libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254 +[`fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html +[`dtoa`]: https://github.com/dtolnay/dtoa + +```toml +[dependencies] +itoa = "0.4" +``` + +
+ +## Performance (lower is better) + +![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) + +
+ +## Examples + +```rust +use std::{fmt, io}; + +fn demo_itoa_write() -> io::Result<()> { + // Write to a vector or other io::Write. + let mut buf = Vec::new(); + itoa::write(&mut buf, 128u64)?; + println!("{:?}", buf); + + // Write to a stack buffer. + let mut bytes = [0u8; 20]; + let n = itoa::write(&mut bytes[..], 128u64)?; + println!("{:?}", &bytes[..n]); + + Ok(()) +} + +fn demo_itoa_fmt() -> fmt::Result { + // Write to a string. + let mut s = String::new(); + itoa::fmt(&mut s, 128u64)?; + println!("{}", s); + + Ok(()) +} +``` + +The function signatures are: + +```rust +fn write(writer: W, value: V) -> io::Result; + +fn fmt(writer: W, value: V) -> fmt::Result; +``` + +where `itoa::Integer` is implemented for i8, u8, i16, u16, i32, u32, i64, u64, +i128, u128, isize and usize. 128-bit integer support requires rustc 1.26+ and +the `i128` feature of this crate enabled. + +The `write` function is only available when the `std` feature is enabled +(default is enabled). The return value gives the number of bytes written. + +
+ +#### License + + +Licensed under either of Apache License, Version +2.0 or MIT license at your option. + + +
+ + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this crate by you, as defined in the Apache-2.0 license, shall +be dual licensed as above, without any additional terms or conditions. + diff --git a/third_party/rust/itoa/v0_4/crate/benches/bench.rs b/third_party/rust/itoa/v0_4/crate/benches/bench.rs new file mode 100644 index 000000000000..a9ed517cfd90 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/benches/bench.rs @@ -0,0 +1,83 @@ +#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))] +#![feature(test)] +#![allow(non_snake_case)] + +extern crate itoa; +extern crate test; + +macro_rules! benches { + ( + $( + $(#[$attr:meta])* + $name:ident($value:expr) + ),* + ) => { + mod bench_itoa_write { + use test::{Bencher, black_box}; + $( + $(#[$attr])* + #[bench] + fn $name(b: &mut Bencher) { + use itoa; + + let mut buf = Vec::with_capacity(40); + + b.iter(|| { + buf.clear(); + itoa::write(&mut buf, black_box($value)).unwrap() + }); + } + )* + } + + mod bench_itoa_fmt { + use test::{Bencher, black_box}; + $( + $(#[$attr])* + #[bench] + fn $name(b: &mut Bencher) { + use itoa; + + let mut buf = String::with_capacity(40); + + b.iter(|| { + buf.clear(); + itoa::fmt(&mut buf, black_box($value)).unwrap() + }); + } + )* + } + + mod bench_std_fmt { + use test::{Bencher, black_box}; + $( + $(#[$attr])* + #[bench] + fn $name(b: &mut Bencher) { + use std::io::Write; + + let mut buf = Vec::with_capacity(40); + + b.iter(|| { + buf.clear(); + write!(&mut buf, "{}", black_box($value)).unwrap() + }); + } + )* + } + } +} + +benches! { + bench_u64_0(0u64), + bench_u64_half(::max_value() as u64), + bench_u64_max(::max_value()), + + bench_i16_0(0i16), + bench_i16_min(::min_value()), + + #[cfg(feature = "i128")] + bench_u128_0(0u128), + #[cfg(feature = "i128")] + bench_u128_max(::max_value()) +} diff --git a/third_party/rust/itoa/v0_4/crate/src/lib.rs b/third_party/rust/itoa/v0_4/crate/src/lib.rs new file mode 100644 index 000000000000..8d4582e023bf --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/src/lib.rs @@ -0,0 +1,358 @@ +//! [![github]](https://github.com/dtolnay/itoa) [![crates-io]](https://crates.io/crates/itoa) [![docs-rs]](https://docs.rs/itoa) +//! +//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github +//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust +//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K +//! +//!
+//! +//! This crate provides fast functions for printing integer primitives to an +//! [`io::Write`] or a [`fmt::Write`]. The implementation comes straight from +//! [libcore] but avoids the performance penalty of going through +//! [`fmt::Formatter`]. +//! +//! See also [`dtoa`] for printing floating point primitives. +//! +//! [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html +//! [`fmt::Write`]: https://doc.rust-lang.org/core/fmt/trait.Write.html +//! [libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254 +//! [`fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html +//! [`dtoa`]: https://github.com/dtolnay/dtoa +//! +//!
+//! +//! # Performance (lower is better) +//! +//! ![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) +//! +//!
+//! +//! # Examples +//! +//! ```edition2018 +//! use std::{fmt, io}; +//! +//! fn demo_itoa_write() -> io::Result<()> { +//! // Write to a vector or other io::Write. +//! let mut buf = Vec::new(); +//! itoa::write(&mut buf, 128u64)?; +//! println!("{:?}", buf); +//! +//! // Write to a stack buffer. +//! let mut bytes = [0u8; 20]; +//! let n = itoa::write(&mut bytes[..], 128u64)?; +//! println!("{:?}", &bytes[..n]); +//! +//! Ok(()) +//! } +//! +//! fn demo_itoa_fmt() -> fmt::Result { +//! // Write to a string. +//! let mut s = String::new(); +//! itoa::fmt(&mut s, 128u64)?; +//! println!("{}", s); +//! +//! Ok(()) +//! } +//! ``` + +#![doc(html_root_url = "https://docs.rs/itoa/0.4.8")] +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))] +#![cfg_attr( + feature = "cargo-clippy", + allow( + expl_impl_clone_on_copy, + missing_errors_doc, + must_use_candidate, + transmute_ptr_to_ptr + ) +)] + +#[cfg(feature = "i128")] +mod udiv128; + +#[cfg(feature = "std")] +use std::{fmt, io, mem, ptr, slice, str}; + +#[cfg(not(feature = "std"))] +use core::{fmt, mem, ptr, slice, str}; + +/// Write integer to an `io::Write`. +#[cfg(feature = "std")] +#[inline] +pub fn write(mut wr: W, value: V) -> io::Result { + let mut buf = Buffer::new(); + let s = buf.format(value); + match wr.write_all(s.as_bytes()) { + Ok(()) => Ok(s.len()), + Err(e) => Err(e), + } +} + +/// Write integer to an `fmt::Write`. +#[inline] +pub fn fmt(mut wr: W, value: V) -> fmt::Result { + let mut buf = Buffer::new(); + wr.write_str(buf.format(value)) +} + +/// A safe API for formatting integers to text. +/// +/// # Example +/// +/// ``` +/// let mut buffer = itoa::Buffer::new(); +/// let printed = buffer.format(1234); +/// assert_eq!(printed, "1234"); +/// ``` +#[derive(Copy)] +pub struct Buffer { + bytes: [u8; I128_MAX_LEN], +} + +impl Default for Buffer { + #[inline] + fn default() -> Buffer { + Buffer::new() + } +} + +impl Clone for Buffer { + #[inline] + fn clone(&self) -> Self { + Buffer::new() + } +} + +impl Buffer { + /// This is a cheap operation; you don't need to worry about reusing buffers + /// for efficiency. + #[inline] + #[allow(deprecated)] + pub fn new() -> Buffer { + Buffer { + bytes: unsafe { mem::uninitialized() }, + } + } + + /// Print an integer into this buffer and return a reference to its string representation + /// within the buffer. + pub fn format(&mut self, i: I) -> &str { + i.write(self) + } +} + +// Seal to prevent downstream implementations of the Integer trait. +mod private { + pub trait Sealed {} +} + +/// An integer that can be formatted by `itoa::write` and `itoa::fmt`. +/// +/// This trait is sealed and cannot be implemented for types outside of itoa. +pub trait Integer: private::Sealed { + // Not public API. + #[doc(hidden)] + fn write(self, buf: &mut Buffer) -> &str; +} + +trait IntegerPrivate { + fn write_to(self, buf: &mut B) -> &[u8]; +} + +const DEC_DIGITS_LUT: &'static [u8] = b"\ + 0001020304050607080910111213141516171819\ + 2021222324252627282930313233343536373839\ + 4041424344454647484950515253545556575859\ + 6061626364656667686970717273747576777879\ + 8081828384858687888990919293949596979899"; + +// Adaptation of the original implementation at +// https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L188-L266 +macro_rules! impl_IntegerCommon { + ($max_len:expr, $t:ident) => { + impl Integer for $t { + #[inline] + fn write(self, buf: &mut Buffer) -> &str { + unsafe { + debug_assert!($max_len <= I128_MAX_LEN); + let buf = mem::transmute::<&mut [u8; I128_MAX_LEN], &mut [u8; $max_len]>( + &mut buf.bytes, + ); + let bytes = self.write_to(buf); + str::from_utf8_unchecked(bytes) + } + } + } + + impl private::Sealed for $t {} + }; +} + +macro_rules! impl_Integer { + ($($max_len:expr => $t:ident),* as $conv_fn:ident) => {$( + impl_IntegerCommon!($max_len, $t); + + impl IntegerPrivate<[u8; $max_len]> for $t { + #[allow(unused_comparisons)] + #[inline] + fn write_to(self, buf: &mut [u8; $max_len]) -> &[u8] { + let is_nonnegative = self >= 0; + let mut n = if is_nonnegative { + self as $conv_fn + } else { + // convert the negative num to positive by summing 1 to it's 2 complement + (!(self as $conv_fn)).wrapping_add(1) + }; + let mut curr = buf.len() as isize; + let buf_ptr = buf.as_mut_ptr(); + let lut_ptr = DEC_DIGITS_LUT.as_ptr(); + + unsafe { + // need at least 16 bits for the 4-characters-at-a-time to work. + if mem::size_of::<$t>() >= 2 { + // eagerly decode 4 characters at a time + while n >= 10000 { + let rem = (n % 10000) as isize; + n /= 10000; + + let d1 = (rem / 100) << 1; + let d2 = (rem % 100) << 1; + curr -= 4; + ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr.offset(curr), 2); + ptr::copy_nonoverlapping(lut_ptr.offset(d2), buf_ptr.offset(curr + 2), 2); + } + } + + // if we reach here numbers are <= 9999, so at most 4 chars long + let mut n = n as isize; // possibly reduce 64bit math + + // decode 2 more chars, if > 2 chars + if n >= 100 { + let d1 = (n % 100) << 1; + n /= 100; + curr -= 2; + ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr.offset(curr), 2); + } + + // decode last 1 or 2 chars + if n < 10 { + curr -= 1; + *buf_ptr.offset(curr) = (n as u8) + b'0'; + } else { + let d1 = n << 1; + curr -= 2; + ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr.offset(curr), 2); + } + + if !is_nonnegative { + curr -= 1; + *buf_ptr.offset(curr) = b'-'; + } + } + + let len = buf.len() - curr as usize; + unsafe { slice::from_raw_parts(buf_ptr.offset(curr), len) } + } + } + )*}; +} + +const I8_MAX_LEN: usize = 4; +const U8_MAX_LEN: usize = 3; +const I16_MAX_LEN: usize = 6; +const U16_MAX_LEN: usize = 5; +const I32_MAX_LEN: usize = 11; +const U32_MAX_LEN: usize = 10; +const I64_MAX_LEN: usize = 20; +const U64_MAX_LEN: usize = 20; + +impl_Integer!( + I8_MAX_LEN => i8, + U8_MAX_LEN => u8, + I16_MAX_LEN => i16, + U16_MAX_LEN => u16, + I32_MAX_LEN => i32, + U32_MAX_LEN => u32 + as u32); + +impl_Integer!(I64_MAX_LEN => i64, U64_MAX_LEN => u64 as u64); + +#[cfg(target_pointer_width = "16")] +impl_Integer!(I16_MAX_LEN => isize, U16_MAX_LEN => usize as u16); + +#[cfg(target_pointer_width = "32")] +impl_Integer!(I32_MAX_LEN => isize, U32_MAX_LEN => usize as u32); + +#[cfg(target_pointer_width = "64")] +impl_Integer!(I64_MAX_LEN => isize, U64_MAX_LEN => usize as u64); + +#[cfg(all(feature = "i128"))] +macro_rules! impl_Integer128 { + ($($max_len:expr => $t:ident),*) => {$( + impl_IntegerCommon!($max_len, $t); + + impl IntegerPrivate<[u8; $max_len]> for $t { + #[allow(unused_comparisons)] + #[inline] + fn write_to(self, buf: &mut [u8; $max_len]) -> &[u8] { + let is_nonnegative = self >= 0; + let n = if is_nonnegative { + self as u128 + } else { + // convert the negative num to positive by summing 1 to it's 2 complement + (!(self as u128)).wrapping_add(1) + }; + let mut curr = buf.len() as isize; + let buf_ptr = buf.as_mut_ptr(); + + unsafe { + // Divide by 10^19 which is the highest power less than 2^64. + let (n, rem) = udiv128::udivmod_1e19(n); + let buf1 = buf_ptr.offset(curr - U64_MAX_LEN as isize) as *mut [u8; U64_MAX_LEN]; + curr -= rem.write_to(&mut *buf1).len() as isize; + + if n != 0 { + // Memset the base10 leading zeros of rem. + let target = buf.len() as isize - 19; + ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize); + curr = target; + + // Divide by 10^19 again. + let (n, rem) = udiv128::udivmod_1e19(n); + let buf2 = buf_ptr.offset(curr - U64_MAX_LEN as isize) as *mut [u8; U64_MAX_LEN]; + curr -= rem.write_to(&mut *buf2).len() as isize; + + if n != 0 { + // Memset the leading zeros. + let target = buf.len() as isize - 38; + ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize); + curr = target; + + // There is at most one digit left + // because u128::max / 10^19 / 10^19 is 3. + curr -= 1; + *buf_ptr.offset(curr) = (n as u8) + b'0'; + } + } + + if !is_nonnegative { + curr -= 1; + *buf_ptr.offset(curr) = b'-'; + } + + let len = buf.len() - curr as usize; + slice::from_raw_parts(buf_ptr.offset(curr), len) + } + } + } + )*}; +} + +#[cfg(all(feature = "i128"))] +const U128_MAX_LEN: usize = 39; +const I128_MAX_LEN: usize = 40; + +#[cfg(all(feature = "i128"))] +impl_Integer128!(I128_MAX_LEN => i128, U128_MAX_LEN => u128); diff --git a/third_party/rust/itoa/v0_4/crate/src/udiv128.rs b/third_party/rust/itoa/v0_4/crate/src/udiv128.rs new file mode 100644 index 000000000000..617c1c17cdfe --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/src/udiv128.rs @@ -0,0 +1,45 @@ +/// Multiply unsigned 128 bit integers, return upper 128 bits of the result +#[inline] +fn u128_mulhi(x: u128, y: u128) -> u128 { + let x_lo = x as u64; + let x_hi = (x >> 64) as u64; + let y_lo = y as u64; + let y_hi = (y >> 64) as u64; + + // handle possibility of overflow + let carry = (x_lo as u128 * y_lo as u128) >> 64; + let m = x_lo as u128 * y_hi as u128 + carry; + let high1 = m >> 64; + + let m_lo = m as u64; + let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64; + + x_hi as u128 * y_hi as u128 + high1 + high2 +} + +/// Divide `n` by 1e19 and return quotient and remainder +/// +/// Integer division algorithm is based on the following paper: +/// +/// T. Granlund and P. Montgomery, “Division by Invariant Integers Using Multiplication” +/// in Proc. of the SIGPLAN94 Conference on Programming Language Design and +/// Implementation, 1994, pp. 61–72 +/// +#[inline] +pub fn udivmod_1e19(n: u128) -> (u128, u64) { + let d = 10_000_000_000_000_000_000_u64; // 10^19 + + let quot = if n < 1 << 83 { + ((n >> 19) as u64 / (d >> 19)) as u128 + } else { + let factor = + (8507059173023461586_u64 as u128) << 64 | 10779635027931437427 as u128; + u128_mulhi(n, factor) >> 62 + }; + + let rem = (n - quot * d as u128) as u64; + debug_assert_eq!(quot, n / d as u128); + debug_assert_eq!(rem as u128, n % d as u128); + + (quot, rem) +} diff --git a/third_party/rust/itoa/v0_4/crate/tests/test.rs b/third_party/rust/itoa/v0_4/crate/tests/test.rs new file mode 100644 index 000000000000..53558689daa6 --- /dev/null +++ b/third_party/rust/itoa/v0_4/crate/tests/test.rs @@ -0,0 +1,47 @@ +#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, string_lit_as_bytes))] +#![allow(non_snake_case)] + +extern crate itoa; + +macro_rules! test { + ( + $( + $(#[$attr:meta])* + $name:ident($value:expr, $expected:expr) + ),* + ) => { + $( + $(#[$attr])* + #[test] + fn $name() { + #[cfg(feature = "std")] + { + let mut buf = [b'\0'; 40]; + let len = itoa::write(&mut buf[..], $value).unwrap(); + assert_eq!(&buf[0..len], $expected.as_bytes()); + } + + let mut s = String::new(); + itoa::fmt(&mut s, $value).unwrap(); + assert_eq!(s, $expected); + } + )* + } +} + +test! { + test_u64_0(0u64, "0"), + test_u64_half(::max_value() as u64, "4294967295"), + test_u64_max(::max_value(), "18446744073709551615"), + test_i64_min(::min_value(), "-9223372036854775808"), + + test_i16_0(0i16, "0"), + test_i16_min(::min_value(), "-32768"), + + #[cfg(feature = "i128")] + test_u128_0(0u128, "0"), + #[cfg(feature = "i128")] + test_u128_max(::max_value(), "340282366920938463463374607431768211455"), + #[cfg(feature = "i128")] + test_i128_min(::min_value(), "-170141183460469231731687303715884105728") +} diff --git a/third_party/rust/tracing_attributes/v0_1/crate/src/lib.rs b/third_party/rust/tracing_attributes/v0_1/crate/src/lib.rs index 95ef60d1658c..f65e7670d0f7 100644 --- a/third_party/rust/tracing_attributes/v0_1/crate/src/lib.rs +++ b/third_party/rust/tracing_attributes/v0_1/crate/src/lib.rs @@ -72,7 +72,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused_allocation, unused_comparisons, diff --git a/utility/importer/chrome_importer.cc b/utility/importer/chrome_importer.cc index e181e0a0d385..721197f7ddbc 100644 --- a/utility/importer/chrome_importer.cc +++ b/utility/importer/chrome_importer.cc @@ -38,7 +38,7 @@ #include "url/gurl.h" #if BUILDFLAG(IS_LINUX) -#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/branded_strings.h" #include "components/os_crypt/sync/key_storage_config_linux.h" #endif // BUILDFLAG(IS_LINUX) @@ -149,26 +149,27 @@ std::u16string DecryptedCardFromColumn(sql::Statement* s, int column_index) { } bool PasswordFormToImportedPasswordForm( - const password_manager::PasswordForm* form, - importer::ImportedPasswordForm* imported_form) { - if (form->scheme != password_manager::PasswordForm::Scheme::kHtml && - form->scheme != password_manager::PasswordForm::Scheme::kBasic) + const password_manager::PasswordForm& form, + importer::ImportedPasswordForm& imported_form) { + if (form.scheme != password_manager::PasswordForm::Scheme::kHtml && + form.scheme != password_manager::PasswordForm::Scheme::kBasic) { return false; + } - if (form->scheme == password_manager::PasswordForm::Scheme::kHtml) { - imported_form->scheme = importer::ImportedPasswordForm::Scheme::kHtml; + if (form.scheme == password_manager::PasswordForm::Scheme::kHtml) { + imported_form.scheme = importer::ImportedPasswordForm::Scheme::kHtml; } else { - imported_form->scheme = importer::ImportedPasswordForm::Scheme::kBasic; + imported_form.scheme = importer::ImportedPasswordForm::Scheme::kBasic; } - imported_form->signon_realm = form->signon_realm; - imported_form->url = form->url; - imported_form->action = form->action; - imported_form->username_element = form->username_element; - imported_form->username_value = form->username_value; - imported_form->password_element = form->password_element; - imported_form->password_value = form->password_value; - imported_form->blocked_by_user = form->blocked_by_user; + imported_form.signon_realm = form.signon_realm; + imported_form.url = form.url; + imported_form.action = form.action; + imported_form.username_element = form.username_element; + imported_form.username_value = form.username_value; + imported_form.password_element = form.password_element; + imported_form.password_value = form.password_value; + imported_form.blocked_by_user = form.blocked_by_user; return true; } @@ -467,22 +468,24 @@ void ChromeImporter::ImportPasswords( return; } - std::vector> forms; + std::vector forms; bool success = database.GetAutofillableLogins(&forms); if (success) { for (auto& entry : forms) { importer::ImportedPasswordForm form; - if (PasswordFormToImportedPasswordForm(entry.get(), &form)) + if (PasswordFormToImportedPasswordForm(entry, form)) { bridge_->SetPasswordForm(form); + } } } - std::vector> blocklist; + std::vector blocklist; success = database.GetBlocklistLogins(&blocklist); if (success) { for (auto& entry : blocklist) { importer::ImportedPasswordForm form; - if (PasswordFormToImportedPasswordForm(entry.get(), &form)) + if (PasswordFormToImportedPasswordForm(entry, form)) { bridge_->SetPasswordForm(form); + } } } } diff --git a/utility/importer/sources.gni b/utility/importer/sources.gni index da5adba4f218..2487c8d86ff8 100644 --- a/utility/importer/sources.gni +++ b/utility/importer/sources.gni @@ -28,7 +28,7 @@ if (!is_android) { "//brave/app:brave_generated_resources_grit", "//brave/common/importer:importer", "//brave/common/importer:interfaces", - "//chrome/app:chromium_strings", + "//chrome/app:branded_strings", "//components/os_crypt/sync", "//components/password_manager/core/browser", "//components/webdata/common",