diff --git a/android/brave_java_resources.gni b/android/brave_java_resources.gni index 8bafb2dd0143..1714bbc23d59 100644 --- a/android/brave_java_resources.gni +++ b/android/brave_java_resources.gni @@ -972,8 +972,8 @@ brave_java_resources = [ "java/res/values/brave_ids.xml", "java/res/values/brave_styles.xml", "java/res/values/shimmer_attrs.xml", - "java/res/xml/appearance_preferences.xml", "java/res/xml/background_images_preferences.xml", + "java/res/xml/brave_appearance_preferences.xml", "java/res/xml/brave_download_preferences.xml", "java/res/xml/brave_ethereum_preferences.xml", "java/res/xml/brave_leo_default_model_preferences.xml", diff --git a/android/brave_java_sources.gni b/android/brave_java_sources.gni index d421e353ee1c..81e15ac02ed0 100644 --- a/android/brave_java_sources.gni +++ b/android/brave_java_sources.gni @@ -8,6 +8,7 @@ import("//brave/android/feed/brave_feed_java_sources.gni") import("//brave/android/java/org/chromium/chrome/browser/billing/sources.gni") import("//brave/android/java/org/chromium/chrome/browser/playlist/sources.gni") import("//brave/base/brave_base_shared_preferences_java.gni") +import("//brave/browser/bookmarks/android/sources.gni") import("//brave/browser/brave_ads/android/java_sources.gni") import("//brave/browser/hub/internal/android/java/java_sources.gni") import("//brave/browser/incognito/android/java_sources.gni") @@ -65,15 +66,12 @@ brave_java_sources = [ "../../brave/android/java/org/chromium/chrome/browser/autofill/BraveAutofillBackgroundServiceImpl.java", "../../brave/android/java/org/chromium/chrome/browser/autofill/BraveAutofillService.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge.java", - "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkImportExportDialogFragment.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java", - "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkPage.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbar.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java", - "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java", "../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java", "../../brave/android/java/org/chromium/chrome/browser/brave_leo/BraveLeoMojomHelper.java", "../../brave/android/java/org/chromium/chrome/browser/brave_leo/BraveLeoPlansActivity.java", diff --git a/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd b/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd index 87fc614f2283..76dca75e49ae 100644 --- a/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd +++ b/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd @@ -335,7 +335,7 @@ - + Remove from group @@ -351,7 +351,7 @@ Close group - Manage sharing + Manage access Recent activity @@ -726,6 +726,45 @@ other {Created %d2 years ago} } + + Updated just now + + + {NUM_MINS, plural, + =1 {Updated %d1 minute ago} + other {Updated %d2 minutes ago} + } + + + {NUM_HOURS, plural, + =1 {Updated %d1 hour ago} + other {Updated %d2 hours ago} + } + + + {NUM_DAYS, plural, + =1 {Updated %d1 day ago} + other {Updated %d2 days ago} + } + + + {NUM_WEEKS, plural, + =1 {Updated %d1 week ago} + other {Updated %d2 weeks ago} + } + + + {NUM_MONTHS, plural, + =1 {Updated %d1 month ago} + other {Updated %d2 months ago} + } + + + {NUM_MONTHS, plural, + =1 {Updated %d1 year ago} + other {Updated %d2 years ago} + } + +%1$s3 @@ -989,12 +1028,46 @@ If you delete it, everyone will immediately lose access to the " - %1$sVacation tab group no longer available - + + "%1$sVacation" tab group no longer available + + + "%1$sTravel" and "%2$sVacation" tab groups no longer available + + + {TAB_GROUPS_COUNT, plural, + =1 {%1$d1 tab group no longer available} + other {%1$d5 tab groups no longer available} + } + Dismiss the card. + + + + Add to group + + + + + Add to + + + New tab group + + + Select tab group + + + Tab group list, opened at half height + + + Tab group list, opened at full height + + + Tab group list closed + diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags index a13d0578b614..14ff931fd629 100644 --- a/android/java/apk_for_test.flags +++ b/android/java/apk_for_test.flags @@ -29,9 +29,6 @@ -keep class org.chromium.chrome.browser.bookmarks.BookmarkBridge { *** mNativeBookmarkBridge; - *** extensiveBookmarkChangesBeginning(...); - *** extensiveBookmarkChangesEnded(...); - *** createBookmarkItem(...); (...); } @@ -202,7 +199,6 @@ -keep class org.chromium.chrome.browser.bookmarks.BookmarkUtils { *** addOrEditBookmark(...); - *** showBookmarkManagerOnPhone(...); *** isSpecialFolder(...); } @@ -893,10 +889,6 @@ public (...); } --keep class org.chromium.chrome.browser.undo_tab_close_snackbar.UndoBarController { - *** showUndoBar(...); -} - -keep class org.chromium.chrome.browser.tabbed_mode.TabbedNavigationBarColorController { *** mContext; *** mTabModelSelector; diff --git a/android/java/org/chromium/chrome/browser/BraveAppHooks.java b/android/java/org/chromium/chrome/browser/BraveAppHooks.java index 4d651837de33..af68487c9577 100644 --- a/android/java/org/chromium/chrome/browser/BraveAppHooks.java +++ b/android/java/org/chromium/chrome/browser/BraveAppHooks.java @@ -5,11 +5,14 @@ package org.chromium.chrome.browser; +import org.chromium.base.Callback; import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmark; public class BraveAppHooks extends AppHooks { + /** Async fetch the iterator of partner bookmarks (or null if not available). */ @Override - public PartnerBookmark.BookmarkIterator getPartnerBookmarkIterator() { - return null; + public void requestPartnerBookmarkIterator( + Callback callback) { + callback.onResult(null); } } diff --git a/android/java/org/chromium/chrome/browser/BraveSwipeRefreshHandler.java b/android/java/org/chromium/chrome/browser/BraveSwipeRefreshHandler.java index abc74f470725..26568a2d42b2 100644 --- a/android/java/org/chromium/chrome/browser/BraveSwipeRefreshHandler.java +++ b/android/java/org/chromium/chrome/browser/BraveSwipeRefreshHandler.java @@ -5,6 +5,8 @@ package org.chromium.chrome.browser; +import androidx.annotation.NonNull; + import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.util.TabUtils; import org.chromium.ui.OverscrollAction; @@ -18,8 +20,10 @@ public class BraveSwipeRefreshHandler extends SwipeRefreshHandler { public Tab mTab; // There is a direct patch for SwipeRefreshHandler to make it's ctor public - public BraveSwipeRefreshHandler(Tab tab) { - super(tab); + public BraveSwipeRefreshHandler( + Tab tab, + @NonNull SwipeRefreshHandler.SwipeRefreshLayoutCreator swipeRefreshLayoutCreator) { + super(tab, swipeRefreshLayoutCreator); } @Override diff --git a/android/java/org/chromium/chrome/browser/app/BraveActivity.java b/android/java/org/chromium/chrome/browser/app/BraveActivity.java index e98a5f108975..ea4d0192f854 100644 --- a/android/java/org/chromium/chrome/browser/app/BraveActivity.java +++ b/android/java/org/chromium/chrome/browser/app/BraveActivity.java @@ -2450,6 +2450,12 @@ public void addOrEditBookmark(final Tab tabToBookmark) { ((TabBookmarker) mTabBookmarkerSupplier.get()).addOrEditBookmark(tabToBookmark); } + public void showBookmarkManager(Profile profile) { + if (mBookmarkManagerOpenerSupplier.get() != null) { + mBookmarkManagerOpenerSupplier.get().showBookmarkManager(this, profile); + } + } + // We call that method with an interval // BraveSafeBrowsingApiHandler.SAFE_BROWSING_INIT_INTERVAL_MS, // as upstream does, to keep the GmsCore process alive. diff --git a/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java b/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java index 62f747864439..eb1de4404fd6 100644 --- a/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java +++ b/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java @@ -10,6 +10,7 @@ import org.chromium.chrome.browser.bookmarks.BookmarkManagerCoordinator; import org.chromium.chrome.browser.bookmarks.BraveBookmarkManagerCoordinator; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.base.IntentRequestTracker; @@ -19,14 +20,14 @@ public class BraveBookmarkActivity extends BookmarkActivity { private ActivityWindowAndroid mWindowAndroid; @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + protected void onProfileAvailable(Profile profile) { + super.onProfileAvailable(profile); IntentRequestTracker intentRequestTracker = IntentRequestTracker.createFromActivity(this); mWindowAndroid = new ActivityWindowAndroid( this, true, intentRequestTracker, null, /* trackOcclusion= */ false); - mWindowAndroid.getIntentRequestTracker().restoreInstanceState(savedInstanceState); + if (mBookmarkManagerCoordinator instanceof BraveBookmarkManagerCoordinator) { ((BraveBookmarkManagerCoordinator) mBookmarkManagerCoordinator) .setWindow(mWindowAndroid); diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java index 05c2de8fff57..d0924a9b65c6 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java @@ -8,6 +8,7 @@ import android.content.ComponentName; import android.content.Context; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import org.chromium.chrome.browser.profiles.Profile; @@ -19,21 +20,21 @@ public class BraveBookmarkManagerCoordinator extends BookmarkManagerCoordinator private BookmarkManagerMediator mMediator; public BraveBookmarkManagerCoordinator( - Context context, - ComponentName openBookmarkComponentName, + @NonNull Context context, boolean isDialogUi, - SnackbarManager snackbarManager, - Profile profile, - BookmarkUiPrefs bookmarkUiPrefs, - @Nullable Runnable bookmarkOpenedCallback) { + @NonNull SnackbarManager snackbarManager, + @NonNull Profile profile, + @NonNull BookmarkUiPrefs bookmarkUiPrefs, + @NonNull BookmarkOpener bookmarkOpener, + @Nullable ComponentName openBookmarkComponentName) { super( context, - openBookmarkComponentName, isDialogUi, snackbarManager, profile, bookmarkUiPrefs, - bookmarkOpenedCallback); + bookmarkOpener, + openBookmarkComponentName); } public void setWindow(ActivityWindowAndroid window) { diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkPage.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkPage.java index 78676dd1c12b..7101bb09daea 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkPage.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkPage.java @@ -7,6 +7,9 @@ import android.content.ComponentName; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; @@ -17,11 +20,12 @@ public class BraveBookmarkPage extends BookmarkPage { private BookmarkManagerCoordinator mBookmarkManagerCoordinator; public BraveBookmarkPage( - ComponentName componentName, - SnackbarManager snackbarManager, - Profile profile, - NativePageHost host) { - super(componentName, snackbarManager, profile, host); + @NonNull SnackbarManager snackbarManager, + @NonNull Profile profile, + @NonNull NativePageHost host, + @Nullable ComponentName componentName) { + super(snackbarManager, profile, host, componentName); + if (mBookmarkManagerCoordinator instanceof BraveBookmarkManagerCoordinator && BraveActivity.getChromeTabbedActivity() != null) { ((BraveBookmarkManagerCoordinator) mBookmarkManagerCoordinator) diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java index 666cd12e3718..977a8fb86c1c 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java @@ -8,6 +8,7 @@ import android.content.Context; import org.chromium.base.supplier.OneshotSupplier; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.browser_ui.widget.dragreorder.DragReorderableRecyclerViewAdapter; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListLayout; @@ -23,6 +24,7 @@ class BraveBookmarkToolbarCoordinator extends BookmarkToolbarCoordinator { BraveBookmarkToolbarCoordinator( Context context, + Profile profile, SelectableListLayout selectableListLayout, SelectionDelegate selectionDelegate, SearchDelegate searchDelegate, @@ -38,6 +40,7 @@ class BraveBookmarkToolbarCoordinator extends BookmarkToolbarCoordinator { BooleanSupplier incognitoEnabledSupplier) { super( context, + profile, selectableListLayout, selectionDelegate, searchDelegate, diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java index 83ce4257c542..b96c653c9bf6 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java @@ -6,17 +6,12 @@ package org.chromium.chrome.browser.bookmarks; import android.app.Activity; -import android.content.Intent; -import android.net.Uri; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import org.chromium.base.Callback; -import org.chromium.base.ContextUtils; import org.chromium.base.Log; -import org.chromium.chrome.browser.IntentHandler; -import org.chromium.chrome.browser.app.bookmarks.BraveBookmarkActivity; import org.chromium.chrome.browser.tab.Tab; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkItem; @@ -56,26 +51,11 @@ public static void addOrEditBookmark( fromExplicitTrackUi); } - public static void showBookmarkManagerOnPhone( - Activity activity, String url, boolean isIncognito) { - Intent intent = - new Intent(activity == null ? ContextUtils.getApplicationContext() : activity, - BraveBookmarkActivity.class); - intent.putExtra(IntentHandler.EXTRA_INCOGNITO_MODE, isIncognito); - intent.setData(Uri.parse(url)); - if (activity != null) { - // Start from an existing activity. - intent.putExtra(IntentHandler.EXTRA_PARENT_COMPONENT, activity.getComponentName()); - activity.startActivity(intent); - } else { - // Start a new task. - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - IntentHandler.startActivityForTrustedIntent(intent); - } - } - - public static void showBookmarkImportExportDialog(AppCompatActivity appCompatActivity, - boolean isImport, boolean isSuccess, String exportFilePath) { + public static void showBookmarkImportExportDialog( + AppCompatActivity appCompatActivity, + boolean isImport, + boolean isSuccess, + String exportFilePath) { try { BraveBookmarkImportExportDialogFragment dialogFragment = BraveBookmarkImportExportDialogFragment.newInstance( diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java index feb346a336a6..4c632e56e805 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java @@ -21,6 +21,7 @@ import org.chromium.chrome.browser.feed.FeedSwipeRefreshLayout; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.magic_stack.ModuleRegistry; +import org.chromium.chrome.browser.metrics.StartupMetricsTracker; import org.chromium.chrome.browser.privacy.settings.PrivacyPreferencesManagerImpl; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; @@ -74,7 +75,8 @@ public BraveNewTabPage( ObservableSupplier tabContentManagerSupplier, ObservableSupplier tabStripHeightSupplier, OneshotSupplier moduleRegistrySupplier, - ObservableSupplier edgeToEdgeControllerSupplier) { + ObservableSupplier edgeToEdgeControllerSupplier, + StartupMetricsTracker startupMetricsTracker) { super( activity, browserControlsStateProvider, @@ -97,7 +99,8 @@ public BraveNewTabPage( tabContentManagerSupplier, tabStripHeightSupplier, moduleRegistrySupplier, - edgeToEdgeControllerSupplier); + edgeToEdgeControllerSupplier, + startupMetricsTracker); mJankTracker = jankTracker; @@ -134,7 +137,8 @@ protected void initializeMainView( boolean isInNightMode, Supplier shareDelegateSupplier, String url, - ObservableSupplier edgeToEdgeControllerSupplier) { + ObservableSupplier edgeToEdgeControllerSupplier, + StartupMetricsTracker startupMetricsTracker) { // Override surface provider Profile profile = Profile.fromWebContents(mTab.getWebContents()); diff --git a/android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java b/android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java index 6415e03056d4..7f41370bc410 100644 --- a/android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java +++ b/android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java @@ -60,7 +60,7 @@ public class AppearancePreferences extends BravePreferenceFragment public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPageTitle.set(getString(R.string.prefs_appearance)); - SettingsUtils.addPreferencesFromResource(this, R.xml.appearance_preferences); + SettingsUtils.addPreferencesFromResource(this, R.xml.brave_appearance_preferences); boolean isTablet = DeviceFormFactor.isNonMultiDisplayContextOnTablet( ContextUtils.getApplicationContext()); diff --git a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java index 36afd835b4fd..0f19412a14fa 100644 --- a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java +++ b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java @@ -21,6 +21,7 @@ import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.back_press.BackPressManager; +import org.chromium.chrome.browser.bookmarks.BookmarkManagerOpener; import org.chromium.chrome.browser.bookmarks.BookmarkModel; import org.chromium.chrome.browser.bookmarks.TabBookmarker; import org.chromium.chrome.browser.compositor.CompositorViewHolder; @@ -108,7 +109,8 @@ public BraveTabbedRootUiCoordinator( @Nullable MultiInstanceManager multiInstanceManager, @NonNull ObservableSupplier overviewColorSupplier, @NonNull ManualFillingComponentSupplier manualFillingComponentSupplier, - @NonNull EdgeToEdgeManager edgeToEdgeManager) { + @NonNull EdgeToEdgeManager edgeToEdgeManager, + @NonNull ObservableSupplier bookmarkManagerOpenerSupplier) { super( activity, onOmniboxFocusChangedListener, @@ -155,7 +157,8 @@ public BraveTabbedRootUiCoordinator( multiInstanceManager, overviewColorSupplier, manualFillingComponentSupplier, - edgeToEdgeManager); + edgeToEdgeManager, + bookmarkManagerOpenerSupplier); mActivity = activity; mHubManagerSupplier = hubManagerSupplier; diff --git a/android/java/org/chromium/chrome/browser/ui/system/BraveStatusBarColorController.java b/android/java/org/chromium/chrome/browser/ui/system/BraveStatusBarColorController.java index bc8237202d95..d610dc3aa0b7 100644 --- a/android/java/org/chromium/chrome/browser/ui/system/BraveStatusBarColorController.java +++ b/android/java/org/chromium/chrome/browser/ui/system/BraveStatusBarColorController.java @@ -12,11 +12,13 @@ import androidx.annotation.ColorInt; import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.OneshotSupplier; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.layouts.LayoutManager; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.theme.TopUiThemeColorProvider; import org.chromium.chrome.browser.ui.system.StatusBarColorController.StatusBarColorProvider; +import org.chromium.components.browser_ui.desktop_windowing.DesktopWindowStateManager; import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeSystemBarColorHelper; import org.chromium.ui.util.ColorUtils; @@ -33,7 +35,8 @@ public BraveStatusBarColorController( ActivityLifecycleDispatcher activityLifecycleDispatcher, ActivityTabProvider tabProvider, TopUiThemeColorProvider topUiThemeColorProvider, - EdgeToEdgeSystemBarColorHelper edgeToEdgeSystemBarColorHelper) { + EdgeToEdgeSystemBarColorHelper edgeToEdgeSystemBarColorHelper, + OneshotSupplier desktopWindowStateManagerSupplier) { super( window, isTablet, @@ -43,7 +46,8 @@ public BraveStatusBarColorController( activityLifecycleDispatcher, tabProvider, topUiThemeColorProvider, - edgeToEdgeSystemBarColorHelper); + edgeToEdgeSystemBarColorHelper, + desktopWindowStateManagerSupplier); // Dark theme doesn't have the regression, apply adjustment to light one only if (!ColorUtils.inNightMode(context)) { diff --git a/android/java/org/chromium/chrome/browser/util/TabUtils.java b/android/java/org/chromium/chrome/browser/util/TabUtils.java index 2d5ebea6cf18..ce71a564ab44 100644 --- a/android/java/org/chromium/chrome/browser/util/TabUtils.java +++ b/android/java/org/chromium/chrome/browser/util/TabUtils.java @@ -115,36 +115,38 @@ public static void showBookmarkTabPopupMenu(Context context, View view, deleteMenuItem.setVisible(false); } - popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem item) { - int id = item.getItemId(); - BraveActivity activity = null; - try { - activity = BraveActivity.getBraveActivity(); - } catch (BraveActivity.BraveActivityNotFoundException e) { - Log.e(TAG, "showBookmarkTabPopupMenu popup click " + e); - } - if (currentTab == null || activity == null) { - return false; - } - - if (id == R.id.add_bookmark || id == R.id.delete_bookmark) { - activity.addOrEditBookmark(currentTab); - return true; - } else if (id == R.id.edit_bookmark && bridge != null) { - BookmarkId bookmarkId = bridge.getUserBookmarkIdForTab(currentTab); - if (bookmarkId != null) { - BookmarkUtils.startEditActivity(activity, bookmarkId); - return true; + popup.setOnMenuItemClickListener( + new PopupMenu.OnMenuItemClickListener() { + @Override + public boolean onMenuItemClick(MenuItem item) { + int id = item.getItemId(); + BraveActivity activity = null; + try { + activity = BraveActivity.getBraveActivity(); + } catch (BraveActivity.BraveActivityNotFoundException e) { + Log.e(TAG, "showBookmarkTabPopupMenu popup click " + e); + } + if (currentTab == null || activity == null) { + return false; + } + + if (id == R.id.add_bookmark || id == R.id.delete_bookmark) { + activity.addOrEditBookmark(currentTab); + return true; + } else if (id == R.id.edit_bookmark && bridge != null) { + BookmarkId bookmarkId = bridge.getUserBookmarkIdForTab(currentTab); + if (bookmarkId != null) { + BookmarkUtils.startEditActivity( + activity, currentTab.getProfile(), bookmarkId); + return true; + } + } else if (id == R.id.view_bookmarks) { + activity.showBookmarkManager(currentTab.getProfile()); + return true; + } + return false; } - } else if (id == R.id.view_bookmarks) { - BookmarkUtils.showBookmarkManager(activity, currentTab.isIncognito()); - return true; - } - return false; - } - }); + }); popup.show(); } diff --git a/android/java/res/xml/appearance_preferences.xml b/android/java/res/xml/brave_appearance_preferences.xml similarity index 100% rename from android/java/res/xml/appearance_preferences.xml rename to android/java/res/xml/brave_appearance_preferences.xml diff --git a/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java b/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java index 4488574d5318..8c5aba97ca7c 100644 --- a/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java +++ b/android/javatests/org/chromium/chrome/browser/BraveSwipeRefreshHandlerTest.java @@ -81,7 +81,8 @@ private TabbedModeTabDelegateFactory createTabDelegateFactory() { null, rootUiCoordinator.getToolbarManager().getTabStripHeightSupplier(), new OneshotSupplierImpl(), - new ObservableSupplierImpl()); + new ObservableSupplierImpl(), + cta.getStartupMetricsTracker()); } @Test diff --git a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java index 5bc3bf969fbc..fddc1dceeea0 100644 --- a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java +++ b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java @@ -83,6 +83,7 @@ import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.logo.CachedTintedBitmap; import org.chromium.chrome.browser.logo.LogoCoordinator; +import org.chromium.chrome.browser.metrics.StartupMetricsTracker; import org.chromium.chrome.browser.multiwindow.MultiInstanceManager; import org.chromium.chrome.browser.multiwindow.MultiWindowModeStateDispatcher; import org.chromium.chrome.browser.new_tab_url.DseNewTabUrlManager; @@ -385,38 +386,6 @@ public void testClassesExist() throws Exception { @Test @SmallTest public void testMethodsExist() throws Exception { - Assert.assertTrue( - methodExists( - "org/chromium/chrome/browser/bookmarks/BookmarkBridge", - "extensiveBookmarkChangesBeginning", - MethodModifier.REGULAR, - void.class)); - Assert.assertTrue( - methodExists( - "org/chromium/chrome/browser/bookmarks/BookmarkBridge", - "extensiveBookmarkChangesEnded", - MethodModifier.REGULAR, - void.class)); - Assert.assertTrue( - methodExists( - "org/chromium/chrome/browser/bookmarks/BookmarkBridge", - "createBookmarkItem", - MethodModifier.STATIC, - BookmarkItem.class, - long.class, - int.class, - String.class, - GURL.class, - boolean.class, - long.class, - int.class, - boolean.class, - boolean.class, - long.class, - boolean.class, - long.class, - boolean.class)); - Assert.assertTrue( methodExists( "org/chromium/chrome/browser/LaunchIntentDispatcher", @@ -554,15 +523,6 @@ public void testMethodsExist() throws Exception { int.class, Callback.class, boolean.class)); - Assert.assertTrue( - methodExists( - "org/chromium/chrome/browser/bookmarks/BookmarkUtils", - "showBookmarkManagerOnPhone", - MethodModifier.STATIC, - void.class, - Activity.class, - String.class, - boolean.class)); Assert.assertTrue( methodExists( "org/chromium/components/permissions/PermissionDialogModelFactory", @@ -1256,7 +1216,8 @@ public void testConstructorsExistAndMatch() throws Exception { ObservableSupplier.class, ObservableSupplier.class, OneshotSupplier.class, - ObservableSupplier.class)); + ObservableSupplier.class, + StartupMetricsTracker.class)); Assert.assertTrue( constructorsMatch( "org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator", @@ -1491,7 +1452,8 @@ public void testConstructorsExistAndMatch() throws Exception { constructorsMatch( "org/chromium/chrome/browser/SwipeRefreshHandler", "org/chromium/chrome/browser/BraveSwipeRefreshHandler", - Tab.class)); + Tab.class, + SwipeRefreshHandler.SwipeRefreshLayoutCreator.class)); Assert.assertTrue( constructorsMatch( @@ -1563,7 +1525,8 @@ public void testConstructorsExistAndMatch() throws Exception { MultiInstanceManager.class, ObservableSupplier.class, ManualFillingComponentSupplier.class, - EdgeToEdgeManager.class)); + EdgeToEdgeManager.class, + ObservableSupplier.class)); Assert.assertTrue( constructorsMatch( "org/chromium/chrome/browser/bookmarks/BookmarkToolbar", @@ -1575,6 +1538,7 @@ public void testConstructorsExistAndMatch() throws Exception { "org/chromium/chrome/browser/bookmarks/BookmarkToolbarCoordinator", "org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator", Context.class, + Profile.class, SelectableListLayout.class, SelectionDelegate.class, SearchDelegate.class, @@ -1593,12 +1557,12 @@ public void testConstructorsExistAndMatch() throws Exception { "org/chromium/chrome/browser/bookmarks/BookmarkManagerCoordinator", "org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator", Context.class, - ComponentName.class, boolean.class, SnackbarManager.class, Profile.class, BookmarkUiPrefs.class, - Runnable.class)); + BookmarkOpener.class, + ComponentName.class)); Assert.assertTrue( constructorsMatch( "org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator", @@ -1641,10 +1605,10 @@ public void testConstructorsExistAndMatch() throws Exception { constructorsMatch( "org/chromium/chrome/browser/bookmarks/BookmarkPage", "org/chromium/chrome/browser/bookmarks/BraveBookmarkPage", - ComponentName.class, SnackbarManager.class, Profile.class, - NativePageHost.class)); + NativePageHost.class, + ComponentName.class)); Assert.assertTrue( constructorsMatch( "org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl", @@ -1756,7 +1720,8 @@ public void testConstructorsExistAndMatch() throws Exception { ActivityLifecycleDispatcher.class, ActivityTabProvider.class, TopUiThemeColorProvider.class, - EdgeToEdgeSystemBarColorHelper.class)); + EdgeToEdgeSystemBarColorHelper.class, + OneshotSupplier.class)); Assert.assertTrue( constructorsMatch( "org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment", // presubmit: ignore-long-line diff --git a/app/BUILD.gn b/app/BUILD.gn index dba7f19546e5..72a567b75d2c 100644 --- a/app/BUILD.gn +++ b/app/BUILD.gn @@ -175,7 +175,6 @@ source_set("unit_tests") { ":command_ids", "//brave/components/commands/common", "//chrome/app:command_ids", - "//chrome/browser/apps/link_capturing:features", "//chrome/common:chrome_features", "//components/translate/core/common", "//extensions/common", diff --git a/app/app_management_strings.grdp b/app/app_management_strings.grdp index 34877d3d95c6..ba7181b57902 100644 --- a/app/app_management_strings.grdp +++ b/app/app_management_strings.grdp @@ -201,6 +201,15 @@ Allowed – $1While in use. Turn on microphone using physical switch. + + Version + + + Size + + + Data stored in app + diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index 1409a536baa1..db424229affd 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -1,6 +1,6 @@ + source_lang_id="en" enc_check="möl"> diff --git a/app/brave_strings.grd b/app/brave_strings.grd index 4baab4f6b11d..08945aa50e61 100644 --- a/app/brave_strings.grd +++ b/app/brave_strings.grd @@ -546,6 +546,16 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> Let Brave run in the background + + + Disable Brave Running in Background for Apps + + + + + Disable Brave running in background for apps + + Brave cannot read and write to its data directory: @@ -770,7 +780,7 @@ Brave is unable to recover your settings. Brave API keys are missing. Some functionality of Brave will be disabled. - + $1Gmail Checker has been added to Brave @@ -963,6 +973,9 @@ Brave is unable to recover your settings. + + Your organization requires you to sign into Brave + Link your Brave data to this account? @@ -985,9 +998,6 @@ Brave is unable to recover your settings. Any Brave data that is generated during the use of this profile (such as the creation of bookmarks, history, passwords, and other settings) can be removed by the work profile administrator. $1Learn more - - Your organization requires you to sign into Brave - Your organization, $1manager.com, requires you to sign into Brave @@ -1016,7 +1026,7 @@ Brave is unable to recover your settings. - To continue, you'll need to sign in to Brave with $1user@example.com. This ensures compliance with your organization's policies. + To continue, sign in to Brave as $1user@example.com. This makes sure that you've got your organization's policies. @@ -1088,18 +1098,12 @@ Brave is unable to recover your settings. - - Continue in a new Brave profile? - Sign in to Brave in a new profile? Switch to existing Brave profile? - - A Brave profile with this account already exists - You're already signed in as $1foo@gmail.com in another Brave profile @@ -1110,13 +1114,7 @@ Brave is unable to recover your settings. $1Elisa is already signed in to this Brave profile. To keep your browsing separate, Brave can create your own profile for you. - $1Elisa is already signed in. To keep your browsing separate, sign in to Brave in your own profile as $2foo@gmail.com. - - - $1Elisa is already signed in to this Brave profile. This will create a new Brave profile for $2foo@gmail.com - - - This will create a new Brave profile for $1foo@gmail.com + $1Elisa is already signed in. To keep your browsing separate, sign in to Brave in your own profile as $2foo@gmail.com. To get your passwords and more on all your devices, sign in to Brave @@ -1544,16 +1542,16 @@ Brave is unable to recover your settings. Brave Tab - To share your screen, allow screen recording for Brave in System Preferences + To share your screen, allow screen recording for Brave in System Settings - To share your screen, allow screen recording for Brave in System Preferences. + To share your screen, allow screen recording for Brave in System Settings. - To share your window, allow screen recording for Brave in System Preferences + To share your window, allow screen recording for Brave in System Settings - To share your window, allow screen recording for Brave in System Preferences. + To share your window, allow screen recording for Brave in System Settings. You'll then need to restart Brave. @@ -1653,6 +1651,9 @@ Brave is unable to recover your settings. My Activity + + Can't find content in page + Dismiss @@ -1677,6 +1678,12 @@ Brave is unable to recover your settings. Select anything to search with Image Search + + Select any text or image to search with Image Search or press escape to exit Image Search + + + Select any text or image to search with Image Search + Select text with Image Search @@ -1948,7 +1955,7 @@ Brave is unable to recover your settings. - Your organization can see and manage browsing data, such as your bookmarks, history, and passwords. It can't see browsing data in personal Brave profiles. + Your organization can see and manage browsing data, such as your bookmarks, history, and passwords. It can't see browsing data in other Brave profiles @@ -1958,10 +1965,7 @@ Brave is unable to recover your settings. Who's using Brave? - With Brave profiles you can separate all your Brave stuff. Create profiles for friends and family, or split between work and fun. - - - To access your Brave stuff across all your devices, sign in, then turn on sync. + With Brave profiles, you can separate all your Brave stuff. Create profiles for friends and family, or split between work and fun. Set up your new Brave profile @@ -2322,21 +2326,9 @@ Brave is unable to recover your settings. These tabs are using extra resources. To improve your performance, let Brave make them inactive. - - Brave can make these tabs inactive to improve your browsing experience and free up resources. - - - Brave can make these tabs inactive to improve your browsing experience and keep things fast. - This tab is using extra resources. To improve your performance, let Brave make it inactive. - - Brave can make this tab inactive to improve your browsing experience and free up resources. - - - Brave can make this tab inactive to improve your browsing experience and keep things fast. - @@ -2364,12 +2356,9 @@ Brave is unable to recover your settings. - - Sign in to Brave - - To get your extensions on all your computers, sign in to Brave + To get your extensions and more on all your computers, sign in to Brave diff --git a/app/brave_strings_override.grd b/app/brave_strings_override.grd index 678d0c0f73a3..10db72df9d65 100644 --- a/app/brave_strings_override.grd +++ b/app/brave_strings_override.grd @@ -165,6 +165,10 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> + + + + @@ -187,7 +191,7 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> - + diff --git a/app/certificate_manager.grdp b/app/certificate_manager.grdp index 4c23967e6fb1..e5ca888d60dd 100644 --- a/app/certificate_manager.grdp +++ b/app/certificate_manager.grdp @@ -181,6 +181,9 @@ Error importing certificate + + Invalid or corrupt file + Unable to import certificate @@ -191,9 +194,6 @@ Incorrect password or corrupt file - - Invalid or corrupt file - File uses unsupported features diff --git a/app/extensions_strings.grdp b/app/extensions_strings.grdp index eaccacb25b36..e9a01a9a0af7 100644 --- a/app/extensions_strings.grdp +++ b/app/extensions_strings.grdp @@ -263,6 +263,12 @@ Allow in Private + + Allow User Scripts + + + The extension will be able to run code which has not been reviewed by Brave. It may be unsafe and you should only enable this if you know what you are doing. + The following extensions depend on this extension: diff --git a/app/feature_defaults_unittest.cc b/app/feature_defaults_unittest.cc index dacf5ec3137e..e74759e7d609 100644 --- a/app/feature_defaults_unittest.cc +++ b/app/feature_defaults_unittest.cc @@ -52,8 +52,8 @@ #include "components/user_education/common/user_education_features.h" #include "components/webapps/browser/features.h" #include "content/common/features.h" +#include "content/public/common/btm_utils.h" #include "content/public/common/content_features.h" -#include "content/public/common/dips_utils.h" #include "gpu/config/gpu_finch_features.h" #include "media/base/media_switches.h" #include "net/base/features.h" @@ -68,7 +68,6 @@ #include "chrome/browser/flags/android/chrome_feature_list.h" #include "components/password_manager/core/common/password_manager_features.h" #else -#include "chrome/browser/apps/link_capturing/link_capturing_features.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_features.h" #include "chrome/browser/sharing_hub/sharing_hub_features.h" #include "components/device_signals/core/common/signals_features.h" @@ -95,8 +94,6 @@ TEST(FeatureDefaultsTest, DisabledFeatures) { &blink::features::kAllowURNsInIframes, &blink::features::kAttributionReportingInBrowserMigration, &blink::features::kBackgroundResourceFetch, - &blink::features::kBiddingAndScoringDebugReportingAPI, - &blink::features::kBrowsingTopics, &blink::features::kControlledFrame, &blink::features::kCssSelectorFragmentAnchor, &blink::features::kFencedFrames, @@ -104,11 +101,9 @@ TEST(FeatureDefaultsTest, DisabledFeatures) { &blink::features::kFledgeBiddingAndAuctionServer, &blink::features::kFledgeConsiderKAnonymity, &blink::features::kFledgeEnforceKAnonymity, - &blink::features::kInterestGroupStorage, &blink::features::kParakeet, &blink::features::kPrerender2, &blink::features::kPrivateAggregationApi, - &blink::features::kSharedStorageAPI, &blink::features::kSpeculationRulesPrefetchFuture, #if BUILDFLAG(IS_ANDROID) &chrome::android::kAdaptiveButtonInTopToolbarCustomizationV2, @@ -161,7 +156,7 @@ TEST(FeatureDefaultsTest, DisabledFeatures) { #endif &features::kSCTAuditing, &features::kServiceWorkerAutoPreload, - &features::kSupportSearchSuggestionForPrerender2, + &features::kSideBySide, &features::kTabHoverCardImages, #if !BUILDFLAG(IS_ANDROID) &features::kTrustSafetySentimentSurvey, @@ -199,6 +194,9 @@ TEST(FeatureDefaultsTest, DisabledFeatures) { &net::features::kTopLevelTpcdOriginTrial, &net::features::kTpcdMetadataGrants, &net::features::kWaitForFirstPartySetsInit, + &network::features::kBrowsingTopics, + &network::features::kInterestGroupStorage, + &network::features::kSharedStorageAPI, &network_time::kNetworkTimeServiceQuerying, &ntp_features::kCustomizeChromeSidePanelExtensionsCard, &ntp_features::kCustomizeChromeWallpaperSearch, @@ -245,7 +243,8 @@ TEST(FeatureDefaultsTest, DisabledFeatures) { &segmentation_platform::features::kSegmentationPlatformTimeDelaySampling, &shared_highlighting::kSharedHighlightingManager, &subresource_filter::kAdTagging, - &syncer::kSyncEnableBookmarksInTransportMode, + &switches::kSyncEnableBookmarksInTransportMode, + &syncer::kSyncAutofillLoyaltyCard, #if !BUILDFLAG(IS_ANDROID) &translate::kTFLiteLanguageDetectionEnabled, #endif diff --git a/app/generated_resources.grd b/app/generated_resources.grd index 480a03880051..6e5ce614d91a 100644 --- a/app/generated_resources.grd +++ b/app/generated_resources.grd @@ -324,7 +324,7 @@ are declared in tools/grit/grit_args.gni. - + @@ -498,8 +498,8 @@ are declared in tools/grit/grit_args.gni. Disable - - + + Search cleared @@ -5178,7 +5178,7 @@ are declared in tools/grit/grit_args.gni. - Change your settings that control websites' access to features such as cookies, JavaScript, plugins, geolocation, microphone, camera, etc. + Change and grant access to features such as geolocation, microphone, camera, cookies, etc., for all your websites and extensions, including this extension. Change your privacy-related settings @@ -5431,7 +5431,7 @@ are declared in tools/grit/grit_args.gni. - + Show me @@ -7533,6 +7533,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Violet + + $1Red color + You won't see this specific message again @@ -8022,6 +8025,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Choose what buttons show in the toolbar + + Enabled + To rearrange buttons on the toolbar, drag them @@ -8217,6 +8223,9 @@ Keep your key file in a safe place. You will need it to create new versions of y See more + + See more meetings on your Calendar + Top picks for you @@ -8341,7 +8350,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Hide for 12 hours - See your Outlook Calendar and Sharepoint files + See your Outlook Calendar and SharePoint and OneDrive files Easily access recent documents and upcoming calendar events @@ -8350,7 +8359,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Sign in with Microsoft - If this card is disabled, your Microsoft cards such as Sharepoint and Outlook Calendar will be disabled as well. + If this card is disabled, your Microsoft cards such as SharePoint and OneDrive files and Outlook Calendar will be disabled as well. @@ -9145,6 +9154,12 @@ Keep your key file in a safe place. You will need it to create new versions of y New tab + + Scroll to first tab + + + Scroll to last tab + Search by voice @@ -10365,7 +10380,7 @@ Check your passwords anytime in $1Brave P Suggest strong password - + Use a passkey on a different device @@ -10845,7 +10860,7 @@ Check your passwords anytime in $1Brave P other {Add tabs to new group}} - Split tab with active tab + Show side-by-side New group @@ -10949,7 +10964,7 @@ Check your passwords anytime in $1Brave P other {Add Tabs to New Group}} - Split Tab With Active Tab + Show Side-By-Side New Group @@ -11010,6 +11025,11 @@ Check your passwords anytime in $1Brave P + + + Side By Side Resize Handle + + To search your tabs, click here @@ -11655,12 +11675,6 @@ Check your passwords anytime in $1Brave P Recent Activity - - Last Update to this Tab - - - Latest Updates to this Group - @@ -11806,16 +11820,19 @@ Check your passwords anytime in $1Brave P Recent activity - - Last update to this tab - - - Latest updates to this group - + + + Last update to this tab + + + Latest updates to this group + + + Anyone with the link can edit all tabs, so share wisely. Link expires in 48 hours. @@ -11886,11 +11903,14 @@ Check your passwords anytime in $1Brave P Block $1John Doe? + + $1John Doe ($2johndoe@gmail.com) will immediately lose access to the “$3Vacation” tab group, and will no longer be able to interact with you across Brave services. + - You’ll immediately lose access to the “$1Vacation” tab group, and $1Ali Connors ($2ali.connors@gmail.com) will no longer be able to interact with you across Brave services. + You’ll immediately lose access to the “$1Vacation” tab group, and $2Ali Connors ($3ali.connors@gmail.com) will no longer be able to interact with you across Brave services. Learn about blocked accounts @@ -11946,15 +11966,24 @@ Check your passwords anytime in $1Brave P + + Keep tab group? + {NUM_GROUPS, plural, =1 {Keep this group to add tabs later, or delete it if you no longer need it.} other {Keep these groups to add tabs later, or delete them if you no longer need them.}} + + Keep this group to add tabs later, or delete it if you no longer need it. + If you delete it, everyone will immediately lose access to the "$1Vacation" tab group, and it will be deleted from all devices. {NUM_GROUPS, plural, =1 {Keep this group to add tabs later, or leave it if you no longer want access to it} other {Keep these groups to add tabs later, or leave them if you no longer want access to them}} + + Keep this group to add tabs later, or leave it if you no longer want access to it. + @@ -11964,6 +11993,9 @@ Check your passwords anytime in $1Brave P $1Ali changed this tab + + No updates to this group + @@ -11997,6 +12029,15 @@ Check your passwords anytime in $1Brave P Changes made are seen by everyone in the group + + Shared tab groups feedback + + + Send your feedback about shared tab groups here + + + Select the feedback button to send feedback regarding the shared tab groups feature + @@ -12030,6 +12071,12 @@ Check your passwords anytime in $1Brave P Leave group + + Keep group + + + Delete group + Loading @@ -12291,8 +12338,8 @@ Check your passwords anytime in $1Brave P - + Not necessary on Android that uses native UI in settings unless extensions are enabled. --> + Your home page has been set. @@ -13486,9 +13533,6 @@ This can include information about installed software, files, your browser, and Cancel - - Ok - To stay safer online with your parent’s choices, sign in to your own profile as $1john@gmail.com @@ -13498,9 +13542,6 @@ This can include information about installed software, files, your browser, and Continue as $1Bob - - This will separate your browsing from $1bob@example.com - You just signed in a managed account, creating a new managed profile will allow you to access some resources linked to that account. @@ -13973,15 +14014,6 @@ Please help our engineers fix this problem. Tell us what happened right before y Your account sign-in details are out of date. Please sign out and sign in again. - - Your password has expired. Please sign out then sign in again to change it. - - - Your password has been changed on the server. Please sign out then sign in again. - - - Failed to get authentication token. Please sign out then sign in again to try again. - Advanced settings @@ -15323,8 +15355,8 @@ Please help our engineers fix this problem. Tell us what happened right before y Options for sharing are managed by your organization. Some items may be hidden. - - Open System Preferences + + Open System Settings Choose a different screen @@ -15336,9 +15368,6 @@ Please help our engineers fix this problem. Tell us what happened right before y This Tab - - Other Tab - Select a tab to share @@ -15891,9 +15920,6 @@ Please help our engineers fix this problem. Tell us what happened right before y $1www.google.com wants to connect to a serial port - - $1Virtual COM Port ($2COM1) - Connect @@ -15906,19 +15932,22 @@ Please help our engineers fix this problem. Tell us what happened right before y USB device from $2Brave (product $10x12AB) - - USB device ($212AB:$112AB) - - - USB devices from vendor $112AB - USB devices from $1Brave - - Any serial port - + + $1Virtual COM Port ($2COM1) + + + USB device ($212AB:$112AB) + + + USB devices from vendor $112AB + + + Any serial port + @@ -16435,7 +16464,7 @@ Please help our engineers fix this problem. Tell us what happened right before y - + Brave needs permission to use Bluetooth to connect to your device @@ -16680,24 +16709,12 @@ Please help our engineers fix this problem. Tell us what happened right before y On other devices - - From your Brave profile - Your Brave profile - - From iCloud Keychain - iCloud Keychain - - From "$1Dashlane" - - - From Windows Hello - Windows Hello @@ -16913,57 +16930,75 @@ Please help our engineers fix this problem. Tell us what happened right before y Sign in to $1webauthn.io + + + Sign in faster next time + + + + $1example.com just created a passkey for your account. Passkeys offer a faster and safer way to sign in and are saved in Brave Password Manager for $2elisa.beckett@gmail.com. $3Learn more about passkeys + + + + Learn more about passkeys + + + + Manage passwords and passkeys + + + - - Bluetooth is disabled + + Turn on Bluetooth? - + Check your device settings and turn it on to continue - + Try again - - Scan this QR code to use an ID from an Android device + + To choose an ID, scan the QR code - - Scan this QR code with a camera on the device from which you want to retrieve an ID for $1example.com + + Safely use an ID from your Android device - + QR code - - Connecting to your device + + Connecting... - - Follow the steps on your device + + Follow the steps on your other device - - Make sure you trust this site with your data + + Do you trust this site with your data? - - $1www.cheapalcohol.com wants to use personal info from your digital wallet. Only continue if you trust this site. + + $1www.cheapalcohol.com wants to use personal info from your digital wallet. - + Cancel - + $1www.cheapalcohol.com wants to use personal info from your digital wallet. Only continue if you trust this site. Dangerous sites might trick you into revealing things like your legal name or ID number. - + Back to safety - + Continue @@ -17507,6 +17542,12 @@ Please help our engineers fix this problem. Tell us what happened right before y profile picture + + phone number + + + username + To continue, $1idp.com will share your $2name and email address with this site. @@ -17935,12 +17976,6 @@ Please help our engineers fix this problem. Tell us what happened right before y - - Location - - - Webview - $1Work address form filled. @@ -18196,6 +18231,14 @@ Please help our engineers fix this problem. Tell us what happened right before y You can get a summary of what people are saying in their reviews + + + + + Brave Apps will soon be deprecated. For alternatives contact the developer or your IT service contact. + + + diff --git a/app/generated_resources_override.grd b/app/generated_resources_override.grd index c017c9ab2494..03ebe636b294 100644 --- a/app/generated_resources_override.grd +++ b/app/generated_resources_override.grd @@ -113,7 +113,7 @@ are declared in tools/grit/grit_args.gni. - + @@ -151,7 +151,7 @@ are declared in tools/grit/grit_args.gni. - + @@ -474,7 +474,7 @@ are declared in tools/grit/grit_args.gni. - + @@ -877,7 +877,7 @@ are declared in tools/grit/grit_args.gni. - + Not from Web Store. @@ -1147,7 +1147,6 @@ are declared in tools/grit/grit_args.gni. - @@ -1313,6 +1312,9 @@ are declared in tools/grit/grit_args.gni. + + + diff --git a/app/os_settings_strings.grdp b/app/os_settings_strings.grdp index 2a01d4327c33..3438e93493ea 100644 --- a/app/os_settings_strings.grdp +++ b/app/os_settings_strings.grdp @@ -1037,7 +1037,7 @@ Help me read - Summarize content or ask follow-up questions. + Summarize content or ask questions. Help me write @@ -7326,5 +7326,14 @@ Press & hold keyboard keys to see accent marks and special characters. This ChromeOS is up to date + + + + Create image + + + Enter a custom prompt or highlight text to create an image. + + diff --git a/app/password_manager_ui_strings.grdp b/app/password_manager_ui_strings.grdp index 9e13def7115b..c7bf184871e6 100644 --- a/app/password_manager_ui_strings.grdp +++ b/app/password_manager_ui_strings.grdp @@ -696,6 +696,12 @@ You created this passkey on $12024-02-01 + + Automatically create a passkey to sign in faster + + + Allow sites and apps to upgrade existing accounts to use passkeys + Remove access to your passkeys on this device diff --git a/app/profiles_strings.grdp b/app/profiles_strings.grdp index 21a5db29c2e8..3be8f7ed8cf1 100644 --- a/app/profiles_strings.grdp +++ b/app/profiles_strings.grdp @@ -87,16 +87,13 @@ Turn on sync... - - Continue as $1Bob + + Sign in Continue as $1John - - Sync is off - Sync as $1John Doe @@ -112,12 +109,6 @@ Sync is paused - - {0, plural, - =1 {Close # window} - other {Close # windows} - } - Sign in to get your bookmarks, history, passwords, and other settings on all your devices. @@ -146,10 +137,19 @@ This profile is managed + + {0, plural, + =1 {Close Guest} + other {Close Guest (# windows)} + } + + + {0, plural, + =1 {Close Private} + other {Close Private (# windows)} + } + - - Other profiles - Your accounts @@ -182,9 +182,6 @@ - - Other Profiles - Your Accounts @@ -632,17 +629,20 @@ Add existing browsing data to managed profile - - About this profile + + About school profiles + + + About work profiles Set up a new profile - This profile is managed by your organization, which can view some information, including + Your profile is managed by your organization, which can view some information, including - This profile is managed by $1example.com, which can view some information, including + Your profile is managed by $1example.com, which can view some information, including Profile information @@ -651,7 +651,10 @@ Device information - To make sure this device can be used safely, your organization can see information about its operating system, browser, and settings, and what software is installed on the device. + To make sure this device can be used safely, your organization can see information about its operating system, browser, and settings, and what software is installed on the device + + + Back Setting up your profile ... @@ -686,32 +689,71 @@ Contact your administrator for more information - + Sign in to get your passwords and more on all your devices + + Set up a school profile to save and use your passwords and more in your account + + + Set up a work profile to save and use your passwords and more in your account + - Keep existing browsing data separate from your work profile? + Do you want to create a new profile for work? - Keep existing browsing data separate from your school profile? + Do you want to create a new profile for school? Keep existing browsing data separate from this new profile? - - Yes, keep it separate (recommended) + + Yes, keep my data separate from school (recommended) + + + Yes, keep my data separate from work (recommended) - - Yes, keep it separate + + Yes, keep my data separate from school + + + Yes, keep my data separate from work - Your existing browsing data will remain in the existing profile. This new profile will not contain any previous browsing data. + Data that is saved only on this device will remain in the existing profile + + + No, continue to work in this profile - - No, move it into this new profile + + No, continue to use for school in this profile - This includes bookmarks, extensions and your browsing history of sites. + Your organization will be able to see and manage any existing browsing data, such as passwords and more + + + {BROWSING_HISTORY_COUNT, plural, + =1 {your browsing history of # site} + other {your browsing history of # sites}} + + + {BOOKMARKS_COUNT, plural, + =1 {# extension} + other {# extensions}} + + + {EXTENSIONS_COUNT, plural, + =1 {# bookmark} + other {# bookmarks}} + + + You currently have $110 bookmarks, $210 extensions, $3your browsing history of 5 sites, and more + + + You currently have $110 bookmarks, $210 extensions, and more + + + You currently have $110 bookmarks, and more @@ -891,9 +933,6 @@ Back up data - - Save your bookmarks, passwords and more with sync - Save your bookmarks and more with sync @@ -989,6 +1028,12 @@ other {Addresses ({SELECTED_ITEMS})} } + + Current color theme + + + Theme: $1Green color + Save in account @@ -1007,5 +1052,19 @@ Select none + + + + {ACCOUNT_EXTENSIONS_COUNT, plural, + =1 {Remove 1 extension and the data it's saved on this device} + other {Remove {ACCOUNT_EXTENSIONS_COUNT} extensions and the data they've saved on this device} + } + + + {ACCOUNT_EXTENSIONS_COUNT, plural, + =1 {This extension is saved in your Brave sync chain, but any data it’s saved only on this device may be deleted} + other {These extensions are saved in your Brave sync chain, but any data they've saved only on this device may be deleted} + } + diff --git a/app/profiles_strings_override.grdp b/app/profiles_strings_override.grdp index 3382b1ba0e25..a273c8f9f064 100644 --- a/app/profiles_strings_override.grdp +++ b/app/profiles_strings_override.grdp @@ -24,6 +24,12 @@ + + {0, plural, + =1 {Close Private} + other {Close Private (# windows)} + } + diff --git a/app/settings_brave_strings.grdp b/app/settings_brave_strings.grdp index 0f85a0666736..0bce723082c5 100644 --- a/app/settings_brave_strings.grdp +++ b/app/settings_brave_strings.grdp @@ -179,9 +179,6 @@ - - Sites will probably work as you expect but won't remember you after you close all Brave windows - Sites will probably work as expected. You'll be signed out of most sites when you close all Brave windows, except your Brave sync chain if you're signed in to Brave. diff --git a/app/settings_strings.grdp b/app/settings_strings.grdp index a7b0eb8bbe6e..29d854c73218 100644 --- a/app/settings_strings.grdp +++ b/app/settings_strings.grdp @@ -275,9 +275,6 @@ Change - - Open Web Store - Pressing Tab on a webpage highlights links, as well as form fields @@ -2471,6 +2468,9 @@ Sites automatically follow this setting when you visit them. Sites usually send notifications to let you know about breaking news or chat messages. + + Sites usually send notifications to let you know about breaking news or chat messages. + Customized behaviors @@ -2885,6 +2885,9 @@ Expand all requests + + How to show requests + Don't allow sites to send notifications @@ -3640,37 +3643,37 @@ - Sites you visit can embed content from other sites, for example images, ads, and text. These other sites can ask for permission to use info they've saved about you as you browse the site. + Sites you visit can embed content from other sites, for example images, ads, and text. These other sites can ask for permission to use information they've saved about you as you browse the site. - - Sites can ask to use info they've saved about you + + Sites can ask to use information they've saved about you - - Sites are blocked from asking you to use info they've saved about you + + Sites are blocked from asking you to use information they've saved about you - Allowed to use info they've saved about you + Allowed to use information they've saved about you - Not allowed to use info they've saved about you + Not allowed to use information they've saved about you Remove $1google.com - + Remove $1embedding.com from $2top-level.com - + Show sites - + Show less - - can use your info as you browse + + can use your information as you browse - - is blocked from using your info on + + is blocked from using your information on @@ -4567,14 +4570,6 @@ When you use organize tabs, the titles and URLs of your open tabs are sent to Brave to generate suggested tab groups - - - Create themes with AI - - - Helps you design custom themes for Brave - - Easily compare similar products diff --git a/app/settings_strings_override.grdp b/app/settings_strings_override.grdp index cd5442ad9e6d..ac36e04c688d 100644 --- a/app/settings_strings_override.grdp +++ b/app/settings_strings_override.grdp @@ -47,9 +47,6 @@ Automatically pin new tab groups created on any device to the bookmarks - - Open Web Store - diff --git a/app/shared_settings_strings.grdp b/app/shared_settings_strings.grdp index 3b064f60fcf6..22d868ab98a2 100644 --- a/app/shared_settings_strings.grdp +++ b/app/shared_settings_strings.grdp @@ -400,18 +400,9 @@ Review your synced data - - Manage device sync - Manage browser sync - - Across your apps and Brave browser - - - Manage Brave browser sync - Sync and Brave services diff --git a/app/theme/brave_theme_resources.grd b/app/theme/brave_theme_resources.grd index c90f08fb9c26..0721ca4ec6ff 100644 --- a/app/theme/brave_theme_resources.grd +++ b/app/theme/brave_theme_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/app/theme/brave_unscaled_resources.grd b/app/theme/brave_unscaled_resources.grd index 37c6ded3256b..fc3e061f1c06 100644 --- a/app/theme/brave_unscaled_resources.grd +++ b/app/theme/brave_unscaled_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/browser/about_flags.cc b/browser/about_flags.cc index 06e4dff3521c..c081862268ee 100644 --- a/browser/about_flags.cc +++ b/browser/about_flags.cc @@ -41,12 +41,12 @@ #include "build/build_config.h" #include "chrome/browser/ui/ui_features.h" #include "components/content_settings/core/common/features.h" -#include "components/flags_ui/feature_entry.h" -#include "components/flags_ui/feature_entry_macros.h" -#include "components/flags_ui/flags_state.h" #include "components/history/core/browser/features.h" #include "components/omnibox/common/omnibox_features.h" #include "components/translate/core/browser/translate_prefs.h" +#include "components/webui/flags/feature_entry.h" +#include "components/webui/flags/feature_entry_macros.h" +#include "components/webui/flags/flags_state.h" #include "net/base/features.h" #include "third_party/blink/public/common/features.h" diff --git a/browser/android/BUILD.gn b/browser/android/BUILD.gn index c96d1f713352..10a29070d9fe 100644 --- a/browser/android/BUILD.gn +++ b/browser/android/BUILD.gn @@ -41,11 +41,11 @@ source_set("android_browser_process") { "//chrome/common", "//components/content_settings/core/browser", "//components/content_settings/core/browser:cookie_settings", - "//components/flags_ui", "//components/ntp_tiles", "//components/sync", "//components/translate/core/browser", "//components/unified_consent", + "//components/webui/flags", "//url", ] } @@ -59,6 +59,7 @@ source_set("tab_features") { deps = [ "//base", "//brave/browser/ai_chat", + "//chrome/browser/android:tabs_public", "//chrome/browser/profiles:profile", "//content/public/browser", ] diff --git a/browser/android/brave_feature_util.cc b/browser/android/brave_feature_util.cc index ce1bcaf02ceb..7afb32a97025 100644 --- a/browser/android/brave_feature_util.cc +++ b/browser/android/brave_feature_util.cc @@ -10,8 +10,8 @@ #include "brave/build/android/jni_headers/BraveFeatureUtil_jni.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/browser_process.h" -#include "components/flags_ui/feature_entry.h" -#include "components/flags_ui/pref_service_flags_storage.h" +#include "components/webui/flags/feature_entry.h" +#include "components/webui/flags/pref_service_flags_storage.h" namespace chrome { namespace android { diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java b/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java similarity index 100% rename from android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java rename to browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java b/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java similarity index 100% rename from android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java rename to browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java b/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java similarity index 100% rename from android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java rename to browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java diff --git a/browser/bookmarks/android/sources.gni b/browser/bookmarks/android/sources.gni new file mode 100644 index 000000000000..526cb1014fdd --- /dev/null +++ b/browser/bookmarks/android/sources.gni @@ -0,0 +1,11 @@ +# Copyright (c) 2025 The Brave Authors. All rights reserved. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at https://mozilla.org/MPL/2.0/. */ + +# We have to do via sources to avoid circular dependencies. +brave_browser_bookmarks_android_sources = [ + "//brave/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkDelegate.java", + "//brave/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java", + "//brave/browser/bookmarks/android/java/src/org/chromium/chrome/browser/bookmarks/BraveBookmarkUiPrefs.java", +] diff --git a/browser/brave_ads/ads_service_delegate.cc b/browser/brave_ads/ads_service_delegate.cc index 23d1ec6d5860..25489f0fda9b 100644 --- a/browser/brave_ads/ads_service_delegate.cc +++ b/browser/brave_ads/ads_service_delegate.cc @@ -118,12 +118,17 @@ AdsServiceDelegate::AdsServiceDelegate( notification_ad_platform_bridge) : profile_(profile), local_state_(local_state), - search_engine_choice_service_( + prepopulate_data_resolver_( *profile_->GetPrefs(), - local_state_, CHECK_DEREF( regional_capabilities::RegionalCapabilitiesServiceFactory:: - GetForProfile(&profile)), + GetForProfile(&profile))), + search_engine_choice_service_( + *profile_->GetPrefs(), + local_state_, + *regional_capabilities::RegionalCapabilitiesServiceFactory:: + GetForProfile(&profile), + prepopulate_data_resolver_, /*is_profile_eligible_for_dse_guest_propagation=*/false), adaptive_captcha_service_(adaptive_captcha_service), notification_ad_platform_bridge_( @@ -134,7 +139,7 @@ AdsServiceDelegate::~AdsServiceDelegate() {} std::string AdsServiceDelegate::GetDefaultSearchEngineName() { const auto template_url_data = TemplateURLPrepopulateData::GetPrepopulatedFallbackSearch( - profile_->GetPrefs(), &search_engine_choice_service_); + *profile_->GetPrefs(), search_engine_choice_service_.GetCountryId()); const std::u16string& default_search_engine_name = template_url_data ? template_url_data->short_name() : u""; diff --git a/browser/brave_ads/ads_service_delegate.h b/browser/brave_ads/ads_service_delegate.h index 3fdef267b272..c260aedf2fb8 100644 --- a/browser/brave_ads/ads_service_delegate.h +++ b/browser/brave_ads/ads_service_delegate.h @@ -15,6 +15,7 @@ #include "brave/components/brave_ads/core/browser/service/ads_service.h" #include "components/prefs/pref_service.h" #include "components/search_engines/search_engine_choice/search_engine_choice_service.h" +#include "components/search_engines/template_url_prepopulate_data_resolver.h" class Profile; @@ -73,6 +74,7 @@ class AdsServiceDelegate : public AdsService::Delegate { const raw_ref profile_; const raw_ptr local_state_ = nullptr; // Not owned. + TemplateURLPrepopulateData::Resolver prepopulate_data_resolver_; search_engines::SearchEngineChoiceService search_engine_choice_service_; const raw_ref adaptive_captcha_service_; diff --git a/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc b/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc index a0d86ffd2760..be6c8dfac779 100644 --- a/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc +++ b/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc @@ -353,7 +353,7 @@ class BraveAdsTabHelperTest : public PlatformBrowserTest { void SimulateClick(const std::string& selectors, bool has_user_gesture) { const std::string javascript = base::ReplaceStringPlaceholders( R"(document.querySelector("$1").click();)", {selectors}, nullptr); - ExecuteJavaScript(javascript, has_user_gesture); + ASSERT_TRUE(ExecuteJavaScript(javascript, has_user_gesture)); } void StartVideoPlayback(const std::string& selectors) { @@ -361,13 +361,13 @@ class BraveAdsTabHelperTest : public PlatformBrowserTest { R"(document.querySelector("$1")?.play();)", {selectors}, nullptr); // Video elements must be executed with a user gesture. - ExecuteJavaScript(javascript, /*has_user_gesture=*/true); + ASSERT_TRUE(ExecuteJavaScript(javascript, /*has_user_gesture=*/true)); } void PauseVideoPlayback(const std::string& selectors) { const std::string javascript = base::ReplaceStringPlaceholders( R"(document.querySelector("$1")?.pause();)", {selectors}, nullptr); - ExecuteJavaScript(javascript, /*has_user_gesture=*/true); + ASSERT_TRUE(ExecuteJavaScript(javascript, /*has_user_gesture=*/true)); } void RestoreBrowser(Profile* const profile) { diff --git a/browser/brave_browser_process_impl.cc b/browser/brave_browser_process_impl.cc index 9c85ecc5f958..fe412cc7b532 100644 --- a/browser/brave_browser_process_impl.cc +++ b/browser/brave_browser_process_impl.cc @@ -171,7 +171,7 @@ void BraveBrowserProcessImpl::Init() { local_state()->ClearPref(prefs::kSuppressUnsupportedOSWarning); } - brave::PrepareSearchSuggestionsConfig(local_state(), + brave::PrepareSearchSuggestionsConfig(*local_state(), first_run::IsChromeFirstRun()); #endif } diff --git a/browser/extensions/brave_crx_generation_browsertest.cc b/browser/extensions/brave_crx_generation_browsertest.cc index b5303ee5a723..23ff24a8cd75 100644 --- a/browser/extensions/brave_crx_generation_browsertest.cc +++ b/browser/extensions/brave_crx_generation_browsertest.cc @@ -66,8 +66,9 @@ class InstallCrxFileWaiter : public extensions::InstallObserver { } void OnFinishCrxInstall(content::BrowserContext* context, - const extensions::CrxInstaller& installer, + const base::FilePath& source_file, const std::string& extension_id, + const Extension* extension, bool success) override { did_install_extension_ = success; run_loop_.Quit(); diff --git a/browser/farbling/BUILD.gn b/browser/farbling/BUILD.gn index 68a979a3437a..0cb5b0ccf578 100644 --- a/browser/farbling/BUILD.gn +++ b/browser/farbling/BUILD.gn @@ -46,7 +46,7 @@ if (!is_android) { "//chrome/test:test_support", "//chrome/test:test_support_ui", "//components/content_settings/renderer", - "//components/embedder_support:browser_util", + "//components/embedder_support:user_agent", "//components/language/core/browser", "//components/permissions:permissions", "//components/prefs", diff --git a/browser/metrics/variations_browsertest.cc b/browser/metrics/variations_browsertest.cc index 689f9aaa301c..ab460896cfb5 100644 --- a/browser/metrics/variations_browsertest.cc +++ b/browser/metrics/variations_browsertest.cc @@ -38,12 +38,12 @@ const SignedSeedData& GetBraveSignedSeedData() { "xmQaBThr1i8ARQ1rKEinHluXeR7ve5fqy7L4AIgNym2PbtlL+9142+" "T8gUjjEsoT28J3HqE4IEa1eFvKLw="; - static const SignedSeedData kBraveTestSeedData{ - study_names, - kBase64UncompressedData, - kBase64CompressedData, - kBase64Signature, - }; + static const SignedSeedData kBraveTestSeedData{study_names, + kBase64UncompressedData, + kBase64CompressedData, + kBase64Signature, + /*in_compressed_data=*/{}, + /*in_compressed_data_size=*/0}; return kBraveTestSeedData; } diff --git a/browser/misc_metrics/BUILD.gn b/browser/misc_metrics/BUILD.gn index ffcf6bb9a163..b4ec6bc3ae62 100644 --- a/browser/misc_metrics/BUILD.gn +++ b/browser/misc_metrics/BUILD.gn @@ -51,11 +51,13 @@ static_library("misc_metrics_impl") { "//brave/browser/misc_metrics/extension_metrics.h", "//brave/browser/misc_metrics/theme_metrics.cc", "//brave/browser/misc_metrics/theme_metrics.h", + "//brave/browser/misc_metrics/usage_clock.h", "//brave/browser/misc_metrics/vertical_tab_metrics.cc", "//brave/browser/misc_metrics/vertical_tab_metrics.h", ] deps += [ "//brave/browser/themes", + "//chrome/browser/metrics/desktop_session_duration:desktop_session_duration", "//chrome/browser/themes", "//chrome/browser/ui/tabs:tab_strip", "//extensions/browser", @@ -95,10 +97,12 @@ source_set("unit_tests") { sources += [ "extension_metrics_unittest.cc", "theme_metrics_unittest.cc", + "usage_clock_unittest.cc", ] deps += [ "//brave/browser/themes", + "//chrome/browser/metrics/desktop_session_duration:desktop_session_duration", "//chrome/browser/themes", ] } diff --git a/browser/misc_metrics/page_metrics_unittest.cc b/browser/misc_metrics/page_metrics_unittest.cc index 05aa30f671d9..0f6afce0411d 100644 --- a/browser/misc_metrics/page_metrics_unittest.cc +++ b/browser/misc_metrics/page_metrics_unittest.cc @@ -74,11 +74,13 @@ class PageMetricsUnitTest : public testing::Test { auto google_prepopulate_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - profile_->GetPrefs(), search_engine_choice_service_, + *profile_->GetPrefs(), + search_engine_choice_service_->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_GOOGLE); auto brave_prepopulate_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - profile_->GetPrefs(), search_engine_choice_service_, + *profile_->GetPrefs(), + search_engine_choice_service_->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE); google_template_url_ = std::make_unique(*google_prepopulate_data); diff --git a/browser/misc_metrics/sources.gni b/browser/misc_metrics/sources.gni index 7bc742e1d001..fa5092ebf97d 100644 --- a/browser/misc_metrics/sources.gni +++ b/browser/misc_metrics/sources.gni @@ -9,6 +9,10 @@ brave_browser_misc_metrics_sources = [ "//brave/browser/misc_metrics/profile_misc_metrics_service_factory.cc", "//brave/browser/misc_metrics/uptime_monitor.cc", ] +if (!is_android) { + brave_browser_misc_metrics_sources += + [ "//brave/browser/misc_metrics/usage_clock.cc" ] +} brave_browser_misc_metrics_deps = [ "//brave/browser:browser_process", diff --git a/browser/misc_metrics/uptime_monitor.cc b/browser/misc_metrics/uptime_monitor.cc index 4d6488c0548b..426b739d0bd6 100644 --- a/browser/misc_metrics/uptime_monitor.cc +++ b/browser/misc_metrics/uptime_monitor.cc @@ -11,7 +11,7 @@ #include "components/prefs/pref_service.h" #if !BUILDFLAG(IS_ANDROID) -#include "chrome/browser/resource_coordinator/usage_clock.h" +#include "brave/browser/misc_metrics/usage_clock.h" #endif namespace misc_metrics { @@ -42,7 +42,7 @@ void UptimeMonitor::Init() { } RecordP3A(); #if !BUILDFLAG(IS_ANDROID) - usage_clock_ = std::make_unique(); + usage_clock_ = std::make_unique(); timer_.Start( FROM_HERE, kUsageTimeQueryInterval, base::BindRepeating(&UptimeMonitor::RecordUsage, base::Unretained(this))); diff --git a/browser/misc_metrics/uptime_monitor.h b/browser/misc_metrics/uptime_monitor.h index 1a379f2d19b8..14d479023216 100644 --- a/browser/misc_metrics/uptime_monitor.h +++ b/browser/misc_metrics/uptime_monitor.h @@ -14,14 +14,12 @@ class PrefService; class PrefRegistrySimple; +namespace misc_metrics { + #if !BUILDFLAG(IS_ANDROID) -namespace resource_coordinator { class UsageClock; -} // namespace resource_coordinator #endif -namespace misc_metrics { - inline constexpr char kBrowserOpenTimeHistogramName[] = "Brave.Uptime.BrowserOpenTime.2"; @@ -54,7 +52,7 @@ class UptimeMonitor { raw_ptr local_state_; #if !BUILDFLAG(IS_ANDROID) - std::unique_ptr usage_clock_; + std::unique_ptr usage_clock_; base::TimeDelta current_total_usage_; base::RepeatingTimer timer_; diff --git a/browser/misc_metrics/usage_clock.cc b/browser/misc_metrics/usage_clock.cc new file mode 100644 index 000000000000..a6e30a2cfa1b --- /dev/null +++ b/browser/misc_metrics/usage_clock.cc @@ -0,0 +1,59 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "brave/browser/misc_metrics/usage_clock.h" + +#include "chrome/browser/resource_coordinator/time.h" + +namespace misc_metrics { + +UsageClock::UsageClock() + : current_usage_session_start_time_(resource_coordinator::NowTicks()) { + if (metrics::DesktopSessionDurationTracker::IsInitialized()) { + auto* tracker = metrics::DesktopSessionDurationTracker::Get(); + tracker->AddObserver(this); + if (!tracker->in_session()) { + current_usage_session_start_time_ = base::TimeTicks(); + } + } +} + +UsageClock::~UsageClock() { + if (metrics::DesktopSessionDurationTracker::IsInitialized()) { + metrics::DesktopSessionDurationTracker::Get()->RemoveObserver(this); + } +} + +base::TimeDelta UsageClock::GetTotalUsageTime() const { + base::TimeDelta elapsed_time_in_session = usage_time_in_completed_sessions_; + if (IsInUse()) { + elapsed_time_in_session += + resource_coordinator::NowTicks() - current_usage_session_start_time_; + } + return elapsed_time_in_session; +} + +bool UsageClock::IsInUse() const { + return !current_usage_session_start_time_.is_null(); +} + +void UsageClock::OnSessionStarted(base::TimeTicks session_start) { + // Ignore |session_start| because it doesn't come from the resource + // coordinator clock. + DCHECK(!IsInUse()); + current_usage_session_start_time_ = resource_coordinator::NowTicks(); +} + +void UsageClock::OnSessionEnded(base::TimeDelta session_length, + base::TimeTicks session_end) { + // Ignore |session_length| because it wasn't measured using the resource + // coordinator clock. + DCHECK(IsInUse()); + usage_time_in_completed_sessions_ += + resource_coordinator::NowTicks() - current_usage_session_start_time_; + current_usage_session_start_time_ = base::TimeTicks(); +} + +} // namespace misc_metrics diff --git a/browser/misc_metrics/usage_clock.h b/browser/misc_metrics/usage_clock.h new file mode 100644 index 000000000000..b7a5c7787f0e --- /dev/null +++ b/browser/misc_metrics/usage_clock.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_BROWSER_MISC_METRICS_USAGE_CLOCK_H_ +#define BRAVE_BROWSER_MISC_METRICS_USAGE_CLOCK_H_ + +#include "base/time/time.h" +#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h" + +namespace misc_metrics { + +// A clock that advances when Chrome is in use. +// +// See metrics::DesktopSessionDurationTracker for how Chrome usage is tracked. +// If metrics::DesktopSessionDurationTracker isn't initialized before this, the +// clock will advance continuously, regardless of Chrome usage. This avoids +// forcing all tests that indirectly depend on this to initialize +// metrics::DesktopSessionDurationTracker. +class UsageClock : public metrics::DesktopSessionDurationTracker::Observer { + public: + UsageClock(); + + UsageClock(const UsageClock&) = delete; + UsageClock& operator=(const UsageClock&) = delete; + + ~UsageClock() override; + + // Returns the amount of Chrome usage time since this was instantiated. + base::TimeDelta GetTotalUsageTime() const; + + // Returns true if Chrome is currently considered to be in use. + bool IsInUse() const; + + private: + void OnSessionStarted(base::TimeTicks session_start) override; + void OnSessionEnded(base::TimeDelta session_length, + base::TimeTicks session_end) override; + + // The total time elapsed in completed usage sessions. The duration of the + // current usage session, if any, must be added to this to get the total usage + // time of Chrome. + base::TimeDelta usage_time_in_completed_sessions_; + + // The time at which the current session started, or a null TimeTicks if not + // currently in a session. + base::TimeTicks current_usage_session_start_time_; +}; + +} // namespace misc_metrics + +#endif // BRAVE_BROWSER_MISC_METRICS_USAGE_CLOCK_H_ diff --git a/browser/misc_metrics/usage_clock_unittest.cc b/browser/misc_metrics/usage_clock_unittest.cc new file mode 100644 index 000000000000..3d83c57b24ba --- /dev/null +++ b/browser/misc_metrics/usage_clock_unittest.cc @@ -0,0 +1,68 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "brave/browser/misc_metrics/usage_clock.h" + +#include "base/test/simple_test_clock.h" +#include "base/test/simple_test_tick_clock.h" +#include "base/test/task_environment.h" +#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h" +#include "chrome/browser/resource_coordinator/time.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace misc_metrics { + +TEST(ResourceCoordinatorUsageClock, UsageClock) { + // Required to use DesktopSessionDurationTracker. + base::test::TaskEnvironment task_environment; + + { + base::SimpleTestClock clock; + base::SimpleTestTickClock tick_clock; + tick_clock.Advance(base::Minutes(42)); + resource_coordinator::ScopedSetClocksForTesting + scoped_set_clocks_for_testing(&clock, &tick_clock); + + metrics::DesktopSessionDurationTracker::Initialize(); + auto* tracker = metrics::DesktopSessionDurationTracker::Get(); + tracker->OnVisibilityChanged(true, base::TimeDelta()); + tracker->OnUserEvent(); + EXPECT_TRUE(tracker->in_session()); + + UsageClock usage_clock; + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::TimeDelta()); + EXPECT_TRUE(tracker->in_session()); + EXPECT_TRUE(usage_clock.IsInUse()); + + // Verify that time advances when Chrome is in use. + tick_clock.Advance(base::Minutes(1)); + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::Minutes(1)); + tick_clock.Advance(base::Minutes(1)); + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::Minutes(2)); + + // Verify that time is updated when Chrome stops being used. + tick_clock.Advance(base::Minutes(1)); + tracker->OnVisibilityChanged(false, base::TimeDelta()); + EXPECT_FALSE(tracker->in_session()); + EXPECT_FALSE(usage_clock.IsInUse()); + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::Minutes(3)); + + // Verify that time stays still when Chrome is not in use. + tick_clock.Advance(base::Minutes(1)); + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::Minutes(3)); + + // Verify that time advances again when Chrome is in use. + tracker->OnVisibilityChanged(true, base::TimeDelta()); + EXPECT_TRUE(tracker->in_session()); + EXPECT_TRUE(usage_clock.IsInUse()); + tick_clock.Advance(base::Minutes(1)); + EXPECT_EQ(usage_clock.GetTotalUsageTime(), base::Minutes(4)); + } + + // Must be after UsageClock destruction. + metrics::DesktopSessionDurationTracker::CleanupForTesting(); +} + +} // namespace misc_metrics diff --git a/browser/profile_resetter/brave_profile_resetter.cc b/browser/profile_resetter/brave_profile_resetter.cc index 89f95b6416da..fce663f7835d 100644 --- a/browser/profile_resetter/brave_profile_resetter.cc +++ b/browser/profile_resetter/brave_profile_resetter.cc @@ -13,6 +13,6 @@ void BraveProfileResetter::ResetDefaultSearchEngine() { ProfileResetter::ResetDefaultSearchEngine(); if (template_url_service_->loaded()) { - brave::ResetDefaultPrivateSearchProvider(profile_); + brave::ResetDefaultPrivateSearchProvider(*profile_); } } diff --git a/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts b/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts index 386c6f382277..e1cc4f3d776f 100644 --- a/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts +++ b/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts @@ -117,7 +117,7 @@ export class ModelConfigUI extends ModelConfigUIBase { this.checkEndpointValidity_() } - async handleClick_() { + handleClick_() { // If the user is attempting to use a private endpoint, we should show a // modal warning instructing them to enable the optional feature in order // to proceed diff --git a/browser/resources/settings/brave_sync_page/brave_sync_configure.ts b/browser/resources/settings/brave_sync_page/brave_sync_configure.ts index 9285f6db6f83..10f23e4d3591 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_configure.ts +++ b/browser/resources/settings/brave_sync_page/brave_sync_configure.ts @@ -137,7 +137,7 @@ export class SettingsBraveSyncConfigureElement extends SettingsBraveSyncConfigur router.navigateTo((router.getRoutes() as {BRAVE_SYNC: Route}).BRAVE_SYNC); } - async onPermanentlyDeleteSyncAccount_() { + onPermanentlyDeleteSyncAccount_() { // Clear sync code because after permanently deleting the chain user might // use the same page to create a new sync chain without reload. In worse // case, we will reload the sync code diff --git a/browser/resources/settings/brave_sync_page/brave_sync_page.ts b/browser/resources/settings/brave_sync_page/brave_sync_page.ts index d1fd76e234a0..6dc19c59f1f5 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_page.ts +++ b/browser/resources/settings/brave_sync_page/brave_sync_page.ts @@ -98,7 +98,7 @@ export class SettingsBraveSyncPageElement extends SettingsBraveSyncPageElementBa /** * Handler for when the sync state is pushed from the browser. */ - async handleSyncStatus_(syncStatus: BraveSyncStatus) { + handleSyncStatus_(syncStatus: BraveSyncStatus) { this.syncStatus_ = syncStatus; } diff --git a/browser/search_engines/normal_window_search_engine_provider_service.cc b/browser/search_engines/normal_window_search_engine_provider_service.cc index 7681b789fda3..bd3e38652a35 100644 --- a/browser/search_engines/normal_window_search_engine_provider_service.cc +++ b/browser/search_engines/normal_window_search_engine_provider_service.cc @@ -16,8 +16,8 @@ NormalWindowSearchEngineProviderService:: NormalWindowSearchEngineProviderService(Profile* profile) : profile_(profile) { - brave::UpdateDefaultSearchSuggestionsPrefs(g_browser_process->local_state(), - profile_->GetPrefs()); + brave::UpdateDefaultSearchSuggestionsPrefs(*g_browser_process->local_state(), + *profile_->GetPrefs()); private_search_provider_guid_.Init( prefs::kSyncedDefaultPrivateSearchProviderGUID, profile_->GetPrefs(), base::BindRepeating( @@ -52,9 +52,9 @@ void NormalWindowSearchEngineProviderService::OnTemplateURLServiceLoaded() { void NormalWindowSearchEngineProviderService:: PrepareInitialPrivateSearchProvider() { - brave::PrepareDefaultPrivateSearchProviderDataIfNeeded(profile_); + brave::PrepareDefaultPrivateSearchProviderDataIfNeeded(*profile_); } void NormalWindowSearchEngineProviderService::OnPreferenceChanged() { - brave::UpdateDefaultPrivateSearchProviderData(profile_); + brave::UpdateDefaultPrivateSearchProviderData(*profile_); } diff --git a/browser/search_engines/search_engine_provider_service_browsertest.cc b/browser/search_engines/search_engine_provider_service_browsertest.cc index f3e4ebd1b977..8a548a5b1126 100644 --- a/browser/search_engines/search_engine_provider_service_browsertest.cc +++ b/browser/search_engines/search_engine_provider_service_browsertest.cc @@ -83,7 +83,7 @@ std::string GetBraveSearchProviderSyncGUID(Profile* profile) { search_engines::SearchEngineChoiceService* search_engine_choice_service = search_engines::SearchEngineChoiceServiceFactory::GetForProfile(profile); auto data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - profile->GetPrefs(), search_engine_choice_service, + *profile->GetPrefs(), search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE); DCHECK(data); return data->sync_guid; @@ -305,7 +305,7 @@ std::unique_ptr TestExtensionSearchEngine(Profile* profile) { // Enforcing that `kTestExtensionPrepopulatedId` is not part of the // prepopulated set for the current profile's country. for (auto& data : TemplateURLPrepopulateData::GetPrepopulatedEngines( - prefs, search_engine_choice_service)) { + *prefs, search_engine_choice_service->GetCountryId())) { EXPECT_NE(data->prepopulate_id, kTestExtensionPrepopulatedId); } @@ -325,7 +325,8 @@ std::unique_ptr TestExtensionSearchEngine(Profile* profile) { std::unique_ptr prepopulated = TemplateURLPrepopulateData::GetPrepopulatedEngineFromFullList( - prefs, search_engine_choice_service, kTestExtensionPrepopulatedId); + *prefs, search_engine_choice_service->GetCountryId(), + kTestExtensionPrepopulatedId); CHECK(prepopulated); // Values below do not exist in extension manifest and are taken from // prepopulated engine with prepopulated_id set in extension manifest. diff --git a/browser/search_engines/search_engine_provider_util.cc b/browser/search_engines/search_engine_provider_util.cc index 955a1a1d11d4..bcfe7a8b2ebb 100644 --- a/browser/search_engines/search_engine_provider_util.cc +++ b/browser/search_engines/search_engine_provider_util.cc @@ -36,28 +36,28 @@ constexpr auto kTargetCountriesForEnableSearchSuggestionsByDefault = "MX", "US"}); } -void SetBraveAsDefaultPrivateSearchProvider(Profile* profile) { - auto* prefs = profile->GetPrefs(); +void SetBraveAsDefaultPrivateSearchProvider(Profile& profile) { + auto& prefs = *profile.GetPrefs(); search_engines::SearchEngineChoiceService* search_engine_choice_service = - search_engines::SearchEngineChoiceServiceFactory::GetForProfile(profile); + search_engines::SearchEngineChoiceServiceFactory::GetForProfile(&profile); auto data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - prefs, search_engine_choice_service, + prefs, search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE); DCHECK(data); - prefs->SetString(prefs::kSyncedDefaultPrivateSearchProviderGUID, - data->sync_guid); - prefs->SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, - TemplateURLDataToDictionary(*data)); + prefs.SetString(prefs::kSyncedDefaultPrivateSearchProviderGUID, + data->sync_guid); + prefs.SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, + TemplateURLDataToDictionary(*data)); } -void UpdateDefaultPrivateSearchProviderData(Profile* profile) { - auto* service = TemplateURLServiceFactory::GetForProfile(profile); +void UpdateDefaultPrivateSearchProviderData(Profile& profile) { + auto* service = TemplateURLServiceFactory::GetForProfile(&profile); DCHECK(service->loaded()); - auto* prefs = profile->GetPrefs(); + auto& prefs = *profile.GetPrefs(); const std::string private_provider_guid = - prefs->GetString(prefs::kSyncedDefaultPrivateSearchProviderGUID); + prefs.GetString(prefs::kSyncedDefaultPrivateSearchProviderGUID); if (private_provider_guid.empty()) { // This can happen while resetting whole settings. @@ -69,8 +69,8 @@ void UpdateDefaultPrivateSearchProviderData(Profile* profile) { // Sync kSyncedDefaultPrivateSearchProviderData with newly updated provider's // one. if (auto* url = service->GetTemplateURLForGUID(private_provider_guid)) { - prefs->SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, - TemplateURLDataToDictionary(url->data())); + prefs.SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, + TemplateURLDataToDictionary(url->data())); return; } @@ -80,19 +80,19 @@ void UpdateDefaultPrivateSearchProviderData(Profile* profile) { SetBraveAsDefaultPrivateSearchProvider(profile); } -void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile* profile) { - auto* prefs = profile->GetPrefs(); +void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile& profile) { + auto& prefs = *profile.GetPrefs(); auto* preference = - prefs->FindPreference(prefs::kSyncedDefaultPrivateSearchProviderGUID); + prefs.FindPreference(prefs::kSyncedDefaultPrivateSearchProviderGUID); if (!preference) return; - auto* service = TemplateURLServiceFactory::GetForProfile(profile); + auto* service = TemplateURLServiceFactory::GetForProfile(&profile); DCHECK(service->loaded()); const std::string private_provider_guid = - prefs->GetString(prefs::kSyncedDefaultPrivateSearchProviderGUID); + prefs.GetString(prefs::kSyncedDefaultPrivateSearchProviderGUID); // Set Brave as a private window's initial search provider. if (private_provider_guid.empty()) { @@ -101,12 +101,12 @@ void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile* profile) { } preference = - prefs->FindPreference(prefs::kSyncedDefaultPrivateSearchProviderData); + prefs.FindPreference(prefs::kSyncedDefaultPrivateSearchProviderData); // Cache if url data is not yet existed. if (preference->IsDefaultValue()) { if (auto* url = service->GetTemplateURLForGUID(private_provider_guid)) { - prefs->SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, - TemplateURLDataToDictionary(url->data())); + prefs.SetDict(prefs::kSyncedDefaultPrivateSearchProviderData, + TemplateURLDataToDictionary(url->data())); } else { // This could happen with update default provider list when brave is not // updated for longtime. So it doesn't have any chance to cache url data. @@ -128,15 +128,15 @@ void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile* profile) { } } -void ResetDefaultPrivateSearchProvider(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); - prefs->ClearPref(prefs::kSyncedDefaultPrivateSearchProviderGUID); - prefs->ClearPref(prefs::kSyncedDefaultPrivateSearchProviderData); +void ResetDefaultPrivateSearchProvider(Profile& profile) { + PrefService& prefs = *profile.GetPrefs(); + prefs.ClearPref(prefs::kSyncedDefaultPrivateSearchProviderGUID); + prefs.ClearPref(prefs::kSyncedDefaultPrivateSearchProviderData); PrepareDefaultPrivateSearchProviderDataIfNeeded(profile); } -void PrepareSearchSuggestionsConfig(PrefService* local_state, bool first_run) { +void PrepareSearchSuggestionsConfig(PrefService& local_state, bool first_run) { if (!first_run) { return; } @@ -148,18 +148,18 @@ void PrepareSearchSuggestionsConfig(PrefService* local_state, bool first_run) { kTargetCountriesForEnableSearchSuggestionsByDefault.count( default_country_code); - local_state->SetBoolean(kEnableSearchSuggestionsByDefault, - enable_search_suggestions_default_value); + local_state.SetBoolean(kEnableSearchSuggestionsByDefault, + enable_search_suggestions_default_value); } -void UpdateDefaultSearchSuggestionsPrefs(PrefService* local_state, - PrefService* profile_prefs) { - if (!local_state->GetBoolean(kEnableSearchSuggestionsByDefault)) { +void UpdateDefaultSearchSuggestionsPrefs(PrefService& local_state, + PrefService& profile_prefs) { + if (!local_state.GetBoolean(kEnableSearchSuggestionsByDefault)) { return; } - profile_prefs->SetDefaultPrefValue(prefs::kSearchSuggestEnabled, - base::Value(true)); + profile_prefs.SetDefaultPrefValue(prefs::kSearchSuggestEnabled, + base::Value(true)); } } // namespace brave diff --git a/browser/search_engines/search_engine_provider_util.h b/browser/search_engines/search_engine_provider_util.h index 525fd88c2753..ab84fde63d88 100644 --- a/browser/search_engines/search_engine_provider_util.h +++ b/browser/search_engines/search_engine_provider_util.h @@ -11,18 +11,18 @@ class PrefService; namespace brave { -void SetBraveAsDefaultPrivateSearchProvider(Profile* profile); +void SetBraveAsDefaultPrivateSearchProvider(Profile& profile); // Initialize default provider for private profile. -void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile* profile); +void PrepareDefaultPrivateSearchProviderDataIfNeeded(Profile& profile); // Update TemplareURLData with provider guid. -void UpdateDefaultPrivateSearchProviderData(Profile* profile); -void ResetDefaultPrivateSearchProvider(Profile* profile); +void UpdateDefaultPrivateSearchProviderData(Profile& profile); +void ResetDefaultPrivateSearchProvider(Profile& profile); -void PrepareSearchSuggestionsConfig(PrefService* local_state, bool first_run); -void UpdateDefaultSearchSuggestionsPrefs(PrefService* local_state, - PrefService* profile_prefs); +void PrepareSearchSuggestionsConfig(PrefService& local_state, bool first_run); +void UpdateDefaultSearchSuggestionsPrefs(PrefService& local_state, + PrefService& profile_prefs); } // namespace brave diff --git a/browser/search_engines/search_engine_tracker_browsertest.cc b/browser/search_engines/search_engine_tracker_browsertest.cc index 30b2cd4c04df..46caa99e0050 100644 --- a/browser/search_engines/search_engine_tracker_browsertest.cc +++ b/browser/search_engines/search_engine_tracker_browsertest.cc @@ -72,7 +72,8 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, DefaultSearchEngineP3A) { // Check that changing the default engine triggers emitting of a new value. auto ddg_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - browser()->profile()->GetPrefs(), search_engine_choice_service, + *browser()->profile()->GetPrefs(), + search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO); TemplateURL ddg_url(*ddg_data); @@ -82,7 +83,8 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, DefaultSearchEngineP3A) { // Check switching back to original engine. auto brave_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - browser()->profile()->GetPrefs(), search_engine_choice_service, + *browser()->profile()->GetPrefs(), + search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE); TemplateURL brave_url(*brave_data); service->SetUserSelectedDefaultSearchProvider(&brave_url); @@ -117,7 +119,8 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, SwitchSearchEngineP3A) { // Check that changing the default engine triggers emission of a new value. auto ddg_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - browser()->profile()->GetPrefs(), search_engine_choice_service, + *browser()->profile()->GetPrefs(), + search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO); TemplateURL ddg_url(*ddg_data); @@ -128,7 +131,8 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, SwitchSearchEngineP3A) { // Check additional changes. auto brave_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - browser()->profile()->GetPrefs(), search_engine_choice_service, + *browser()->profile()->GetPrefs(), + search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE); TemplateURL brave_url(*brave_data); @@ -138,7 +142,8 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, SwitchSearchEngineP3A) { // Check additional changes. auto bing_data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - browser()->profile()->GetPrefs(), search_engine_choice_service, + *browser()->profile()->GetPrefs(), + search_engine_choice_service->GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BING); TemplateURL bing_url(*bing_data); diff --git a/browser/sources.gni b/browser/sources.gni index 18eba7999b7c..0f5f7d8082ac 100644 --- a/browser/sources.gni +++ b/browser/sources.gni @@ -294,9 +294,11 @@ if (!is_android) { "//brave/browser/ui/tabs:impl", "//brave/browser/ui/webui/brave_news_internals", "//brave/browser/user_education:features", + "//chrome/browser/regional_capabilities", "//components/feed:feature_list", "//components/feed/core/v2:feed_core_v2", "//components/feed/mojom:mojo_bindings", + "//components/regional_capabilities", ] } diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index 17b310c91679..e3f361193d3a 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -889,7 +889,6 @@ source_set("ui") { "//components/country_codes", "//components/favicon/content", "//components/favicon/core", - "//components/flags_ui", "//components/gcm_driver:gcm_buildflags", "//components/image_fetcher/core", "//components/infobars/content", @@ -906,6 +905,7 @@ source_set("ui") { "//components/tab_groups", "//components/update_client", "//components/user_prefs", + "//components/webui/flags", "//content/public/browser", "//content/public/common", "//mojo/public/cpp/bindings", diff --git a/browser/ui/android/strings/android_brave_strings.grd b/browser/ui/android/strings/android_brave_strings.grd index 7bc4b4210d69..ccabb78ff707 100644 --- a/browser/ui/android/strings/android_brave_strings.grd +++ b/browser/ui/android/strings/android_brave_strings.grd @@ -2,7 +2,7 @@ - + diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd index fe983ea861ff..68d0d6fb2c84 100644 --- a/browser/ui/android/strings/android_chrome_strings.grd +++ b/browser/ui/android/strings/android_chrome_strings.grd @@ -454,8 +454,8 @@ For more settings that use data to improve your Brave experience, go to - - Address bar + + Address bar <new>New</new> @@ -471,7 +471,7 @@ For more settings that use data to improve your Brave experience, go to - When your device is folded, you can choose an option or touch and hold the address bar to change the position. + When your device is folded, you can choose an option or touch and hold the address bar to change the position @@ -557,9 +557,6 @@ For more settings that use data to improve your Brave experience, go to Billing address - - Contacting your bank\u2026 - Cancel @@ -870,18 +867,9 @@ For more settings that use data to improve your Brave experience, go to Passwords may stop working soon on this device. To keep using your passwords, update Google Play services. - - We’re changing how passwords are saved on this device - - - Right now, passwords saved on this device cannot be used across Brave channels. After Brave 125, passwords saved on your device for Brave and %1$sBrave Dev will be merged and can be used in both apps. - Got it - - Other options - Brave Password Manager update @@ -894,23 +882,38 @@ For more settings that use data to improve your Brave experience, go to Brave Password Manager update closed - - Save the passwords on this device in your Brave sync chain by turning on sync + + Brave Password Manager stopped working + + + You don’t have passwords saved in Brave Password Manager. - - You’ll be asked to sign in to your Brave sync chain + + If you previously exported passwords, look for a CSV file on your device and import them to your preferred password manager. - - Export & delete passwords saved to this device + + Got it - - All passwords will be downloaded on your device and removed from %1$sBrave Dev + + To start saving and using passwords with Brave Password Manager, update Google Play services. - - Next + + Cancel - - Cancel + + Keep access to you passwords + + + To keep access to your passwords, export them now, update Google Play Services, and then import them back to Brave Password Manager. <link>See full instructions</link>. + + + The exported file may be accessible to others, including apps. Once you export, your passwords are deleted from Brave. + + + To keep access to your passwords, export them now and then import them to your preferred password manager. Brave Password Manager stopped working because Google Play services isn’t available. + + + Export passwords We changed how passwords are saved on this device @@ -1067,6 +1070,11 @@ For more settings that use data to improve your Brave experience, go to + + + Appearance + + Theme @@ -1794,6 +1802,14 @@ Your Brave account may have other forms of browsing history like searches and ac View sites + + Checking passwords on this device… + + + {NUM_PASSWORDS, plural, + =1 {1 compromised password on this device} + other {# compromised passwords on this device}} + Go to Password Manager @@ -1842,9 +1858,18 @@ Your Brave account may have other forms of browsing history like searches and ac Checked recently + + No compromised passwords on this device + + + If your passwords are compromised, we’ll let you know + No saved passwords + + No saved passwords on this device + No compromised passwords @@ -1883,6 +1908,9 @@ Your Brave account may have other forms of browsing history like searches and ac Can't check passwords + + Can’t check passwords on this device + Try again later @@ -1901,6 +1929,9 @@ Your Brave account may have other forms of browsing history like searches and ac Strengthen your passwords + + Strengthen your passwords on this device + {NUM_PASSWORDS, plural, =1 {Brave found a weak password that you could improve} @@ -2935,15 +2966,6 @@ To change this setting, BEGIN_LINKdelete the Brave da Manage open tabs - - %1$sWelcome to Facebook, tab - - - %1$sWelcome to Facebook, new or updated tab - - - Close %1$sBrave tab - Loading… @@ -4279,6 +4301,9 @@ To change this setting, BEGIN_LINKdelete the Brave da New Private tab + + Private Tab + Bookmarks @@ -4339,6 +4364,9 @@ To change this setting, BEGIN_LINKdelete the Brave da Settings + + Customize new tab page + Settings, Brave sync chain error @@ -4486,6 +4514,9 @@ To change this setting, BEGIN_LINKdelete the Brave da All Bookmarks + + Bookmark bar overflow button + @@ -4814,6 +4845,7 @@ To change this setting, BEGIN_LINKdelete the Brave da + Update available. More options @@ -4887,30 +4919,48 @@ To change this setting, BEGIN_LINKdelete the Brave da Previous + + Enter Private mode Leave Private mode - + %1$sCrater Lake National Park (U.S. National Park Service) and %2$d12 other tabs - - Unnamed group + + %1$sWiki tabs tab group - - Tab + + Shared %1$sWiki tabs tab group - - Selected Tab + + Shared %1$sWiki tabs tab group with new activity - - Private Tab + + %1$sWelcome to Facebook, Selected Tab - - Selected Private Tab + + %1$sWelcome to Facebook, Private Tab + + %1$sWelcome to Facebook, Selected Private Tab + + + + + %1$sWelcome to Facebook, Tab + + + %1$sWelcome to Facebook, New or Updated Tab + + + Close %1$sBrave tab + + + Refine: %1$sThe meaning of life @@ -6140,6 +6190,12 @@ To change this setting, BEGIN_LINKdelete the Brave da profile picture + + + phone number + + + username To continue, %1$sidp.com will share your %2$sname and email address with this site. @@ -6546,73 +6602,9 @@ To change this setting, BEGIN_LINKdelete the Brave da Passkey confirmation sheet closed - - - Summary - - - Share with summary sheet - - - Share with summary sheet opened - - - Share with summary sheet closed - - - Thumbs up submits feedback that you like this summary - - - Thumbs down submits feedback that you dislike this summary - - - Add summary - - - Something went wrong. Summary couldn\u2019t be completed - - - This is an experimental AI feature and won\u2019t always get it right. <link>Learn more</link> - - - Select an issue - - - Submit - - - Share with summary feedback sheet - - - Share with summary feedback sheet opened - - + Create summary - - Remove summary - - - Share with summary feedback sheet closed - - - The URL of the page you\u2019re providing feedback for will be sent to Brave, and may be reviewed by humans to improve this feature - - - Offensive or unsafe - - - Inaccurate - - - Repetitive - - - Missing information - - - Other - @@ -6671,9 +6663,6 @@ To change this setting, BEGIN_LINKdelete the Brave da Tab group details - - This link doesn’t work - @@ -6763,9 +6752,6 @@ To change this setting, BEGIN_LINKdelete the Brave da Tabs in group - - Contact the sender to ask for a new link - Join as %1$sJohn Doe @@ -6897,19 +6883,19 @@ To change this setting, BEGIN_LINKdelete the Brave da - - Make sure you trust this site with your data + + Do you trust this site with your data? - - %1$swww.cheapalcohol.com wants to use personal info from your digital wallet. Only continue if you trust this site. + + %1$swww.cheapalcohol.com wants to use personal info from your digital wallet. - + Cancel - + %1$swww.cheapalcohol.com wants to use personal info from your digital wallet. Only continue if you trust this site. Dangerous sites might trick you into revealing things like your legal name or ID number. - + Back to safety diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd index 326964f21edb..92f859fe8ccb 100644 --- a/browser/ui/android/strings/android_chrome_strings_override.grd +++ b/browser/ui/android/strings/android_chrome_strings_override.grd @@ -195,6 +195,9 @@ CHAR_LIMIT guidelines: New Private tab + + Private Tab + Close all Private tabs @@ -226,12 +229,13 @@ CHAR_LIMIT guidelines: Leave Private mode - - Private Tab + + %1$sWelcome to Facebook, Private Tab - - Selected Private Tab + + %1$sWelcome to Facebook, Selected Private Tab + Open a new tab in Private mode diff --git a/browser/ui/tabs/split_view_tab_strip_model_adapter.cc b/browser/ui/tabs/split_view_tab_strip_model_adapter.cc index edd2020bdf58..310bb7b87ba8 100644 --- a/browser/ui/tabs/split_view_tab_strip_model_adapter.cc +++ b/browser/ui/tabs/split_view_tab_strip_model_adapter.cc @@ -277,7 +277,9 @@ void SplitViewTabStripModelAdapter::TabPinnedStateChanged( } void SplitViewTabStripModelAdapter::TabGroupedStateChanged( - std::optional group, + TabStripModel* tab_strip_model, + std::optional old_group, + std::optional new_group, tabs::TabInterface* tab, int index) { if (!model_->ContainsIndex(index)) { @@ -297,18 +299,18 @@ void SplitViewTabStripModelAdapter::TabGroupedStateChanged( } base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, - base::BindOnce( - [](base::WeakPtr adapter, TabTile tile, - const tabs::TabHandle& source, - std::optional group) { - if (!adapter) { - return; - } - - adapter->SynchronizeGroupedState(tile, source, group); - }, - weak_ptr_factory_.GetWeakPtr(), *tile, changed_tab_handle, group)); + FROM_HERE, base::BindOnce( + [](base::WeakPtr adapter, + TabTile tile, const tabs::TabHandle& source, + std::optional group) { + if (!adapter) { + return; + } + + adapter->SynchronizeGroupedState(tile, source, group); + }, + weak_ptr_factory_.GetWeakPtr(), *tile, changed_tab_handle, + new_group)); } void SplitViewTabStripModelAdapter::OnTabRemoved( diff --git a/browser/ui/tabs/split_view_tab_strip_model_adapter.h b/browser/ui/tabs/split_view_tab_strip_model_adapter.h index 982d5aeae84a..14e55eb733b6 100644 --- a/browser/ui/tabs/split_view_tab_strip_model_adapter.h +++ b/browser/ui/tabs/split_view_tab_strip_model_adapter.h @@ -45,7 +45,9 @@ class SplitViewTabStripModelAdapter : public TabStripModelObserver { void TabPinnedStateChanged(TabStripModel* tab_strip_model, content::WebContents* contents, int index) override; - void TabGroupedStateChanged(std::optional group, + void TabGroupedStateChanged(TabStripModel* tab_strip_model, + std::optional old_group, + std::optional new_group, tabs::TabInterface* tab, int index) override; diff --git a/browser/ui/views/bookmarks/saved_tab_groups/brave_saved_tab_group_button.cc b/browser/ui/views/bookmarks/saved_tab_groups/brave_saved_tab_group_button.cc index 097abd501f52..e02b3d11d167 100644 --- a/browser/ui/views/bookmarks/saved_tab_groups/brave_saved_tab_group_button.cc +++ b/browser/ui/views/bookmarks/saved_tab_groups/brave_saved_tab_group_button.cc @@ -59,8 +59,8 @@ void BraveSavedTabGroupButton::UpdateButtonLayout() { // Use the tab group color for text in all cases (even when the browser is // not the active window). - SetEnabledTextColorIds(text_color); - SetTextColorId(STATE_DISABLED, text_color); + SetEnabledTextColors(text_color); + SetTextColor(STATE_DISABLED, text_color); SetBackground(views::CreateRoundedRectBackground( SkColorSetA(cp->GetColor(text_color), 0.15 * 255), kBorderRadius, diff --git a/browser/ui/views/brave_ads/notification_ad_control_buttons_view.cc b/browser/ui/views/brave_ads/notification_ad_control_buttons_view.cc index 2088aaa104ea..e61cbc207c59 100644 --- a/browser/ui/views/brave_ads/notification_ad_control_buttons_view.cc +++ b/browser/ui/views/brave_ads/notification_ad_control_buttons_view.cc @@ -88,7 +88,7 @@ void NotificationAdControlButtonsView::UpdateInfoButton() { should_use_dark_colors ? kBraveAdsDarkModeInfoButtonIcon : kBraveAdsLightModeInfoButtonIcon, kInfoButtonIconDipSize, SK_ColorTRANSPARENT); - info_button_->SetImage(image_skia); + info_button_->SetImage(ui::ImageModel::FromImageSkia(image_skia)); } void NotificationAdControlButtonsView::CreateCloseButton() { diff --git a/browser/ui/views/brave_ads/notification_ad_header_view.cc b/browser/ui/views/brave_ads/notification_ad_header_view.cc index c77f8a83525e..40145daaa1d7 100644 --- a/browser/ui/views/brave_ads/notification_ad_header_view.cc +++ b/browser/ui/views/brave_ads/notification_ad_header_view.cc @@ -56,9 +56,6 @@ NotificationAdHeaderView::~NotificationAdHeaderView() = default; void NotificationAdHeaderView::SetTitle(const std::u16string& text) { CHECK(title_label_); title_label_->SetText(text); - - NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true); - UpdateAccessibleName(); } @@ -139,7 +136,7 @@ void NotificationAdHeaderView::UpdateTitleLabel() { } void NotificationAdHeaderView::UpdateAccessibleName() { - GetViewAccessibility().SetName(title_label_->GetText()); + GetViewAccessibility().SetName(std::u16string(title_label_->GetText())); } BEGIN_METADATA(NotificationAdHeaderView) diff --git a/browser/ui/views/brave_ads/notification_ad_popup.cc b/browser/ui/views/brave_ads/notification_ad_popup.cc index 6395291d1fd4..834780ebf383 100644 --- a/browser/ui/views/brave_ads/notification_ad_popup.cc +++ b/browser/ui/views/brave_ads/notification_ad_popup.cc @@ -94,8 +94,6 @@ NotificationAdPopup::NotificationAdPopup( animation_(std::make_unique(this)) { CreatePopup(browser_native_window, browser_native_view); - NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true); - display::Screen* screen = display::Screen::GetScreen(); if (screen) { screen_observation_.Observe(screen); diff --git a/browser/ui/views/brave_ads/notification_ad_view.cc b/browser/ui/views/brave_ads/notification_ad_view.cc index d2e44efb97a5..3d588ecf72d0 100644 --- a/browser/ui/views/brave_ads/notification_ad_view.cc +++ b/browser/ui/views/brave_ads/notification_ad_view.cc @@ -71,8 +71,6 @@ void NotificationAdView::MaybeNotifyAccessibilityEvent() { } accessible_name_ = accessible_name; - - NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true); UpdateAccessibleName(); } diff --git a/browser/ui/views/brave_help_bubble/brave_help_bubble_delegate_view.cc b/browser/ui/views/brave_help_bubble/brave_help_bubble_delegate_view.cc index 5e678ff1e851..ea7bde3518e1 100644 --- a/browser/ui/views/brave_help_bubble/brave_help_bubble_delegate_view.cc +++ b/browser/ui/views/brave_help_bubble/brave_help_bubble_delegate_view.cc @@ -36,10 +36,9 @@ class BorderWithArrow : public views::BubbleBorder { public: enum BubbleArrowPart { kFill, kBorder }; - explicit BorderWithArrow(Arrow arrow, ui::ColorId color_id) - : views::BubbleBorder(arrow, - BubbleBorder::Shadow::STANDARD_SHADOW, - color_id) { + explicit BorderWithArrow(Arrow arrow, ui::ColorVariant color_id) + : views::BubbleBorder(arrow, BubbleBorder::Shadow::STANDARD_SHADOW) { + SetColor(color_id); set_visible_arrow(true); } @@ -88,7 +87,7 @@ class BorderWithArrow : public views::BubbleBorder { GetVisibleArrowPath(arrow(), arrow_bounds, BubbleArrowPart::kBorder), flags); - flags.setColor(color()); + flags.setColor(color().ConvertToSkColor(view.GetColorProvider())); flags.setStyle(cc::PaintFlags::kFill_Style); flags.setStrokeWidth(1.0); flags.setAntiAlias(true); @@ -151,7 +150,7 @@ BraveHelpBubbleDelegateView::BraveHelpBubbleDelegateView( SetButtons(static_cast(ui::mojom::DialogButton::kNone)); set_shadow(BubbleBorder::Shadow::STANDARD_SHADOW); set_corner_radius(10); - set_color(kBgColor); + set_background_color(kBgColor); SetLayoutManager(std::make_unique( views::BoxLayout::Orientation::kVertical)); @@ -180,8 +179,8 @@ BraveHelpBubbleDelegateView::CreateNonClientFrameView(views::Widget* widget) { CHECK(frame); std::unique_ptr border = - std::make_unique(arrow(), color()); - border->SetColor(color()); + std::make_unique(arrow(), background_color()); + border->SetColor(background_color()); if (GetParams().round_corners) { border->SetCornerRadius(GetCornerRadius()); diff --git a/browser/ui/views/brave_news/brave_news_bubble_view.cc b/browser/ui/views/brave_news/brave_news_bubble_view.cc index 0f069998645c..9e42e822e37e 100644 --- a/browser/ui/views/brave_news/brave_news_bubble_view.cc +++ b/browser/ui/views/brave_news/brave_news_bubble_view.cc @@ -167,7 +167,7 @@ void BraveNewsBubbleView::OnThemeChanged() { auto is_dark = dark_mode::GetActiveBraveDarkModeType() == dark_mode::BraveDarkModeType::BRAVE_DARK_MODE_TYPE_DARK; - set_color(is_dark ? kBackgroundColorDark : kBackgroundColorLight); + set_background_color(is_dark ? kBackgroundColorDark : kBackgroundColorLight); subtitle_label_->SetEnabledColor(is_dark ? kSubtitleColorDark : kSubtitleColorLight); } diff --git a/browser/ui/views/brave_tooltips/brave_tooltip_popup.cc b/browser/ui/views/brave_tooltips/brave_tooltip_popup.cc index b27f58106cc7..cf7aba5bde5e 100644 --- a/browser/ui/views/brave_tooltips/brave_tooltip_popup.cc +++ b/browser/ui/views/brave_tooltips/brave_tooltip_popup.cc @@ -69,8 +69,6 @@ BraveTooltipPopup::BraveTooltipPopup(std::unique_ptr tooltip) GetViewAccessibility().SetRoleDescription(l10n_util::GetStringUTF8( IDS_BRAVE_TOOLTIPS_BRAVE_TOOLTIP_ACCESSIBLE_NAME)); - NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true); - display::Screen* screen = display::Screen::GetScreen(); if (screen) { screen->AddObserver(this); diff --git a/browser/ui/views/brave_tooltips/brave_tooltip_view.cc b/browser/ui/views/brave_tooltips/brave_tooltip_view.cc index 9c06bb4ea7ea..25d93a719af9 100644 --- a/browser/ui/views/brave_tooltips/brave_tooltip_view.cc +++ b/browser/ui/views/brave_tooltips/brave_tooltip_view.cc @@ -220,8 +220,8 @@ views::View* BraveTooltipView::CreateHeaderView() { views::ImageView* BraveTooltipView::CreateIconView() { views::ImageView* view = new views::ImageView(); - view->SetImage( - gfx::CreateVectorIcon(kBraveTooltipsStopwatchIcon, kIconColor)); + view->SetImage(ui::ImageModel::FromImageSkia( + gfx::CreateVectorIcon(kBraveTooltipsStopwatchIcon, kIconColor))); return view; } diff --git a/browser/ui/views/brave_vpn/brave_vpn_fallback_dialog_view.cc b/browser/ui/views/brave_vpn/brave_vpn_fallback_dialog_view.cc index defa379b51a1..6e65bce9cffe 100644 --- a/browser/ui/views/brave_vpn/brave_vpn_fallback_dialog_view.cc +++ b/browser/ui/views/brave_vpn/brave_vpn_fallback_dialog_view.cc @@ -17,8 +17,8 @@ #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "components/constrained_window/constrained_window_views.h" -#include "components/flags_ui/pref_service_flags_storage.h" #include "components/grit/brave_components_strings.h" +#include "components/webui/flags/pref_service_flags_storage.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/mojom/dialog_button.mojom.h" diff --git a/browser/ui/views/frame/brave_browser_view.cc b/browser/ui/views/frame/brave_browser_view.cc index d432e9dc24f1..6b718cb006db 100644 --- a/browser/ui/views/frame/brave_browser_view.cc +++ b/browser/ui/views/frame/brave_browser_view.cc @@ -110,7 +110,7 @@ #endif #if BUILDFLAG(ENABLE_GLIC) -#include "chrome/browser/glic/border_view.h" +#include "chrome/browser/glic/glic_border_view.h" #endif namespace { 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 4eb6abba6f22..034e5f7a1587 100644 --- a/browser/ui/views/frame/vertical_tab_strip_region_view.cc +++ b/browser/ui/views/frame/vertical_tab_strip_region_view.cc @@ -240,8 +240,7 @@ class ShortcutBox : public views::View { const auto shortcut_font = shortcut_part->font_list(); shortcut_part->SetFontList(shortcut_font.DeriveWithSizeDelta( kFontSize - shortcut_font.GetFontSize())); - shortcut_part->SetEnabledColorId( - kColorBraveVerticalTabNTBShortcutTextColor); + shortcut_part->SetEnabledColor(kColorBraveVerticalTabNTBShortcutTextColor); shortcut_part->SetBorder(views::CreateThemedRoundedRectBorder( /*thickness*/ 1, /*radius*/ 4, kColorBraveVerticalTabSeparator)); @@ -312,7 +311,7 @@ class VerticalTabNewTabButton : public BraveNewTabButton { const auto text_font = text_->font_list(); text_->SetFontList( text_font.DeriveWithSizeDelta(kFontSize - text_font.GetFontSize())); - text_->SetEnabledColorId(kColorBraveVerticalTabNTBTextColor); + text_->SetEnabledColor(kColorBraveVerticalTabNTBTextColor); auto* spacer = AddChildView(std::make_unique()); spacer->SetProperty( diff --git a/browser/ui/views/infobars/custom_styled_label.cc b/browser/ui/views/infobars/custom_styled_label.cc index 58b468047966..7a4e5e78d0d1 100644 --- a/browser/ui/views/infobars/custom_styled_label.cc +++ b/browser/ui/views/infobars/custom_styled_label.cc @@ -38,11 +38,8 @@ std::unique_ptr CustomStyledLabel::CreateLabel( result->SetTooltipText(style_info.tooltip); if (!style_info.accessible_name.empty()) result->SetAccessibleName(style_info.accessible_name); - if (auto* colour = absl::get_if(&displayed_on_background_color_)) { - result->SetBackgroundColor(*colour); - } else if (auto* colour_id = - absl::get_if(&displayed_on_background_color_)) { - result->SetBackgroundColor(*colour_id); + if (displayed_on_background_color_.has_value()) { + result->SetBackgroundColor(*displayed_on_background_color_); } result->SetAutoColorReadabilityEnabled(auto_color_readability_enabled_); diff --git a/browser/ui/views/location_bar/brave_search_conversion/promotion_button_view.cc b/browser/ui/views/location_bar/brave_search_conversion/promotion_button_view.cc index b888313d7ebc..929b93063ae9 100644 --- a/browser/ui/views/location_bar/brave_search_conversion/promotion_button_view.cc +++ b/browser/ui/views/location_bar/brave_search_conversion/promotion_button_view.cc @@ -97,8 +97,8 @@ PromotionButtonView::PromotionButtonView() { PromotionButtonView::~PromotionButtonView() = default; void PromotionButtonView::UpdateTargetProviderImage(const gfx::Image& image) { - target_provider_image_->SetImage( - gfx::ResizedImage(image, {kIconSize, kIconSize}).AsImageSkia()); + target_provider_image_->SetImage(ui::ImageModel::FromImageSkia( + gfx::ResizedImage(image, {kIconSize, kIconSize}).AsImageSkia())); } void PromotionButtonView::AnimateExpand() { @@ -194,7 +194,7 @@ void PromotionButtonView::AddChildViews() { custom_font)); button_label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); button_label->SetVerticalAlignment(gfx::VerticalAlignment::ALIGN_MIDDLE); - button_label->SetEnabledColorId(kColorSearchConversionButtonText); + button_label->SetEnabledColor(kColorSearchConversionButtonText); button_label->SetBackgroundColor(SK_ColorTRANSPARENT); auto set_image = [](views::ImageButton* close_button, diff --git a/browser/ui/views/omnibox/brave_omnibox_view_views.cc b/browser/ui/views/omnibox/brave_omnibox_view_views.cc index 7494ff8d4bf3..b0580bf1c7d9 100644 --- a/browser/ui/views/omnibox/brave_omnibox_view_views.cc +++ b/browser/ui/views/omnibox/brave_omnibox_view_views.cc @@ -53,7 +53,7 @@ BraveOmniboxViewViews::~BraveOmniboxViewViews() = default; std::optional BraveOmniboxViewViews::GetURLToCopy() { GURL url; bool write_url = false; - std::u16string selected_text = GetSelectedText(); + auto selected_text = std::u16string(GetSelectedText()); model()->AdjustTextForCopy(GetSelectedRange().GetMin(), &selected_text, &url, &write_url); if (!write_url) { diff --git a/browser/ui/views/overlay/brave_video_overlay_window_views.cc b/browser/ui/views/overlay/brave_video_overlay_window_views.cc index 063b4db96324..de9de939d857 100644 --- a/browser/ui/views/overlay/brave_video_overlay_window_views.cc +++ b/browser/ui/views/overlay/brave_video_overlay_window_views.cc @@ -209,7 +209,7 @@ void BraveVideoOverlayWindowViews::SetUpViews() { timestamp_ = controls_container_view_->AddChildView(std::make_unique()); - timestamp_->SetEnabledColorId(kColorPipWindowForeground); + timestamp_->SetEnabledColor(kColorPipWindowForeground); timestamp_->SetSubpixelRenderingEnabled(false); timestamp_->SetAutoColorReadabilityEnabled(false); timestamp_->SetElideBehavior(gfx::NO_ELIDE); @@ -337,12 +337,12 @@ void BraveVideoOverlayWindowViews::UpdateControlIcons() { ui::ImageModel::FromVectorIcon(kLeoPictureInPictureReturnIcon, kColorPipWindowForeground, kTopControlIconSize)); - auto text = back_to_tab_label_button_->GetText(); // Calling this will clear accessible name as well. We should reset it and // tooltip text. back_to_tab_label_button_->SetText({}); - back_to_tab_label_button_->SetAccessibleName(text); + back_to_tab_label_button_->SetAccessibleName( + std::u16string(back_to_tab_label_button_->GetText())); back_to_tab_label_button_->SetTooltipText( back_to_tab_label_button_->GetAccessibleName()); } diff --git a/browser/ui/views/playlist/playlist_action_dialogs.cc b/browser/ui/views/playlist/playlist_action_dialogs.cc index 7d75fa5c5ba5..c5a72a8aeae2 100644 --- a/browser/ui/views/playlist/playlist_action_dialogs.cc +++ b/browser/ui/views/playlist/playlist_action_dialogs.cc @@ -262,7 +262,7 @@ class PlaylistLabelButton : public views::LabelButton { PlaylistLabelButton(views::Button::PressedCallback callback = {}, const std::u16string& text = std::u16string()) : LabelButton(std::move(callback), text) { - SetEnabledTextColorIds(kColorBravePlaylistTextInteractive); + SetEnabledTextColors(kColorBravePlaylistTextInteractive); const int size_diff = 13 - label()->font_list().GetFontSize(); label()->SetFontList(label()->font_list().Derive( size_diff, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::SEMIBOLD)); @@ -335,7 +335,7 @@ PlaylistNewPlaylistDialog::PlaylistNewPlaylistDialog( container_label->font_list().DeriveWithSizeDelta( container_label->font_list().GetFontSize() - container_label_font_size)); - container_label->SetEnabledColorId(container_label_color_id); + container_label->SetEnabledColor(container_label_color_id); return container; }; @@ -548,7 +548,7 @@ void PlaylistMoveDialog::EnterChoosePlaylistMode() { auto* description = contents_container_->AddChildView( std::make_unique(l10n_util::GetStringUTF16( IDS_PLAYLIST_MOVE_MEDIA_DIALOG_DESCRIPTION))); - description->SetEnabledColorId(kColorBravePlaylistMoveDialogDescription); + description->SetEnabledColor(kColorBravePlaylistMoveDialogDescription); description->SetPreferredSize(gfx::Size(kContentsWidth, 17)); description->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); @@ -613,7 +613,7 @@ void PlaylistMoveDialog::EnterCreatePlaylistMode() { auto* title = contents_container_->AddChildView( std::make_unique(l10n_util::GetStringUTF16( IDS_PLAYLIST_MOVE_MEDIA_DIALOG_PLAYLIST_NAME))); - title->SetEnabledColorId( + title->SetEnabledColor( kColorBravePlaylistMoveDialogCreatePlaylistAndMoveTitle); title->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); diff --git a/browser/ui/views/profiles/brave_profile_menu_view.cc b/browser/ui/views/profiles/brave_profile_menu_view.cc index 7c3a6aa20077..8775de4f33b2 100644 --- a/browser/ui/views/profiles/brave_profile_menu_view.cc +++ b/browser/ui/views/profiles/brave_profile_menu_view.cc @@ -85,8 +85,8 @@ void BraveProfileMenuView::BuildFeatureButtons() { } else { if (window_count > 1) { AddFeatureButton( - l10n_util::GetPluralStringFUTF16(IDS_PROFILES_CLOSE_X_WINDOWS_BUTTON, - window_count), + l10n_util::GetPluralStringFUTF16( + IDS_PROFILE_MENU_CLOSE_PROFILE_X_WINDOWS_BUTTON, window_count), base::BindRepeating(&ProfileMenuView::OnExitProfileButtonClicked, base::Unretained(this)), vector_icons::kCloseIcon); diff --git a/browser/ui/views/side_panel/brave_bookmarks_side_panel_view.cc b/browser/ui/views/side_panel/brave_bookmarks_side_panel_view.cc index 9d7b80ffcde1..8e849632b24c 100644 --- a/browser/ui/views/side_panel/brave_bookmarks_side_panel_view.cc +++ b/browser/ui/views/side_panel/brave_bookmarks_side_panel_view.cc @@ -66,7 +66,7 @@ class BookmarksSidePanelHeaderView : public views::View { auto* header_label = AddChildView(std::make_unique( l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TITLE))); header_label->SetFontList(gfx::FontList("Poppins, Semi-Bold 16px")); - header_label->SetEnabledColorId(kColorSidebarPanelHeaderTitle); + header_label->SetEnabledColor(kColorSidebarPanelHeaderTitle); header_label->SetAutoColorReadabilityEnabled(false); auto* spacer = AddChildView(std::make_unique()); spacer->SetProperty( diff --git a/browser/ui/views/side_panel/brave_read_later_side_panel_view.cc b/browser/ui/views/side_panel/brave_read_later_side_panel_view.cc index e56c4458653a..f44bb80c7eef 100644 --- a/browser/ui/views/side_panel/brave_read_later_side_panel_view.cc +++ b/browser/ui/views/side_panel/brave_read_later_side_panel_view.cc @@ -62,7 +62,7 @@ class ReadLaterSidePanelHeaderView : public views::View { AddChildView(std::make_unique(l10n_util::GetStringUTF16( IDS_SIDEBAR_READING_LIST_PANEL_HEADER_TITLE))); header_label->SetFontList(gfx::FontList("Poppins, Semi-Bold 16px")); - header_label->SetEnabledColorId(kColorSidebarPanelHeaderTitle); + header_label->SetEnabledColor(kColorSidebarPanelHeaderTitle); header_label->SetAutoColorReadabilityEnabled(false); AddChildView(std::make_unique()) diff --git a/browser/ui/views/side_panel/brave_side_panel.cc b/browser/ui/views/side_panel/brave_side_panel.cc index 06dc1006d75b..4628d9820558 100644 --- a/browser/ui/views/side_panel/brave_side_panel.cc +++ b/browser/ui/views/side_panel/brave_side_panel.cc @@ -19,8 +19,10 @@ #include "brave/components/sidebar/browser/constants.h" #include "brave/components/sidebar/browser/pref_names.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_window/public/browser_window_features.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/side_panel/side_panel_ui.h" #include "chrome/browser/ui/views/side_panel/side_panel_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/color/color_provider.h" @@ -90,6 +92,21 @@ void BraveSidePanel::UpdateWidthOnEntryChanged() { // Do nothing. } +bool SidePanel::ShouldRestrictMaxWidth() const { + // TODO(crbug.com/394339052): Only restricting width for only non-read + // anything content is a temporary solution and UX will investigate a better + // long term solution. + SidePanelUI* coordinator = + browser_view_->browser()->GetFeatures().side_panel_ui(); + if (!coordinator) { + return true; + } + std::optional side_panel_entry_id = + coordinator->GetCurrentEntryId(); + return !side_panel_entry_id.has_value() || + side_panel_entry_id.value() != SidePanelEntryId::kReadAnything; +} + void BraveSidePanel::SetHorizontalAlignment(HorizontalAlignment alignment) { horizontal_alignment_ = alignment; UpdateBorder(); diff --git a/browser/ui/views/side_panel/brave_side_panel.h b/browser/ui/views/side_panel/brave_side_panel.h index 27f64e0cfaa0..12f3d8efa2b8 100644 --- a/browser/ui/views/side_panel/brave_side_panel.h +++ b/browser/ui/views/side_panel/brave_side_panel.h @@ -51,6 +51,7 @@ class BraveSidePanel : public views::View, void SetPanelWidth(int width); void UpdateWidthOnEntryChanged(); + bool ShouldRestrictMaxWidth() const; double GetAnimationValue() const; void SetHorizontalAlignment(HorizontalAlignment alignment); HorizontalAlignment GetHorizontalAlignment(); diff --git a/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc b/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc index 46a80ce699b0..5f6019f9db9b 100644 --- a/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc +++ b/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc @@ -134,7 +134,8 @@ SidebarAddItemBubbleDelegateView::SidebarAddItemBubbleDelegateView( if (const ui::ColorProvider* color_provider = BrowserView::GetBrowserViewForBrowser(browser_)->GetColorProvider()) { - set_color(color_provider->GetColor(kColorSidebarAddBubbleBackground)); + set_background_color( + color_provider->GetColor(kColorSidebarAddBubbleBackground)); } AddChildViews(); } diff --git a/browser/ui/views/sidebar/sidebar_edit_item_bubble_delegate_view.cc b/browser/ui/views/sidebar/sidebar_edit_item_bubble_delegate_view.cc index 7ff6ac2493b7..099229e03079 100644 --- a/browser/ui/views/sidebar/sidebar_edit_item_bubble_delegate_view.cc +++ b/browser/ui/views/sidebar/sidebar_edit_item_bubble_delegate_view.cc @@ -152,7 +152,7 @@ void SidebarEditItemBubbleDelegateView::ContentsChanged( } void SidebarEditItemBubbleDelegateView::UpdateItem() { - std::u16string new_title = title_tf_->GetText(); + auto new_title = title_tf_->GetText(); if (new_title.empty()) new_title = url_tf_->GetText(); diff --git a/browser/ui/views/sidebar/sidebar_item_added_feedback_bubble.cc b/browser/ui/views/sidebar/sidebar_item_added_feedback_bubble.cc index 3dc34f33f68b..5d978619d314 100644 --- a/browser/ui/views/sidebar/sidebar_item_added_feedback_bubble.cc +++ b/browser/ui/views/sidebar/sidebar_item_added_feedback_bubble.cc @@ -58,7 +58,7 @@ SidebarItemAddedFeedbackBubble::SidebarItemAddedFeedbackBubble( animation_(base::Milliseconds(kFadeoutDurationInMs), 60, this) { // This bubble uses same color for all themes. constexpr SkColor kBubbleBackground = SkColorSetRGB(0x33, 0x9A, 0xF0); - set_color(kBubbleBackground); + set_background_color(kBubbleBackground); set_margins(gfx::Insets()); set_title_margins(gfx::Insets()); SetButtons(static_cast(ui::mojom::DialogButton::kNone)); @@ -115,8 +115,8 @@ void SidebarItemAddedFeedbackBubble::AddChildViews() { views::BoxLayout::Orientation::kHorizontal, gfx::Insets(), kChildSpacing)); auto* image = first_row->AddChildView(std::make_unique()); - image->SetImage( - gfx::CreateVectorIcon(kSidebarItemAddedCheckIcon, SK_ColorWHITE)); + image->SetImage(ui::ImageModel::FromImageSkia( + gfx::CreateVectorIcon(kSidebarItemAddedCheckIcon, SK_ColorWHITE))); // Use 12pt and 600 weight. auto* label = first_row->AddChildView(std::make_unique( brave_l10n::GetLocalizedResourceUTF16String( diff --git a/browser/ui/views/speedreader/reader_mode_bubble.cc b/browser/ui/views/speedreader/reader_mode_bubble.cc index 8012d622bf96..4c0fd8890142 100644 --- a/browser/ui/views/speedreader/reader_mode_bubble.cc +++ b/browser/ui/views/speedreader/reader_mode_bubble.cc @@ -180,7 +180,7 @@ void ReaderModeBubble::Init() { label->SetFontList(font); label->SetMultiLine(true); label->SetLineHeight(kNotesLineHeight); - label->SetEnabledColorId(ui::kColorSecondaryForeground); + label->SetEnabledColor(ui::kColorSecondaryForeground); layout->SetFlexForView(box->AddChildView(std::move(label)), 1); } } diff --git a/browser/ui/views/split_view/split_view_location_bar.cc b/browser/ui/views/split_view/split_view_location_bar.cc index 571d1ac8dce5..c84caee8c21a 100644 --- a/browser/ui/views/split_view/split_view_location_bar.cc +++ b/browser/ui/views/split_view/split_view_location_bar.cc @@ -71,14 +71,14 @@ SplitViewLocationBar::SplitViewLocationBar(PrefService* prefs, views::Builder() .SetText(u"https") .CopyAddressTo(&https_with_strike_) - .SetEnabledColorId(kColorOmniboxSecurityChipDangerous)) + .SetEnabledColor(kColorOmniboxSecurityChipDangerous)) .AddChild(views::Builder() .SetText(u"://") .CopyAddressTo(&scheme_separator_) - .SetEnabledColorId(kColorBraveSplitViewUrl)) + .SetEnabledColor(kColorBraveSplitViewUrl)) .AddChild(views::Builder() .CopyAddressTo(&url_) - .SetEnabledColorId(kColorBraveSplitViewUrl))) + .SetEnabledColor(kColorBraveSplitViewUrl))) .BuildChildren(); for (auto url_part : {https_with_strike_, scheme_separator_, url_}) { diff --git a/browser/ui/views/tabs/brave_tab_container.cc b/browser/ui/views/tabs/brave_tab_container.cc index d81bf5045c97..f94fac0cb811 100644 --- a/browser/ui/views/tabs/brave_tab_container.cc +++ b/browser/ui/views/tabs/brave_tab_container.cc @@ -550,7 +550,8 @@ BraveTabContainer::DropArrow::DropArrow(const BrowserRootView::DropIndex& index, arrow_window_->Init(std::move(params)); arrow_view_ = arrow_window_->SetContentsView(std::make_unique()); - arrow_view_->SetImage(GetDropArrowImage(position_, beneath_)); + arrow_view_->SetImage( + ui::ImageModel::FromImageSkia(*GetDropArrowImage(position_, beneath_))); scoped_observation_.Observe(arrow_window_.get()); arrow_window_->Show(); @@ -569,7 +570,8 @@ void BraveTabContainer::DropArrow::SetBeneath(bool beneath) { } beneath_ = beneath; - arrow_view_->SetImage(GetDropArrowImage(position_, beneath)); + arrow_view_->SetImage( + ui::ImageModel::FromImageSkia(*GetDropArrowImage(position_, beneath))); } void BraveTabContainer::DropArrow::SetWindowBounds(const gfx::Rect& bounds) { diff --git a/browser/ui/views/tabs/brave_tab_group_header.cc b/browser/ui/views/tabs/brave_tab_group_header.cc index 70d00fb09017..5cb9af5ddcb0 100644 --- a/browser/ui/views/tabs/brave_tab_group_header.cc +++ b/browser/ui/views/tabs/brave_tab_group_header.cc @@ -78,7 +78,7 @@ void BraveTabGroupHeader::VisualsChanged() { // vertical layout to maintain the group header height. if (!title_->GetText().empty()) { const gfx::Insets title_chip_insets = - group_style_->GetInsetsForHeaderChip(ShouldShowHeaderIcon()); + group_style_->GetInsetsForHeaderChip(); title_chip_->SetSize( {title_chip_->width(), title_->height() + 2 * title_chip_insets.top()}); title_->SetY(title_chip_insets.top()); diff --git a/browser/ui/views/tabs/dragging/tab_drag_controller.cc b/browser/ui/views/tabs/dragging/tab_drag_controller.cc index 375909bc9354..2f96db23c973 100644 --- a/browser/ui/views/tabs/dragging/tab_drag_controller.cc +++ b/browser/ui/views/tabs/dragging/tab_drag_controller.cc @@ -262,66 +262,6 @@ void TabDragController::DetachAndAttachToNewContext( } } -gfx::Rect TabDragController::CalculateNonMaximizedDraggedBrowserBounds( - views::Widget* widget, - const gfx::Point& point_in_screen) { - // This method is called when dragging all tabs and moving window. - auto bounds = - TabDragControllerChromium::CalculateNonMaximizedDraggedBrowserBounds( - widget, point_in_screen); -#if BUILDFLAG(IS_MAC) - // According to what's been observed, this only needed on Mac. Per platform, - // window management mechanism is different so this could happen. - if (is_showing_vertical_tabs_) { - bounds.Offset(GetVerticalTabStripWidgetOffset()); - } -#endif - - if (is_showing_vertical_tabs_) { - bounds.set_size(widget->GetTopLevelWidget()->GetRestoredBounds().size()); - } - - return bounds; -} - -gfx::Rect TabDragController::CalculateDraggedBrowserBounds( - TabDragContext* source, - const gfx::Point& point_in_screen, - std::vector* drag_bounds) { - // This method is called when creating new browser by detaching tabs and - // when dragging all tabs in maximized window. - auto bounds = TabDragControllerChromium::CalculateDraggedBrowserBounds( - source, point_in_screen, drag_bounds); - if (is_showing_vertical_tabs_) { - // Revert back coordinate adjustment done by Chromium impl. - bounds.set_origin(point_in_screen); - - // Adjust coordinate so that dragged tabs are under cursor. - DCHECK(!drag_bounds->empty()); - bounds.Offset(-(mouse_offset_.OffsetFromOrigin())); - bounds.Offset({-drag_bounds->front().x(), 0}); - bounds.Offset({-GetXCoordinateAdjustmentForMultiSelectedTabs( - attached_views_, source_view_index_), - 0}); - - auto* browser_view = static_cast( - BrowserView::GetBrowserViewForNativeWindow( - GetAttachedBrowserWidget()->GetNativeWindow())); - DCHECK(browser_view); - - auto* widget_delegate_view = - browser_view->vertical_tab_strip_widget_delegate_view(); - DCHECK(widget_delegate_view); - - bounds.Offset(GetVerticalTabStripWidgetOffset()); - bounds.Offset(-widget_delegate_view->vertical_tab_strip_region_view() - ->GetOffsetForDraggedTab()); - bounds.set_size(browser_view->GetRestoredBounds().size()); - } - - return bounds; -} - [[nodiscard]] TabDragController::Liveness TabDragController::ContinueDragging( const gfx::Point& point_in_screen) { auto* browser_widget = GetAttachedBrowserWidget(); diff --git a/browser/ui/views/tabs/dragging/tab_drag_controller.h b/browser/ui/views/tabs/dragging/tab_drag_controller.h index dbf07761244d..b18418dc98f3 100644 --- a/browser/ui/views/tabs/dragging/tab_drag_controller.h +++ b/browser/ui/views/tabs/dragging/tab_drag_controller.h @@ -42,13 +42,6 @@ class TabDragController : public TabDragControllerChromium { void DetachAndAttachToNewContext(ReleaseCapture release_capture, TabDragContext* target_context) override; - gfx::Rect CalculateNonMaximizedDraggedBrowserBounds( - views::Widget* widget, - const gfx::Point& point_in_screen) override; - gfx::Rect CalculateDraggedBrowserBounds( - TabDragContext* source, - const gfx::Point& point_in_screen, - std::vector* drag_bounds) override; [[nodiscard]] Liveness ContinueDragging( const gfx::Point& point_in_screen) override; diff --git a/browser/ui/views/tabs/shared_pinned_tab_dummy_view_views.cc b/browser/ui/views/tabs/shared_pinned_tab_dummy_view_views.cc index ace6a86e911e..8ad8d8ea8f5b 100644 --- a/browser/ui/views/tabs/shared_pinned_tab_dummy_view_views.cc +++ b/browser/ui/views/tabs/shared_pinned_tab_dummy_view_views.cc @@ -88,7 +88,7 @@ SharedPinnedTabDummyViewViews::SharedPinnedTabDummyViewViews( .DeriveWithSizeDelta(kTitleFontSize - gfx::FontList().GetFontSize()) .DeriveWithWeight(gfx::Font::Weight::SEMIBOLD)) - .SetEnabledColorId(kColorBraveSharedPinnedTabDummyViewTitle) + .SetEnabledColor(kColorBraveSharedPinnedTabDummyViewTitle) .SetProperty(views::kMarginsKey, gfx::Insets().set_top(40))) .AddChild( views::Builder() @@ -97,7 +97,7 @@ SharedPinnedTabDummyViewViews::SharedPinnedTabDummyViewViews( IDS_SHARED_PINNED_TABS_DUMMY_TAB_VIEW_DESCRIPTION)) .SetFontList(gfx::FontList().DeriveWithSizeDelta( kDescriptionFontSize - gfx::FontList().GetFontSize())) - .SetEnabledColorId(kColorBraveSharedPinnedTabDummyViewDescription) + .SetEnabledColor(kColorBraveSharedPinnedTabDummyViewDescription) .SetProperty(views::kMarginsKey, gfx::Insets().set_top(8))) .BuildChildren(); diff --git a/browser/ui/views/toolbar/brave_toolbar_view.cc b/browser/ui/views/toolbar/brave_toolbar_view.cc index 9d5b187ce1c0..af7dc9bc998f 100644 --- a/browser/ui/views/toolbar/brave_toolbar_view.cc +++ b/browser/ui/views/toolbar/brave_toolbar_view.cc @@ -28,7 +28,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/defaults.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/layout_constants.h" @@ -421,12 +420,8 @@ void BraveToolbarView::ShowBookmarkBubble(const GURL& url, anchor_view = bookmark_; } - std::unique_ptr delegate; - delegate = - std::make_unique(browser()->profile()); BookmarkBubbleView::ShowBubble(anchor_view, GetWebContents(), bookmark_, - std::move(delegate), browser_, url, - already_bookmarked); + browser_, url, already_bookmarked); } void BraveToolbarView::ViewHierarchyChanged( diff --git a/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc index 7a0084ca402f..fd64e683690f 100644 --- a/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc +++ b/browser/ui/webui/searchbox/brave_realbox_handler_browsertest.cc @@ -19,7 +19,6 @@ #include "components/omnibox/browser/omnibox_client.h" #include "components/omnibox/browser/omnibox_controller.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/spoof_checks/idna_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/browser_test.h" diff --git a/browser/ui/webui/settings/brave_default_extensions_handler.cc b/browser/ui/webui/settings/brave_default_extensions_handler.cc index ddf8c64ea1f1..7bb7793b3ae0 100644 --- a/browser/ui/webui/settings/brave_default_extensions_handler.cc +++ b/browser/ui/webui/settings/brave_default_extensions_handler.cc @@ -36,10 +36,10 @@ #include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "components/flags_ui/flags_ui_constants.h" -#include "components/flags_ui/pref_service_flags_storage.h" #include "components/grit/brave_components_strings.h" #include "components/prefs/pref_service.h" +#include "components/webui/flags/flags_ui_constants.h" +#include "components/webui/flags/pref_service_flags_storage.h" #include "content/public/browser/web_ui.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" diff --git a/browser/ui/webui/settings/brave_search_engines_handler.cc b/browser/ui/webui/settings/brave_search_engines_handler.cc index 9cc6aed43701..ba975c7ae846 100644 --- a/browser/ui/webui/settings/brave_search_engines_handler.cc +++ b/browser/ui/webui/settings/brave_search_engines_handler.cc @@ -48,7 +48,7 @@ void BraveSearchEnginesHandler::RegisterMessages() { void BraveSearchEnginesHandler::OnModelChanged() { SearchEnginesHandler::OnModelChanged(); - brave::UpdateDefaultPrivateSearchProviderData(profile_); + brave::UpdateDefaultPrivateSearchProviderData(*profile_); // Sync normal profile's search provider list with private profile // for using same list on both. diff --git a/build/android/bytecode/bytecode_rewriter.gni b/build/android/bytecode/bytecode_rewriter.gni index 07fb46db65a0..b90f2e1d8ffe 100644 --- a/build/android/bytecode/bytecode_rewriter.gni +++ b/build/android/bytecode/bytecode_rewriter.gni @@ -22,6 +22,7 @@ brave_bytecode_jars = [ "obj/chrome/android/base_module_java.javac.jar", "obj/chrome/android/chrome_java.javac.jar", "obj/chrome/android/features/tab_ui/java.javac.jar", + "obj/chrome/browser/bookmarks/android/java.javac.jar", "obj/chrome/browser/download/internal/android/java.javac.jar", "obj/chrome/browser/flags/java.javac.jar", "obj/chrome/browser/hub/internal/java.javac.jar", diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkUtilsClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkUtilsClassAdapter.java index f7fd93ad04bf..e61ca660729f 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkUtilsClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkUtilsClassAdapter.java @@ -18,11 +18,6 @@ public BraveBookmarkUtilsClassAdapter(ClassVisitor visitor) { changeMethodOwner( sBookmarkUtilsClassName, "addOrEditBookmark", sBraveBookmarkUtilsClassName); - changeMethodOwner( - sBookmarkUtilsClassName, - "showBookmarkManagerOnPhone", - sBraveBookmarkUtilsClassName); - changeMethodOwner(sBookmarkUtilsClassName, "isSpecialFolder", sBraveBookmarkUtilsClassName); } } diff --git a/chromium_src/chrome/browser/browser_features.cc b/chromium_src/chrome/browser/browser_features.cc index e6dfd7130f26..5ad99dd0cfc5 100644 --- a/chromium_src/chrome/browser/browser_features.cc +++ b/chromium_src/chrome/browser/browser_features.cc @@ -21,7 +21,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ #if !BUILDFLAG(IS_ANDROID) {kReportPakFileIntegrity, base::FEATURE_DISABLED_BY_DEFAULT}, #endif // BUILDFLAG(IS_ANDROID) - {kSupportSearchSuggestionForPrerender2, base::FEATURE_DISABLED_BY_DEFAULT}, }}); } // namespace features diff --git a/chromium_src/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc b/chromium_src/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc new file mode 100644 index 000000000000..42affe048966 --- /dev/null +++ b/chromium_src/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc @@ -0,0 +1,15 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "chrome/browser/contextual_cueing/contextual_cueing_service_factory.h" + +#include "chrome/browser/profiles/profile_selections.h" + +// ContextualCuelingService is used by Glic and uses +// PageContentExtractionService both of which we disable, so don't create this +// service. +#define kOriginalOnly kNone +#include "src/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc" +#undef kOriginalOnly diff --git a/chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc similarity index 73% rename from chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator.cc rename to chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc index b1fcf52ff417..15ee4475d1de 100644 --- a/chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator.cc +++ b/chromium_src/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc @@ -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 "extensions/common/manifest_handlers/incognito_info.h" #define BRAVE_CREATE_EXTENSION_INFO_HELPER \ - info->is_split_mode = IncognitoInfo::IsSplitMode(&extension); -#include "src/chrome/browser/extensions/api/developer_private/extension_info_generator.cc" + info.is_split_mode = IncognitoInfo::IsSplitMode(&extension); +#include "src/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc" #undef BRAVE_CREATE_EXTENSION_INFO_HELPER diff --git a/chromium_src/chrome/browser/extensions/extension_system_impl.cc b/chromium_src/chrome/browser/extensions/chrome_extension_system.cc similarity index 78% rename from chromium_src/chrome/browser/extensions/extension_system_impl.cc rename to chromium_src/chrome/browser/extensions/chrome_extension_system.cc index 74e39a0ded09..592929c5da57 100644 --- a/chromium_src/chrome/browser/extensions/extension_system_impl.cc +++ b/chromium_src/chrome/browser/extensions/chrome_extension_system.cc @@ -1,12 +1,12 @@ /* 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 "brave/browser/extensions/brave_extension_service.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/update_install_gate.h" #define ExtensionService BraveExtensionService -#include "src/chrome/browser/extensions/extension_system_impl.cc" +#include "src/chrome/browser/extensions/chrome_extension_system.cc" #undef ExtensionService diff --git a/chromium_src/chrome/browser/extensions/extension_service.cc b/chromium_src/chrome/browser/extensions/extension_service.cc index b3462b34987d..51691f1568aa 100644 --- a/chromium_src/chrome/browser/extensions/extension_service.cc +++ b/chromium_src/chrome/browser/extensions/extension_service.cc @@ -3,9 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "chrome/browser/extensions/extension_service.h" + #include "brave/browser/extensions/brave_component_loader.h" +#include "chrome/browser/extensions/chrome_extension_registrar_delegate.h" #include "chrome/browser/extensions/component_loader.h" -#include "chrome/browser/extensions/extension_service.h" #define ComponentLoader BraveComponentLoader #include "src/chrome/browser/extensions/extension_service.cc" diff --git a/chromium_src/chrome/browser/resources/bookmarks/folder_node.css b/chromium_src/chrome/browser/resources/bookmarks/folder_node.css new file mode 100644 index 000000000000..876e4e52beca --- /dev/null +++ b/chromium_src/chrome/browser/resources/bookmarks/folder_node.css @@ -0,0 +1,49 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #import=./folder_node-chromium.css.js + * #scheme=relative + * #include=folder-node-chromium + * #css_wrapper_metadata_end */ + +.cr-nav-menu-item { + border-end-end-radius: 0px !important; + border-start-end-radius: 0px !important; + box-sizing: content-box !important; +} + +.cr-nav-menu-item:hover { + background: transparent !important; +} + +.cr-nav-menu-item[selected] { + --iron-icon-fill-color: var(--cr-link-color) !important; + color: var(--cr-link-color) !important; + background: transparent !important; +} + +.cr-nav-menu-item.drag-on { + color: var(--cr-link-color) !important; +} + +@media (prefers-color-scheme: dark) { + + .cr-nav-menu-item[selected] #arrow, + .cr-nav-menu-item.drag-on #arrow { + --cr-icon-button-fill-color: var(--cr-link-color) !important; + } + + .cr-nav-menu-item.drag-on { + --iron-icon-fill-color: var(--cr-link-color) !important; + background: transparent !important; + color: var(--cr-link-color) !important; + } +} + +.cr-nav-menu-item cr-ripple { + display: none !important; +} diff --git a/chromium_src/chrome/browser/resources/bookmarks/folder_node.ts b/chromium_src/chrome/browser/resources/bookmarks/folder_node.ts deleted file mode 100644 index 09ba63f5df3d..000000000000 --- a/chromium_src/chrome/browser/resources/bookmarks/folder_node.ts +++ /dev/null @@ -1,53 +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/. - -import {RegisterStyleOverride} from 'chrome://resources/brave/polymer_overriding.js' -import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js' - -RegisterStyleOverride( - 'bookmarks-folder-node', - html` - - ` -) - -export * from './folder_node-chromium.js' diff --git a/chromium_src/chrome/browser/ui/bookmarks/bookmark_utils.cc b/chromium_src/chrome/browser/ui/bookmarks/bookmark_utils.cc index 91a5e7454b23..38ed10215778 100644 --- a/chromium_src/chrome/browser/ui/bookmarks/bookmark_utils.cc +++ b/chromium_src/chrome/browser/ui/bookmarks/bookmark_utils.cc @@ -71,7 +71,7 @@ bool ShouldShowAppsShortcutInBookmarkBar(Profile* profile) { #if defined(TOOLKIT_VIEWS) ui::ImageModel GetBookmarkFolderIcon(BookmarkFolderIconType icon_type, - absl::variant color) { + ui::ColorVariant color) { int default_id = #if BUILDFLAG(IS_WIN) IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_WIN_LIGHT; @@ -82,16 +82,10 @@ ui::ImageModel GetBookmarkFolderIcon(BookmarkFolderIconType icon_type, #endif const auto generator = [](int default_id, BookmarkFolderIconType icon_type, - absl::variant color, + ui::ColorVariant color, const ui::ColorProvider* color_provider) { gfx::ImageSkia folder; - SkColor sk_color; - if (absl::holds_alternative(color)) { - sk_color = absl::get(color); - } else { - DCHECK(color_provider); - sk_color = color_provider->GetColor(absl::get(color)); - } + SkColor sk_color = color.ConvertToSkColor(color_provider); const int resource_id = color_utils::IsDark(sk_color) #if BUILDFLAG(IS_WIN) diff --git a/chromium_src/chrome/browser/ui/ui_features.cc b/chromium_src/chrome/browser/ui/ui_features.cc index 395861ac1065..22a409360063 100644 --- a/chromium_src/chrome/browser/ui/ui_features.cc +++ b/chromium_src/chrome/browser/ui/ui_features.cc @@ -17,6 +17,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) {kFewerUpdateConfirmations, base::FEATURE_DISABLED_BY_DEFAULT}, #endif + {kSideBySide, base::FEATURE_DISABLED_BY_DEFAULT}, {kTabHoverCardImages, base::FEATURE_DISABLED_BY_DEFAULT}, }}); diff --git a/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc index 99f4757e6a6d..45a1b3c1e96d 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc +++ b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc @@ -15,12 +15,6 @@ #define TabDragController TabDragControllerChromium -// Wraps function calls so that they can work with a child NativeWindow as well. -#define non_client_view() \ - non_client_view() \ - ? source->GetWidget()->non_client_view()->frame_view() \ - : source->GetWidget()->GetTopLevelWidget()->non_client_view() - // Remove drag threshold when it's vertical tab strip #define GetHorizontalDragThreshold() \ GetHorizontalDragThreshold() - \ @@ -33,7 +27,6 @@ #include "src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc" -#undef non_client_view #undef GetHorizontalDragThreshold #undef GetBrowserViewForNativeWindow #undef TabDragController diff --git a/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h index a746b0c0117a..b1415bdcec43 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h +++ b/chromium_src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h @@ -31,16 +31,11 @@ using TabDragControllerBrave = TabDragController; virtual views::Widget* GetAttachedBrowserWidget #define GetLocalProcessWindow virtual GetLocalProcessWindow #define DetachAndAttachToNewContext virtual DetachAndAttachToNewContext -#define CalculateNonMaximizedDraggedBrowserBounds \ - virtual CalculateNonMaximizedDraggedBrowserBounds -#define CalculateDraggedBrowserBounds virtual CalculateDraggedBrowserBounds #define ContinueDragging virtual ContinueDragging #include "src/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h" // IWYU pragma: export #undef ContinueDragging -#undef CalculateDraggedBrowserBounds -#undef CalculateNonMaximizedDraggedBrowserBounds #undef DetachAndAttachToNewContext #undef GetLocalProcessWindow #undef GetAttachedBrowserWidget diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.cc b/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.cc index 81010a747e4e..584e856566c6 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.cc +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.cc @@ -61,10 +61,8 @@ SkPath TabGroupStyle::GetUnderlinePath(gfx::Rect local_bounds) const { return path; } -gfx::Insets TabGroupStyle::GetInsetsForHeaderChip( - bool should_show_sync_icon) const { - auto insets = - TabGroupStyle_ChromiumImpl::GetInsetsForHeaderChip(should_show_sync_icon); +gfx::Insets TabGroupStyle::GetInsetsForHeaderChip() const { + auto insets = TabGroupStyle_ChromiumImpl::GetInsetsForHeaderChip(); if (!tabs::features::HorizontalTabsUpdateEnabled()) { return insets; } diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.h b/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.h index 36f522d6cb8e..9b64d1e1e82e 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.h +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_group_style.h @@ -24,7 +24,7 @@ class TabGroupStyle : public TabGroupStyle_ChromiumImpl { SkPath GetUnderlinePath(gfx::Rect local_bounds) const override; - gfx::Insets GetInsetsForHeaderChip(bool should_show_sync_icon) const override; + gfx::Insets GetInsetsForHeaderChip() const override; gfx::Point GetTitleChipOffset(std::optional text_height) const override; diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index 1553caecc755..74764458eab8 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc @@ -29,7 +29,7 @@ void TabHoverCardBubbleView_ChromiumImpl::BraveUpdateCardContent( TabHoverCardBubbleView_ChromiumImpl::UpdateCardContent(tab); // Replace chrome:// with brave://. Since this is purely in the UI we can // just do a sub-string replacement instead of parsing into GURL. - std::u16string domain = domain_label_->GetText(); + auto domain = std::u16string(domain_label_->GetText()); if (brave_utils::ReplaceChromeToBraveScheme(domain)) { domain_label_->SetData({domain, /*is_filename*/ false}); } diff --git a/chromium_src/chrome/browser/ui/views/toolbar/app_menu.cc b/chromium_src/chrome/browser/ui/views/toolbar/app_menu.cc index 6f388cd6ce0c..0e4f9666d6ab 100644 --- a/chromium_src/chrome/browser/ui/views/toolbar/app_menu.cc +++ b/chromium_src/chrome/browser/ui/views/toolbar/app_menu.cc @@ -9,9 +9,6 @@ #include "chrome/browser/ui/views/frame/app_menu_button.h" -// Upstream uses wrong api for setting color. It comes from -// https://chromium-review.googlesource.com/c/chromium/src/+/4395705 -#define SetTextColor SetTextColorId #define SetMenuItemBackground(...) \ SetMenuItemBackground(MenuItemView::MenuItemBackground( \ background_color_id, kBackgroundCornerRadius - 6)) @@ -20,7 +17,6 @@ #include "src/chrome/browser/ui/views/toolbar/app_menu.cc" #undef set_vertical_margin #undef SetMenuItemBackground -#undef SetTextColor std::unique_ptr AppMenu::CreateInMenuButtonBackgroundWithLeadingBorder() { diff --git a/chromium_src/chrome/browser/ui/views/web_apps/web_app_views_utils.cc b/chromium_src/chrome/browser/ui/views/web_apps/web_app_views_utils.cc index b95c52e1d1b2..3072aa31e69b 100644 --- a/chromium_src/chrome/browser/ui/views/web_apps/web_app_views_utils.cc +++ b/chromium_src/chrome/browser/ui/views/web_apps/web_app_views_utils.cc @@ -18,7 +18,7 @@ std::unique_ptr CreateOriginLabelFromStartUrl( std::unique_ptr origin_label = CreateOriginLabelFromStartUrl_ChromiumImpl(start_url, is_primary_text); CHECK(origin_label); - std::u16string label_text = origin_label->GetText(); + auto label_text = std::u16string(origin_label->GetText()); brave_utils::ReplaceChromeToBraveScheme(label_text); origin_label->SetText(label_text); diff --git a/chromium_src/chrome/common/url_constants.h b/chromium_src/chrome/common/url_constants.h index 615a2e31c63f..ced91c67fa71 100644 --- a/chromium_src/chrome/common/url_constants.h +++ b/chromium_src/chrome/common/url_constants.h @@ -332,10 +332,20 @@ inline constexpr char16_t kPaymentMethodsURLForGPayWeb[] = inline constexpr char kAddressesAndPaymentMethodsLearnMoreURL[] = "https://support.brave.com"; +// The URL for the "Pay over time" support page. +// TODO(crbug.com/395027230): Change URL once official support page is +// finalized. +inline constexpr char16_t kPayOverTimeLearnMoreUrl[] = + u"https://support.brave.com"; + // Help URL for Autofill Prediction Improvements. inline constexpr char16_t kAutofillAiLearnMoreURL[] = u"https://support.brave.com"; +// "Learn more" URL for the autofill show card benefits setting. +inline constexpr char16_t kCardBenefitsLearnMoreURL[] = + u"https://support.brave.com"; + // "Learn more" URL for the performance intervention notification setting. inline constexpr char16_t kPerformanceInterventionLearnMoreUrl[] = u"https://support.brave.com"; diff --git a/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc b/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc index 71479cedbeea..2655fc5348d9 100644 --- a/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc +++ b/chromium_src/components/autofill/core/browser/payments/offer_notification_handler.cc @@ -5,7 +5,7 @@ #include "components/autofill/core/browser/payments/offer_notification_handler.h" -#include "components/autofill/core/browser/data_model/autofill_offer_data.h" +#include "components/autofill/core/browser/data_model/payments/autofill_offer_data.h" #include "components/autofill/core/browser/payments/autofill_offer_manager.h" namespace autofill { diff --git a/chromium_src/components/content_settings/core/common/cookie_settings_base.cc b/chromium_src/components/content_settings/core/common/cookie_settings_base.cc index 7e4c1993dceb..1ce9c89c7179 100644 --- a/chromium_src/components/content_settings/core/common/cookie_settings_base.cc +++ b/chromium_src/components/content_settings/core/common/cookie_settings_base.cc @@ -243,11 +243,14 @@ bool CookieSettingsBase::ShouldBlockThirdPartyIfSettingIsExplicit( #define BRAVE_COOKIE_SETTINGS_BASE_DECIDE_ACCESS \ const bool block_third = \ IsAllowed(setting) && !is_explicit_setting && is_third_party_request && \ - ShouldBlockThirdPartyCookies() && \ + ShouldBlockThirdPartyCookies(url::Origin::Create(first_party_url), \ + overrides) && \ !IsThirdPartyCookiesAllowedScheme(first_party_url.scheme()); \ if (!block_third && is_third_party_request && \ ShouldBlockThirdPartyIfSettingIsExplicit( \ - ShouldBlockThirdPartyCookies(), setting, is_explicit_setting, \ + ShouldBlockThirdPartyCookies(url::Origin::Create(first_party_url), \ + overrides), \ + setting, is_explicit_setting, \ IsThirdPartyCookiesAllowedScheme(first_party_url.scheme()))) { \ return AllowPartitionedCookies{}; \ } diff --git a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc index 70d5d4b6789a..3f787012bb46 100644 --- a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc +++ b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc @@ -19,6 +19,7 @@ #include "components/regional_capabilities/regional_capabilities_test_utils.h" #include "components/search_engines/search_engine_choice/search_engine_choice_service.h" #include "components/search_engines/search_engines_pref_names.h" +#include "components/search_engines/search_engines_test_environment.h" #include "components/search_engines/search_terms_data.h" #include "components/search_engines/template_url.h" #include "components/search_engines/template_url_data_util.h" @@ -38,29 +39,20 @@ std::string GetHostFromTemplateURLData(const TemplateURLData& data) { using namespace TemplateURLPrepopulateData; // NOLINT -const PrepopulatedEngine* const kBraveAddedEngines[] = { - &startpage, -}; +const PrepopulatedEngine* const kBraveAddedEngines[] = {}; const std::unordered_set kOverriddenEnginesNames = { u"DuckDuckGo", u"Qwant"}; + } // namespace class BraveTemplateURLPrepopulateDataTest : public testing::Test { public: - BraveTemplateURLPrepopulateDataTest() - : regional_capabilities_service_( - regional_capabilities::CreateServiceWithFakeClient(prefs_)), - search_engine_choice_service_( - prefs_, - &local_state_, - *regional_capabilities_service_, - /*is_profile_eligible_for_dse_guest_propagation=*/false) {} + BraveTemplateURLPrepopulateDataTest() = default; void SetUp() override { - TemplateURLPrepopulateData::RegisterProfilePrefs(prefs_.registry()); // Real registration happens in `brave/browser/brave_profile_prefs.cc` // Calling brave::RegisterProfilePrefs() causes some problems though - auto* registry = prefs_.registry(); + auto* registry = search_engines_test_environment_.pref_service().registry(); registry->RegisterIntegerPref( prefs::kBraveDefaultSearchVersion, TemplateURLPrepopulateData::kBraveCurrentDataVersion); @@ -69,18 +61,22 @@ class BraveTemplateURLPrepopulateDataTest : public testing::Test { TemplateURLPrepopulateData::GetAllPrepopulatedEngines(); brave_prepopulated_engines_.insert(brave_prepopulated_engines_.end(), engines.begin(), engines.end()); - brave_prepopulated_engines_.insert(brave_prepopulated_engines_.end(), - std::begin(kBraveAddedEngines), - std::end(kBraveAddedEngines)); + for (auto* engine : kBraveAddedEngines) { + brave_prepopulated_engines_.push_back(engine); + } } void CheckForCountry(char digit1, char digit2, int prepopulate_id) { - prefs_.SetInteger(kCountryIDAtInstall, digit1 << 8 | digit2); - prefs_.SetInteger(prefs::kBraveDefaultSearchVersion, - TemplateURLPrepopulateData::kBraveCurrentDataVersion); + search_engines_test_environment_.pref_service().SetInteger( + kCountryIDAtInstall, digit1 << 8 | digit2); + search_engines_test_environment_.pref_service().SetInteger( + prefs::kBraveDefaultSearchVersion, + TemplateURLPrepopulateData::kBraveCurrentDataVersion); std::unique_ptr fallback_t_url_data = TemplateURLPrepopulateData::GetPrepopulatedFallbackSearch( - &prefs_, &search_engine_choice_service_); + search_engines_test_environment_.pref_service(), + search_engines_test_environment_.search_engine_choice_service() + .GetCountryId()); EXPECT_EQ(fallback_t_url_data->prepopulate_id, prepopulate_id); } @@ -90,11 +86,7 @@ class BraveTemplateURLPrepopulateDataTest : public testing::Test { } protected: - sync_preferences::TestingPrefServiceSyncable prefs_; - TestingPrefServiceSimple local_state_; - std::unique_ptr - regional_capabilities_service_; - search_engines::SearchEngineChoiceService search_engine_choice_service_; + search_engines::SearchEnginesTestEnvironment search_engines_test_environment_; std::vector brave_prepopulated_engines_; }; @@ -131,9 +123,12 @@ TEST_F(BraveTemplateURLPrepopulateDataTest, UniqueIDs) { 'U' << 8 | 'S', -1}; for (int country_id : kCountryIds) { - prefs_.SetInteger(kCountryIDAtInstall, country_id); - std::vector> urls = - GetPrepopulatedEngines(&prefs_, &search_engine_choice_service_); + search_engines_test_environment_.pref_service().SetInteger( + kCountryIDAtInstall, country_id); + std::vector> urls = GetPrepopulatedEngines( + search_engines_test_environment_.pref_service(), + search_engines_test_environment_.search_engine_choice_service() + .GetCountryId()); std::set unique_ids; for (auto& url : urls) { ASSERT_TRUE(unique_ids.find(url->prepopulate_id) == unique_ids.end()); @@ -146,7 +141,9 @@ TEST_F(BraveTemplateURLPrepopulateDataTest, UniqueIDs) { TEST_F(BraveTemplateURLPrepopulateDataTest, ProvidersFromPrepopulated) { std::vector> t_urls = TemplateURLPrepopulateData::GetPrepopulatedEngines( - &prefs_, &search_engine_choice_service_); + search_engines_test_environment_.pref_service(), + search_engines_test_environment_.search_engine_choice_service() + .GetCountryId()); // Ensure all the URLs have the required fields populated. ASSERT_FALSE(t_urls.empty()); diff --git a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc index dcfcbbd6fe7d..31a0b3847131 100644 --- a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc +++ b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc @@ -14,6 +14,7 @@ #include "components/regional_capabilities/regional_capabilities_test_utils.h" #include "components/search_engines/search_engine_choice/search_engine_choice_service.h" #include "components/search_engines/search_engines_pref_names.h" +#include "components/search_engines/search_engines_test_environment.h" #include "components/search_engines/search_terms_data.h" #include "components/search_engines/template_url.h" #include "components/search_engines/template_url_prepopulate_data.h" @@ -46,24 +47,10 @@ std::unique_ptr CreatePrepopulateTemplateURLData( class BraveTemplateURLServiceUtilTest : public testing::Test { public: - BraveTemplateURLServiceUtilTest() - : regional_capabilities_service_( - regional_capabilities::CreateServiceWithFakeClient(prefs_)), - search_engine_choice_service_( - prefs_, - &local_state_, - *regional_capabilities_service_, - /*is_profile_eligible_for_dse_guest_propagation=*/false) {} - void SetUp() override { - TemplateURLPrepopulateData::RegisterProfilePrefs(prefs_.registry()); - } + BraveTemplateURLServiceUtilTest() = default; protected: - sync_preferences::TestingPrefServiceSyncable prefs_; - TestingPrefServiceSimple local_state_; - std::unique_ptr - regional_capabilities_service_; - search_engines::SearchEngineChoiceService search_engine_choice_service_; + search_engines::SearchEnginesTestEnvironment search_engines_test_environment_; }; void TestDefaultOrder(const TemplateURL::OwnedTemplateURLVector& template_urls, @@ -98,8 +85,9 @@ WDKeywordsResult InitKeywordResult( sync_preferences::TestingPrefServiceSyncable* prefs, const std::vector& local_turls) { WDKeywordsResult kwResult; - kwResult.metadata.builtin_keyword_data_version = - TemplateURLPrepopulateData::GetDataVersion(prefs); + // Set builtin metadata version to 0 so that the prepopulated engines are + // merged into the results (see ComputeMergeEnginesRequirements). + kwResult.metadata.builtin_keyword_data_version = 0; kwResult.keywords = local_turls; return kwResult; } @@ -114,22 +102,27 @@ TEST_F(BraveTemplateURLServiceUtilTest, GetSearchProvidersUsingKeywordResult) { local_turls.push_back(*CreatePrepopulateTemplateURLData(1004, "random2", 8)); // Prepare call arguments - WDResult result(KEYWORDS_RESULT, - InitKeywordResult(&prefs_, local_turls)); + WDResult result( + KEYWORDS_RESULT, + InitKeywordResult(&search_engines_test_environment_.pref_service(), + local_turls)); TemplateURL::OwnedTemplateURLVector template_urls; WDKeywordsResult::Metadata updated_keywords_metadata; - prefs_.SetInteger(kCountryIDAtInstall, 'U' << 8 | 'S'); GetSearchProvidersUsingKeywordResult( - result.GetValue(), nullptr, &prefs_, &search_engine_choice_service_, + result.GetValue(), nullptr, + &search_engines_test_environment_.pref_service(), + &search_engines_test_environment_.search_engine_choice_service(), + search_engines_test_environment_.prepopulate_data_resolver(), &template_urls, default_turl.get(), SearchTermsData(), updated_keywords_metadata, nullptr); // Verify count and order. + // Default prepopulated engines order is :br, :g, :d, :q, :b, :sp TestDefaultOrder(template_urls, - {":g", ":d", ":q", ":b", ":sp", ":ya", "random1", "random2", - "@bookmarks", "@history", "@tabs", "@gemini"}); + {":br", ":g", ":d", ":q", ":b", ":sp", ":ya", "random1", + "random2", "@bookmarks", "@history", "@tabs", "@gemini"}); } TEST_F(BraveTemplateURLServiceUtilTest, @@ -143,19 +136,26 @@ TEST_F(BraveTemplateURLServiceUtilTest, TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE; // Prepare call arguments - WDResult result(KEYWORDS_RESULT, - InitKeywordResult(&prefs_, local_turls)); + WDResult result( + KEYWORDS_RESULT, + InitKeywordResult(&search_engines_test_environment_.pref_service(), + local_turls)); TemplateURL::OwnedTemplateURLVector template_urls; WDKeywordsResult::Metadata updated_keywords_metadata; // Check Germany. - prefs_.SetInteger(kCountryIDAtInstall, 'D' << 8 | 'E'); + search_engines_test_environment_.pref_service().SetInteger( + kCountryIDAtInstall, 'D' << 8 | 'E'); GetSearchProvidersUsingKeywordResult( - result.GetValue(), nullptr, &prefs_, &search_engine_choice_service_, + result.GetValue(), nullptr, + &search_engines_test_environment_.pref_service(), + &search_engines_test_environment_.search_engine_choice_service(), + search_engines_test_environment_.prepopulate_data_resolver(), &template_urls, default_turl.get(), SearchTermsData(), updated_keywords_metadata, nullptr); // Verify count and order. + // Prepopulated engines order for DE is :br, :d, :q, :g, :sp, :e TestDefaultOrder(template_urls, {":br", ":d", ":q", ":g", ":b", ":sp", ":e", ":ya", "@bookmarks", "@history", "@tabs", "@gemini"}); 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 a3f9887af808..776fa01bea88 100644 --- a/chromium_src/components/search_engines/template_url_prepopulate_data.cc +++ b/chromium_src/components/search_engines/template_url_prepopulate_data.cc @@ -29,8 +29,8 @@ namespace TemplateURLPrepopulateData { // `GetPrepopulatedEngines` where there's an expectation for the use of the // default value of the last arguent. std::vector> GetPrepopulatedEngines_Unused( - PrefService* prefs, - search_engines::SearchEngineChoiceService* search_engine_choice_service); + PrefService& prefs, + CountryID country_id); } // namespace TemplateURLPrepopulateData @@ -720,8 +720,8 @@ int GetDataVersion(PrefService* prefs) { // Redefines function with the same name in Chromium. Modifies the function to // get search engines defined by Brave. std::vector> GetPrepopulatedEngines( - PrefService* prefs, - search_engines::SearchEngineChoiceService* search_engine_choice_service) { + PrefService& prefs, + CountryID country_id) { // If there is a set of search engines in the preferences file, it overrides // the built-in set. std::vector> t_urls = @@ -731,15 +731,11 @@ std::vector> GetPrepopulatedEngines( } int version = kBraveCurrentDataVersion; - if (prefs && prefs->HasPrefPath(prefs::kBraveDefaultSearchVersion)) { - version = prefs->GetInteger(prefs::kBraveDefaultSearchVersion); + if (prefs.HasPrefPath(prefs::kBraveDefaultSearchVersion)) { + version = prefs.GetInteger(prefs::kBraveDefaultSearchVersion); } - return GetBravePrepopulatedEnginesForCountryID( - search_engine_choice_service - ? search_engine_choice_service->GetCountryId() - : country_codes::GetCountryIDFromPrefs(prefs), - version); + return GetBravePrepopulatedEnginesForCountryID(country_id, version); } // Redefines function with the same name in Chromium. Modifies the function to @@ -761,24 +757,20 @@ std::vector> GetLocalPrepopulatedEngines( // Chromium picks Google (if on the list, otherwise the first prepopulated on // the list). We should return the default engine by country, or Brave. std::unique_ptr GetPrepopulatedFallbackSearch( - PrefService* prefs, - search_engines::SearchEngineChoiceService* search_engine_choice_service) { + PrefService& prefs, + CountryID country_id) { std::vector> prepopulated_engines = - GetPrepopulatedEngines(prefs, search_engine_choice_service); + GetPrepopulatedEngines(prefs, country_id); if (prepopulated_engines.empty()) { return nullptr; } // Get the default engine (overridable by country) for this version int version = kBraveCurrentDataVersion; - if (prefs && prefs->HasPrefPath(prefs::kBraveDefaultSearchVersion)) { - version = prefs->GetInteger(prefs::kBraveDefaultSearchVersion); + if (prefs.HasPrefPath(prefs::kBraveDefaultSearchVersion)) { + version = prefs.GetInteger(prefs::kBraveDefaultSearchVersion); } - int country_id = search_engine_choice_service - ? search_engine_choice_service->GetCountryId() - : country_codes::GetCountryIDFromPrefs(prefs); - BravePrepopulatedEngineID default_id = GetDefaultSearchEngine(country_id, version); @@ -801,12 +793,11 @@ std::unique_ptr GetPrepopulatedFallbackSearch( return std::move(prepopulated_engines[0]); } -std::unique_ptr GetPrepopulatedEngine( - PrefService* prefs, - search_engines::SearchEngineChoiceService* search_engine_choice_service, - int prepopulated_id) { - auto engines = TemplateURLPrepopulateData::GetPrepopulatedEngines( - prefs, search_engine_choice_service); +std::unique_ptr GetPrepopulatedEngine(PrefService& prefs, + CountryID country_id, + int prepopulated_id) { + auto engines = + TemplateURLPrepopulateData::GetPrepopulatedEngines(prefs, country_id); for (auto& engine : engines) { if (engine->prepopulate_id == prepopulated_id) { return std::move(engine); diff --git a/chromium_src/components/search_engines/util.cc b/chromium_src/components/search_engines/util.cc index 3100487d0c71..da2e916cdbb7 100644 --- a/chromium_src/components/search_engines/util.cc +++ b/chromium_src/components/search_engines/util.cc @@ -5,6 +5,7 @@ #include +#include "base/check_deref.h" #include "base/containers/adapters.h" #define GetSearchProvidersUsingKeywordResult \ @@ -13,10 +14,11 @@ #undef GetSearchProvidersUsingKeywordResult void GetSearchProvidersUsingKeywordResult( - const WDKeywordsResult& result, + const WDKeywordsResult& keyword_result, KeywordWebDataService* service, PrefService* prefs, search_engines::SearchEngineChoiceService* search_engine_choice_service, + const TemplateURLPrepopulateData::Resolver& template_url_data_resolver, TemplateURLService::OwnedTemplateURLVector* template_urls, TemplateURL* default_search_provider, const SearchTermsData& search_terms_data, @@ -24,14 +26,13 @@ void GetSearchProvidersUsingKeywordResult( std::set* removed_keyword_guids) { // Call the original implementation to get template_urls. GetSearchProvidersUsingKeywordResult_ChromiumImpl( - result, service, prefs, search_engine_choice_service, template_urls, - default_search_provider, search_terms_data, out_updated_keywords_metadata, - removed_keyword_guids); - // Resort template_urls in the orider of prepopulated search engines. + keyword_result, service, prefs, search_engine_choice_service, + template_url_data_resolver, template_urls, default_search_provider, + search_terms_data, out_updated_keywords_metadata, removed_keyword_guids); + // Resort template_urls in the order of prepopulated search engines. if (template_urls && !template_urls->empty()) { std::vector> prepopulated_urls = - TemplateURLPrepopulateData::GetPrepopulatedEngines( - prefs, search_engine_choice_service); + template_url_data_resolver.GetPrepopulatedEngines(); for (const auto& template_url_data : base::Reversed(prepopulated_urls)) { auto it = std::ranges::find_if( *template_urls, diff --git a/chromium_src/components/signin/public/base/signin_switches.cc b/chromium_src/components/signin/public/base/signin_switches.cc index bce8557132c8..e9ea8b722ea2 100644 --- a/chromium_src/components/signin/public/base/signin_switches.cc +++ b/chromium_src/components/signin/public/base/signin_switches.cc @@ -7,6 +7,14 @@ #include "base/feature_override.h" +namespace switches { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kSyncEnableBookmarksInTransportMode, base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace switches + OVERRIDE_FEATURE_DEFAULT_STATES({{ #if BUILDFLAG(ENABLE_MIRROR) && !BUILDFLAG(IS_IOS) {kVerifyRequestInitiatorForMirrorHeaders, diff --git a/chromium_src/components/sync/base/data_type_unittest.cc b/chromium_src/components/sync/base/data_type_unittest.cc index de0e4944245b..0178a00c1f08 100644 --- a/chromium_src/components/sync/base/data_type_unittest.cc +++ b/chromium_src/components/sync/base/data_type_unittest.cc @@ -21,7 +21,7 @@ TEST(DataTypeTest, LowPriorityUserTypes) { // This test is supposed to fail when sync types are increased/decreased TEST(DataTypeTest, DataTypeCounts) { - EXPECT_EQ(static_cast(DataTypeForHistograms::kMaxValue), 68); + EXPECT_EQ(static_cast(DataTypeForHistograms::kMaxValue), 69); } } // namespace diff --git a/chromium_src/components/sync/base/features.cc b/chromium_src/components/sync/base/features.cc index 1c4b76dc69b2..f93ce5396382 100644 --- a/chromium_src/components/sync/base/features.cc +++ b/chromium_src/components/sync/base/features.cc @@ -10,7 +10,7 @@ namespace syncer { OVERRIDE_FEATURE_DEFAULT_STATES({{ - {kSyncEnableBookmarksInTransportMode, base::FEATURE_DISABLED_BY_DEFAULT}, + {kSyncAutofillLoyaltyCard, base::FEATURE_DISABLED_BY_DEFAULT}, }}); } // namespace syncer diff --git a/chromium_src/components/sync/service/sync_service_impl.h b/chromium_src/components/sync/service/sync_service_impl.h index a2119c7e01ba..82ab64873d20 100644 --- a/chromium_src/components/sync/service/sync_service_impl.h +++ b/chromium_src/components/sync/service/sync_service_impl.h @@ -8,6 +8,7 @@ #include "base/gtest_prod_util.h" #include "components/signin/public/identity_manager/identity_manager.h" +#include "components/sync/engine/sync_engine_host.h" #define BRAVE_SYNC_SERVICE_IMPL_H_ \ private: \ diff --git a/chromium_src/components/flags_ui/BUILD.gn b/chromium_src/components/webui/flags/BUILD.gn similarity index 87% rename from chromium_src/components/flags_ui/BUILD.gn rename to chromium_src/components/webui/flags/BUILD.gn index 72d8ceac5cca..ac9b79498e3c 100644 --- a/chromium_src/components/flags_ui/BUILD.gn +++ b/chromium_src/components/webui/flags/BUILD.gn @@ -10,11 +10,11 @@ source_set("unit_tests") { deps = [ "//base", "//base/test:test_support", - "//components/flags_ui", - "//components/flags_ui:switches", "//components/prefs:test_support", "//components/strings", "//components/variations", + "//components/webui/flags", + "//components/webui/flags:switches", "//testing/gtest", ] } diff --git a/chromium_src/components/flags_ui/flags_state.cc b/chromium_src/components/webui/flags/flags_state.cc similarity index 96% rename from chromium_src/components/flags_ui/flags_state.cc rename to chromium_src/components/webui/flags/flags_state.cc index f994ef3f0a0a..53630ffd2c31 100644 --- a/chromium_src/components/flags_ui/flags_state.cc +++ b/chromium_src/components/webui/flags/flags_state.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "components/flags_ui/flags_state.h" +#include "components/webui/flags/flags_state.h" #include #include #include "base/strings/strcat.h" -#include "src/components/flags_ui/flags_state.cc" +#include "src/components/webui/flags/flags_state.cc" namespace flags_ui { namespace { diff --git a/chromium_src/components/flags_ui/flags_state.h b/chromium_src/components/webui/flags/flags_state.h similarity index 63% rename from chromium_src/components/flags_ui/flags_state.h rename to chromium_src/components/webui/flags/flags_state.h index 042991150dae..836af90b32d9 100644 --- a/chromium_src/components/flags_ui/flags_state.h +++ b/chromium_src/components/webui/flags/flags_state.h @@ -1,10 +1,10 @@ /* 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/. */ -#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ -#define BRAVE_CHROMIUM_SRC_COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ +#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_WEBUI_FLAGS_FLAGS_STATE_H_ +#define BRAVE_CHROMIUM_SRC_COMPONENTS_WEBUI_FLAGS_FLAGS_STATE_H_ #define GetFlagFeatureEntries(...) \ GetFlagFeatureEntries(__VA_ARGS__); \ @@ -12,8 +12,8 @@ const FeatureEntry& entry, const std::set& enabled_entries) \ const -#include "src/components/flags_ui/flags_state.h" // IWYU pragma: export +#include "src/components/webui/flags/flags_state.h" // IWYU pragma: export #undef GetFlagFeatureEntries -#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ +#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_WEBUI_FLAGS_FLAGS_STATE_H_ diff --git a/chromium_src/components/flags_ui/flags_state_unittest.cc b/chromium_src/components/webui/flags/flags_state_unittest.cc similarity index 97% rename from chromium_src/components/flags_ui/flags_state_unittest.cc rename to chromium_src/components/webui/flags/flags_state_unittest.cc index 0ea90cdacc96..04a9b5d8b867 100644 --- a/chromium_src/components/flags_ui/flags_state_unittest.cc +++ b/chromium_src/components/webui/flags/flags_state_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "src/components/flags_ui/flags_state_unittest.cc" +#include "src/components/webui/flags/flags_state_unittest.cc" #include #include diff --git a/chromium_src/ios/web_view/internal/cwv_global_state.mm b/chromium_src/ios/web_view/internal/cwv_global_state.mm new file mode 100644 index 000000000000..59e1b412c9a1 --- /dev/null +++ b/chromium_src/ios/web_view/internal/cwv_global_state.mm @@ -0,0 +1,54 @@ +// Copyright (c) 2025 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +// We completely replace the CWVGlobalState because we already provide global +// initialization with -[BraveCoreMain init]. + +@implementation CWVGlobalState { + NSString* _customUserAgent; + NSString* _userAgentProduct; +} + ++ (instancetype)sharedInstance { + static CWVGlobalState* globalState = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + globalState = [[CWVGlobalState alloc] init]; + }); + return globalState; +} + +- (NSString*)customUserAgent { + return _customUserAgent; +} + +- (void)setCustomUserAgent:(NSString*)customUserAgent { + _customUserAgent = [customUserAgent copy]; +} + +- (NSString*)userAgentProduct { + return _userAgentProduct; +} + +- (void)setUserAgentProduct:(NSString*)userAgentProduct { + _userAgentProduct = [userAgentProduct copy]; +} + +- (void)setGoogleAPIKey:(NSString*)googleAPIKey + clientID:(NSString*)clientID + clientSecret:(NSString*)clientSecret { +} + +- (BOOL)isStarted { + return YES; +} + +- (void)start { +} + +- (void)stop { +} + +@end diff --git a/chromium_src/ios/web_view/internal/cwv_web_view_configuration.mm b/chromium_src/ios/web_view/internal/cwv_web_view_configuration.mm index d79a08b34a70..2e1e2a530301 100644 --- a/chromium_src/ios/web_view/internal/cwv_web_view_configuration.mm +++ b/chromium_src/ios/web_view/internal/cwv_web_view_configuration.mm @@ -21,7 +21,6 @@ #import "ios/web_view/internal/cwv_web_view_configuration_internal.h" #import "ios/web_view/internal/cwv_web_view_internal.h" #import "ios/web_view/internal/passwords/web_view_account_password_store_factory.h" -#import "ios/web_view/internal/web_view_global_state_util.h" // We completely replace the CWVWebViewConfiguration implementation so that // we can nop certain services such as access to CWVWebView specific wrappers diff --git a/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc b/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc index c114bac70151..75ee0b097dbe 100644 --- a/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc +++ b/chromium_src/net/tools/transport_security_state_generator/input_file_parsers.cc @@ -552,9 +552,9 @@ bool ParseCertificatesFile(std::string_view certs_input, Pinsets* pinsets, base::Time* timestamp) { constexpr std::string_view brave_certs = R"brave_certs( -# Last updated: Wed Feb 26 14:59:55 2025 +# Last updated: Mon Mar 03 11:23:49 2025 PinsListTimestamp -1740581995 +1741001029 # =====BEGIN BRAVE ROOTS ASC===== #From https://www.amazontrust.com/repository/ diff --git a/chromium_src/services/network/public/cpp/features.cc b/chromium_src/services/network/public/cpp/features.cc new file mode 100644 index 000000000000..8fa7c2ff60ba --- /dev/null +++ b/chromium_src/services/network/public/cpp/features.cc @@ -0,0 +1,18 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "src/services/network/public/cpp/features.cc" + +#include "base/feature_override.h" + +namespace network::features { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kBrowsingTopics, base::FEATURE_DISABLED_BY_DEFAULT}, + {kInterestGroupStorage, base::FEATURE_DISABLED_BY_DEFAULT}, + {kSharedStorageAPI, base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace network::features diff --git a/chromium_src/storage/browser/blob/blob_url_store_impl.cc b/chromium_src/storage/browser/blob/blob_url_store_impl.cc index d3f0ff8ddeaa..b2eae8d4eeac 100644 --- a/chromium_src/storage/browser/blob/blob_url_store_impl.cc +++ b/chromium_src/storage/browser/blob/blob_url_store_impl.cc @@ -49,7 +49,8 @@ bool BlobURLStoreImpl::IsBlobResolvable(const GURL& url) const { ? BlobUrlUtils::ClearUrlFragment(url) : url; constexpr std::string_view kChromeExtensionScheme = "chrome-extension"; - return (registry_ && registry_->IsUrlMapped(clean_url, storage_key_)) || + return (registry_ && registry_->IsUrlMapped(clean_url, storage_key_) == + BlobUrlRegistry::MappingStatus::kIsMapped) || (url.SchemeIsBlob() && (url::Origin::Create(url).scheme() == kChromeExtensionScheme || storage_key_.origin().scheme() == kChromeExtensionScheme)); diff --git a/chromium_src/third_party/blink/common/features.cc b/chromium_src/third_party/blink/common/features.cc index c7312a2a74de..2a5cecc3ceeb 100644 --- a/chromium_src/third_party/blink/common/features.cc +++ b/chromium_src/third_party/blink/common/features.cc @@ -21,8 +21,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kAttributionReportingInBrowserMigration, base::FEATURE_DISABLED_BY_DEFAULT}, {kBackgroundResourceFetch, base::FEATURE_DISABLED_BY_DEFAULT}, - {kBiddingAndScoringDebugReportingAPI, base::FEATURE_DISABLED_BY_DEFAULT}, - {kBrowsingTopics, base::FEATURE_DISABLED_BY_DEFAULT}, {kControlledFrame, base::FEATURE_DISABLED_BY_DEFAULT}, {kCssSelectorFragmentAnchor, base::FEATURE_DISABLED_BY_DEFAULT}, {kFencedFrames, base::FEATURE_DISABLED_BY_DEFAULT}, @@ -30,7 +28,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kFledgeBiddingAndAuctionServer, base::FEATURE_DISABLED_BY_DEFAULT}, {kFledgeConsiderKAnonymity, base::FEATURE_DISABLED_BY_DEFAULT}, {kFledgeEnforceKAnonymity, base::FEATURE_DISABLED_BY_DEFAULT}, - {kInterestGroupStorage, base::FEATURE_DISABLED_BY_DEFAULT}, {kParakeet, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrerender2, base::FEATURE_DISABLED_BY_DEFAULT}, {kPrivateAggregationApi, base::FEATURE_DISABLED_BY_DEFAULT}, @@ -38,7 +35,6 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ // Ephemeral Storage can switch cookie storage backend at runtime, so we // can't use it. {kReduceUserAgentMinorVersion, base::FEATURE_ENABLED_BY_DEFAULT}, - {kSharedStorageAPI, base::FEATURE_DISABLED_BY_DEFAULT}, {kSpeculationRulesPrefetchFuture, base::FEATURE_DISABLED_BY_DEFAULT}, }}); diff --git a/chromium_src/third_party/blink/renderer/core/DEPS b/chromium_src/third_party/blink/renderer/core/DEPS index 9366d24ce1ff..597768931f6c 100644 --- a/chromium_src/third_party/blink/renderer/core/DEPS +++ b/chromium_src/third_party/blink/renderer/core/DEPS @@ -4,4 +4,5 @@ include_rules = [ "+brave/third_party/blink/renderer", "+ui/display", "+ui/gfx/geometry", + "+ui/gfx/skia_span_util.h", ] diff --git a/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc b/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc index 1d1b9ab75658..78a78e101e2f 100644 --- a/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc +++ b/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc @@ -5,11 +5,11 @@ #include "brave/third_party/blink/renderer/core/farbling/brave_session_cache.h" #include "third_party/blink/public/platform/web_content_settings_client.h" +#include "ui/gfx/skia_span_util.h" #define BRAVE_CANVAS_ASYNC_BLOB_CREATOR \ brave::BraveSessionCache::From(*context_).PerturbPixels( \ - static_cast(src_data_.addr()), \ - src_data_.computeByteSize()); + gfx::SkPixmapToWritableSpan(src_data_)); #include "src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc" diff --git a/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index 2de3abef88fa..277ef4cf35e9 100644 --- a/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc @@ -6,18 +6,19 @@ #include "base/auto_reset.h" #include "brave/third_party/blink/renderer/core/farbling/brave_session_cache.h" #include "third_party/blink/public/platform/web_content_settings_client.h" - -#define BRAVE_TO_DATA_URL_INTERNAL \ - { \ - ExecutionContext* execution_context = GetExecutionContext(); \ - if (!execution_context) { \ - execution_context = scoped_execution_context_.Get(); \ - } \ - if (execution_context) { \ - brave::BraveSessionCache::From(*execution_context) \ - .PerturbPixels(data_buffer->Pixels(), \ - data_buffer->ComputeByteSize()); \ - } \ +#include "ui/gfx/skia_span_util.h" + +#define BRAVE_TO_DATA_URL_INTERNAL \ + { \ + ExecutionContext* execution_context = GetExecutionContext(); \ + if (!execution_context) { \ + execution_context = scoped_execution_context_.Get(); \ + } \ + if (execution_context) { \ + brave::BraveSessionCache::From(*execution_context) \ + .PerturbPixels( \ + gfx::SkPixmapToWritableSpan(data_buffer->pixmap_multable())); \ + } \ } #include "src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc" diff --git a/chromium_src/third_party/blink/renderer/modules/DEPS b/chromium_src/third_party/blink/renderer/modules/DEPS index f771309b6807..cdbe3be94762 100644 --- a/chromium_src/third_party/blink/renderer/modules/DEPS +++ b/chromium_src/third_party/blink/renderer/modules/DEPS @@ -1,3 +1,4 @@ include_rules = [ "+brave/third_party/blink/renderer", + "+ui/gfx/skia_span_util.h", ] diff --git a/chromium_src/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc b/chromium_src/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc index a86479f70692..91698ce4a89a 100644 --- a/chromium_src/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc +++ b/chromium_src/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc @@ -9,6 +9,7 @@ #include "brave/third_party/blink/renderer/core/farbling/brave_session_cache.h" #include "third_party/blink/renderer/platform/graphics/image_data_buffer.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" +#include "ui/gfx/skia_span_util.h" namespace { @@ -28,9 +29,7 @@ bool IsGoogleMaps(const blink::KURL& url) { if (!IsGoogleMaps(context->Url())) { \ SkPixmap image_data_pixmap = image_data->GetSkPixmap(); \ brave::BraveSessionCache::From(*context).PerturbPixels( \ - static_cast( \ - image_data_pixmap.writable_addr()), \ - image_data_pixmap.computeByteSize()); \ + gfx::SkPixmapToWritableSpan(image_data_pixmap)); \ } \ } diff --git a/chromium_src/third_party/blink/renderer/platform/graphics/image_data_buffer.h b/chromium_src/third_party/blink/renderer/platform/graphics/image_data_buffer.h new file mode 100644 index 000000000000..71868a0f232c --- /dev/null +++ b/chromium_src/third_party/blink/renderer/platform/graphics/image_data_buffer.h @@ -0,0 +1,20 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_DATA_BUFFER_H_ +#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_DATA_BUFFER_H_ + +// Providing multable access to ImageDataBuffer::pixmap_ to allow us to call +// `PerturbPixels` on it. +#define EncodeImage \ + EncodeImage_Unused(); \ + SkPixmap pixmap_multable() { \ + return pixmap_; \ + } \ + bool EncodeImage +#include "src/third_party/blink/renderer/platform/graphics/image_data_buffer.h" // IWYU pragma: export +#undef EncodeImage + +#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_DATA_BUFFER_H_ diff --git a/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc b/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc index de63b412f855..fbb4fca37eb3 100644 --- a/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc +++ b/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc @@ -24,9 +24,11 @@ FetchParameters ScriptFetchOptions::CreateFetchParameters( const DOMWrapperWorld* world_for_csp, CrossOriginAttributeValue cross_origin, const WTF::TextEncoding& encoding, - FetchParameters::DeferOption defer) const { + FetchParameters::DeferOption defer, + const FeatureContext* feature_context) const { auto params = CreateFetchParameters_ChromiumImpl( - url, security_origin, world_for_csp, cross_origin, encoding, defer); + url, security_origin, world_for_csp, cross_origin, encoding, defer, + feature_context); params.MutableOptions().initiator_info.dom_node_id = dom_node_id_; params.MutableOptions().initiator_info.parent_script_id = parent_script_id_; return params; diff --git a/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h b/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h index e80eca152df9..ef626fb34cac 100644 --- a/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h +++ b/chromium_src/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h @@ -14,7 +14,7 @@ CreateFetchParameters_ChromiumImpl( \ const KURL&, const SecurityOrigin*, const DOMWrapperWorld* world, \ CrossOriginAttributeValue, const WTF::TextEncoding&, \ - FetchParameters::DeferOption) const; \ + FetchParameters::DeferOption, const FeatureContext*) const; \ void SetDOMNodeId(DOMNodeId dom_node_id); \ DOMNodeId GetDOMNodeId() const; \ void SetParentScriptId(int parent_script_id); \ diff --git a/common/extensions/api/brave_api_resources.grd b/common/extensions/api/brave_api_resources.grd index c1ef5c7ff833..4ab91706e822 100644 --- a/common/extensions/api/brave_api_resources.grd +++ b/common/extensions/api/brave_api_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/ai_chat/core/browser/ai_chat_service.cc b/components/ai_chat/core/browser/ai_chat_service.cc index 9e4dba658433..60e079b407e5 100644 --- a/components/ai_chat/core/browser/ai_chat_service.cc +++ b/components/ai_chat/core/browser/ai_chat_service.cc @@ -56,7 +56,7 @@ namespace ai_chat { namespace { -constexpr base::FilePath::StringPieceType kDBFileName = +constexpr base::FilePath::StringViewType kDBFileName = FILE_PATH_LITERAL("AIChat"); std::vector FilterVisibleConversations( diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp index e394767b0259..ef04f6f3eb56 100644 --- a/components/autofill_payments_strings.grdp +++ b/components/autofill_payments_strings.grdp @@ -500,7 +500,7 @@ Security code - + Connecting to your card provider... @@ -925,13 +925,13 @@ Merchant doesn't accept this virtual card - You can autofill this card because your $1PayPay account is linked to Google Pay. + You can autofill this card because your $1PayPay account is linked to Google Pay Now you can autofill your $1PayPay cards because your $1PayPay account is linked to Google Pay. - You can autofill this card because your account is linked to Google Pay. + You can autofill this card because your account is linked to Google Pay Cards not accepted by this merchant are disabled @@ -1020,6 +1020,45 @@ Available for purchases over $1$35 + + Pay over time + + + Show <a href="$1">pay over time</a> options at checkout + + + Affirm + + + Zip + + + Virtual card for $1PayLater filled + + + When you pay over time, a one-time virtual card number is filled. This number is only for this purchase. $1Learn more about PayLater + + + Learn more about $1PayLater + + + Continue + + + Back + + + Link account and pay with $1? + + + After you review your order, you must sign into or create an $1 account. This account will be automatically linked to Google Pay. + + + $1 will check your eligibility (this won't affect your credit score). If approved, $1 will provide payment plans for you to choose from and complete your purchase. + + + Keeping your account linked helps you pay faster with $1, but you can unlink it by going to $2wallet.google.com + @@ -1036,7 +1075,7 @@ - Show which rewards and benefits are available for your cards at checkout. <a href="#" aria-description="$1">Learn about card benefits</a> + Show which rewards and benefits are available for your cards at checkout. <a href="$1" aria-description="$2">Learn about card benefits</a> See card benefit terms diff --git a/components/autofill_prediction_improvements_strings.grdp b/components/autofill_prediction_improvements_strings.grdp index be2451867722..2dddae1ac706 100644 --- a/components/autofill_prediction_improvements_strings.grdp +++ b/components/autofill_prediction_improvements_strings.grdp @@ -1,29 +1,106 @@ - - - Autofill with AI + + + + Passport + + + Car + + + Driver's license - - - Fill fields with AI + + + + Add passport + + + Add car + + + Add driver's license + + + + + + Edit passport + + + Edit car + + + Edit driver's license + + + + + + Name + + + Number + + + Country + + + Expiry date + + + Issue date + + + + + + Owner + + + License plate + + + Registration + + + Make + + + Model + + + + + + Name - - Fill + + Region - - , ''' + + Number - - & 1 more field + + Expiration date - - & $14 more fields + + Issue date - + + + Fill fields with AI + + + + Manage information + + + Save your info to autofill @@ -37,24 +114,11 @@ Saved info and the page from $1airline.com are sent to Brave and may be seen by human reviewers to improve this feature. - - - Brave had trouble getting your information - - - Brave didn't find info to fill this field. - - Manage autofill with AI - - - Manage your info - - Loading suggestions @@ -68,26 +132,6 @@ Info you have saved and this page get sent to Brave to see if autofill can help fill this form. Data may be seen by human reviewers to improve this feature. - - - Autofill with AI is an experimental feature and won’t always get it right. $1Manage autofill with AI. - - - Press enter to manage prediction improvements - - - Use left and right keys to navigate to feedback buttons. - - - Thumbs up submits feedback that you like autofill with AI - - - Thumbs down submits feedback that you dislike autofill with AI - - - Send feedback for Autofill with AI. - - Prediction improvements @@ -98,10 +142,26 @@ Go to settings - - This feature uses information you've already saved with autofill, such as your address + + + + Save vehicle? + + + Save driver's license? + + + Save passport? + + + + Update vehicle? + + + Update driver's license? - - This feature uses information you've already saved with autofill, such as your address. You can review and manage this data on this page. + + Update passport? + diff --git a/components/brave_ads/core/public/prefs/pref_provider.h b/components/brave_ads/core/public/prefs/pref_provider.h index af6085592177..1407d6edc242 100644 --- a/components/brave_ads/core/public/prefs/pref_provider.h +++ b/components/brave_ads/core/public/prefs/pref_provider.h @@ -9,6 +9,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/values.h" #include "brave/components/brave_ads/core/public/prefs/pref_provider_interface.h" diff --git a/components/brave_ads/resources/bat_ads_resources.grd b/components/brave_ads/resources/bat_ads_resources.grd index 9ea6acaf3f26..94e9b96ff688 100644 --- a/components/brave_ads/resources/bat_ads_resources.grd +++ b/components/brave_ads/resources/bat_ads_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/brave_extension/extension/resources.grd b/components/brave_extension/extension/resources.grd index f92c5cef9823..7812abc76254 100644 --- a/components/brave_extension/extension/resources.grd +++ b/components/brave_extension/extension/resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/brave_rewards/resources/brave_rewards_static_resources.grd b/components/brave_rewards/resources/brave_rewards_static_resources.grd index 9b79369022e8..1185921a9612 100644 --- a/components/brave_rewards/resources/brave_rewards_static_resources.grd +++ b/components/brave_rewards/resources/brave_rewards_static_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/brave_webtorrent/resources.grd b/components/brave_webtorrent/resources.grd index d1926438e4fa..75caa49ccc27 100644 --- a/components/brave_webtorrent/resources.grd +++ b/components/brave_webtorrent/resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd index d6e12cd7a4c0..eed3a15d9f3f 100644 --- a/components/browser_ui/strings/android/browser_ui_strings.grd +++ b/components/browser_ui/strings/android/browser_ui_strings.grd @@ -1280,6 +1280,15 @@ On + + Customize your new tab page bottom sheet + + + Customize your new tab page bottom sheet opened at full height + + + Customize your new tab page bottom sheet closed + diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp index b3a85e691b93..5822127f438f 100644 --- a/components/browser_ui/strings/android/site_settings.grdp +++ b/components/browser_ui/strings/android/site_settings.grdp @@ -178,6 +178,9 @@ Expand all requests + + How to show requests + @@ -187,6 +190,9 @@ Blocked + + Not Allowed + Exceptions @@ -389,6 +395,10 @@ When on, sites can show any ad to you. When off, sites can’t show intrusive or misleading ads. + + Sites usually show ads so that they can provide content or services free of charge. But, some sites are known to show intrusive or misleading ads. + + @@ -433,6 +443,9 @@ To let %1$sBrave use AR, also turn on camera in <link>Android Settings</link>. + + Sites usually track your camera position for AR features, like games or heads-up directions + @@ -441,6 +454,9 @@ Allow a site to download multiple files automatically. + + Sites might automatically download related files together to save you time + @@ -450,6 +466,9 @@ Allow Background Sync for a specific site. + + After you leave a site, it can keep syncing to finish tasks, like uploading photos or sending a chat message + @@ -520,6 +539,9 @@ To let %1$sBrave access your camera, also turn on camera in <link>Android Settings</link>. + + Sites usually use your video camera for communication features like video chatting + @@ -535,6 +557,9 @@ Blocked from reading clipboard + + Sites usually read your clipboard for features like keeping the formatting of text that you copied + @@ -614,6 +639,9 @@ Block third-party cookies: + + Allow third-party cookies: + Allow related sites to see your activity in the group @@ -625,11 +653,6 @@ =1 {%1$s1 site in %2$sgannette.com's group of sites that can see your activity in the group} other {%1$s1 sites in %2$sgannette.com's group of sites that can see your activity in the group}} - - {COUNT, plural, - =1 {%1$s1 site in %2$sgannette.com's group} - other {%1$s1 sites in %2$sgannette.com's group}} - {COUNT, plural, =1 {Cookies allowed for %1$s1 %2$sgannette.com site} @@ -670,6 +693,9 @@ Mobile site + + You can ask to see the desktop version of sites + @@ -687,6 +713,9 @@ When on, sites can show sign-in prompts. When off, sites can't show sign-in prompts. + + Lets you sign in to websites using the account that you have with an identity service + @@ -720,6 +749,9 @@ When on, sites can ask to know when you’re actively using your device. When off, sites can’t know when you’re actively using your device. + + Sites usually detect when you're actively using your device to set your availability on chat apps + @@ -735,6 +767,9 @@ Block JavaScript for a specific site. + + Sites usually use JavaScript to display interactive features, like video games or web forms + @@ -756,6 +791,9 @@ Open Location Settings + + Sites usually use your location for relevant features or info, like local news or nearby shops + @@ -768,6 +806,9 @@ To let %1$sBrave access your microphone, also turn on microphone in <link>Android Settings</link>. + + Sites usually use your microphone for communication features like video chatting + @@ -789,6 +830,9 @@ When on, sites can use your device’s motion sensors. When off, sites can’t use motion sensors. + + Sites usually use your device's motion sensors for features like virtual reality or fitness tracking + @@ -807,6 +851,9 @@ This device can't read NFC + + Sites usually use near-field communication (NFC) to work with nearby tags or devices, like scanning badges or tapping to pay + @@ -828,6 +875,9 @@ Open notification settings + + Sites usually send notifications to let you know about breaking news or chat messages. + @@ -837,6 +887,9 @@ When on, sites can use pop-ups and redirects. When off, sites can’t use pop-ups and redirects. + + Sites might send pop-ups to show ads, or use redirects to lead you to websites you may not want to visit + @@ -849,6 +902,9 @@ Block sites from playing protected content + + To play content protected by copyright, sites may need to use a content protection service. <link>Learn more</link> + @@ -870,6 +926,9 @@ Mute sound for a specific site. + + Sites might play sound to provide audio for music, videos and other media + @@ -922,6 +981,9 @@ USB + + Sites usually connect to USB devices for features like printing a document or saving to a storage device + @@ -934,6 +996,9 @@ When on, sites can ask to use virtual reality devices. When off, sites can’t use virtual reality devices. + + Sites usually use your virtual reality devices and data to let you enter VR sessions + @@ -947,23 +1012,23 @@ - - Sites can ask to use info they've saved about you + + Sites can ask to use information they've saved about you - - Sites are blocked from asking you to use info they've saved about you + + Sites are blocked from asking you to use information they've saved about you - When on, sites can ask to use info they've saved about you. When off, sites can't ask you to use info they've saved about you. + When on, sites can ask to use information they've saved about you. When off, sites can't ask you to use info they've saved about you. - Sites you visit can embed content from other sites, for example images, ads, and text. These other sites can ask for permission to use info they've saved about you as you browse the site. <link>Learn more about embedded content</link> + Sites you visit can embed content from other sites, for example images, ads, and text. These other sites can ask for permission to use information they've saved about you as you browse the site. <link>Learn more about embedded content</link> - - %1$sgoogle.com can use your info as you browse + + %1$sgoogle.com can use your information as you browse - - %1$sgoogle.com is blocked from using your info on + + %1$sgoogle.com is blocked from using your information on {COUNT, plural, diff --git a/components/collaboration_strings.grdp b/components/collaboration_strings.grdp index 6e4cb6ed8c62..509aa2b92e16 100644 --- a/components/collaboration_strings.grdp +++ b/components/collaboration_strings.grdp @@ -26,18 +26,62 @@ "$1Travel" tab group no longer available + + 1 tab group no longer available + - "$1Travel" and "$2Vacation" "tab groups no longer available + "$1Travel" and "$2Vacation" tab groups no longer available $15 tab groups no longer available + + Loading tab group + + Something went wrong. There was an error. Try again. + + This link doesn’t work + + + Contact the sender to ask for a new link + + + You're signed out + + + To share, join, and collaborate in tab groups, open settings and turn on Allow Brave sign-in + + + Settings + + + Your tab group is full, new members can't join with the link + + + This tab group is full + + + Contact the person who sent this link + + + Your organization doesn't allow you to sign in + + + To share or join tab groups, you must be able to sign in to Brave + + + Your organization limits what you can save + + + When your organization limits saving to your Brave sync chain, you can’t share or join tab groups + + @@ -97,6 +141,12 @@ No recent activity + + Just now + + + Deleted account + diff --git a/components/commerce_strings.grdp b/components/commerce_strings.grdp index c8d921292a07..9cfa40e4d861 100644 --- a/components/commerce_strings.grdp +++ b/components/commerce_strings.grdp @@ -718,6 +718,9 @@ Undo + + Not available + Compare similar products side-by-side diff --git a/components/components_brave_strings.grd b/components/components_brave_strings.grd index fbc15aea68e7..5b48fc82f898 100644 --- a/components/components_brave_strings.grd +++ b/components/components_brave_strings.grd @@ -212,10 +212,10 @@ This page has been blocked by Brave - - Go to - Applications > System Preferences > Network > Advanced > Proxies - and deselect any proxies that have been selected. + + Go to Applications > System Settings > Network, select the + active network, click the Details... button, and deselect any proxies + that may have been selected. diff --git a/components/embedder_support/BUILD.gn b/components/embedder_support/BUILD.gn index 3521e175dd5d..b775de00c131 100644 --- a/components/embedder_support/BUILD.gn +++ b/components/embedder_support/BUILD.gn @@ -13,7 +13,7 @@ source_set("unit_tests") { deps = [ "//base/test:test_support", "//components/embedder_support", - "//components/embedder_support:browser_util", + "//components/embedder_support:user_agent", "//components/version_info", "//testing/gtest", "//third_party/blink/public/common", diff --git a/components/error_page_strings.grdp b/components/error_page_strings.grdp index e6a23266c689..c0f5f7c85a9e 100644 --- a/components/error_page_strings.grdp +++ b/components/error_page_strings.grdp @@ -121,6 +121,9 @@ To run this app, re-enable Isolated Web App Developer Mode + + The page you requested could not be found in the application + This site can’t be loaded from the cache diff --git a/components/filecoin/rs/BUILD.gn b/components/filecoin/rs/BUILD.gn index 00fed67258b4..a80d9d86bf64 100644 --- a/components/filecoin/rs/BUILD.gn +++ b/components/filecoin/rs/BUILD.gn @@ -17,6 +17,7 @@ rust_static_library("rust_lib") { cxx_bindings = [ "src/lib.rs" ] deps = [ + "//brave/third_party/rust/base64/v0_13:lib", "//brave/third_party/rust/blake2b_simd/v1:lib", "//brave/third_party/rust/bls_signatures/v0_15:lib", "//brave/third_party/rust/cid/v0_11:lib", @@ -26,7 +27,6 @@ rust_static_library("rust_lib") { "//brave/third_party/rust/libsecp256k1/v0_7:lib", "//brave/third_party/rust/multihash_codetable/v0_1:lib", "//brave/third_party/rust/thiserror/v1:lib", - "//third_party/rust/base64/v0_13:lib", "//third_party/rust/serde/v1:lib", "//third_party/rust/serde_json/v1:lib", ] diff --git a/components/ipfs/ipfs_common.h b/components/ipfs/ipfs_common.h index 7676568e571e..fa7dce5f251f 100644 --- a/components/ipfs/ipfs_common.h +++ b/components/ipfs/ipfs_common.h @@ -10,22 +10,22 @@ #include "build/build_config.h" #if BUILDFLAG(IS_WIN) -static const base::FilePath::StringPieceType kIpfsClientComponentId = +static const base::FilePath::StringViewType kIpfsClientComponentId = FILE_PATH_LITERAL("lnbclahgobmjphilkalbhebakmblnbij"); #elif BUILDFLAG(IS_MAC) #if defined(ARCH_CPU_ARM64) -static const base::FilePath::StringPieceType kIpfsClientComponentId = +static const base::FilePath::StringViewType kIpfsClientComponentId = FILE_PATH_LITERAL("lejaflgbgglfaomemffoaappaihfligf"); #else -static const base::FilePath::StringPieceType kIpfsClientComponentId = +static const base::FilePath::StringViewType kIpfsClientComponentId = FILE_PATH_LITERAL("nljcddpbnaianmglkpkneakjaapinabi"); #endif #elif BUILDFLAG(IS_LINUX) #if defined(ARCH_CPU_ARM64) -static const base::FilePath::StringPieceType kIpfsClientComponentId = +static const base::FilePath::StringViewType kIpfsClientComponentId = FILE_PATH_LITERAL("fmmldihckdnognaabhligdpckkeancng"); #else -static const base::FilePath::StringPieceType kIpfsClientComponentId = +static const base::FilePath::StringViewType kIpfsClientComponentId = FILE_PATH_LITERAL("oecghfpdmkjlhnfpmmjegjacfimiafjp"); #endif #endif diff --git a/components/management_strings.grdp b/components/management_strings.grdp index e52c31fe5056..a8330a22cc7a 100644 --- a/components/management_strings.grdp +++ b/components/management_strings.grdp @@ -462,7 +462,4 @@ Profile management - - Sign-in is required by your organization - diff --git a/components/misc_metrics/page_metrics.cc b/components/misc_metrics/page_metrics.cc index 95e048344b76..4d8b5b0cb0cd 100644 --- a/components/misc_metrics/page_metrics.cc +++ b/components/misc_metrics/page_metrics.cc @@ -93,7 +93,7 @@ PageMetrics::PageMetrics(PrefService* local_state, PageMetrics::~PageMetrics() = default; -void PageMetrics::OnHttpsNavigationEvent(const char* histogram_name, +void PageMetrics::OnHttpsNavigationEvent(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample) { HttpsEvent event = static_cast(sample); @@ -117,7 +117,7 @@ void PageMetrics::OnHttpsNavigationEvent(const char* histogram_name, } void PageMetrics::OnInterstitialDecisionEvent( - const char* histogram_name, + std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample) { if (sample != security_interstitials::MetricsHelper::Decision::PROCEED) { diff --git a/components/misc_metrics/page_metrics.h b/components/misc_metrics/page_metrics.h index 3a78c14cc414..d8fc0c0f0545 100644 --- a/components/misc_metrics/page_metrics.h +++ b/components/misc_metrics/page_metrics.h @@ -7,6 +7,7 @@ #define BRAVE_COMPONENTS_MISC_METRICS_PAGE_METRICS_H_ #include +#include #include #include "base/functional/callback_forward.h" @@ -86,10 +87,10 @@ class PageMetrics { void ReportFirstPageLoadTime(); - void OnHttpsNavigationEvent(const char* histogram_name, + void OnHttpsNavigationEvent(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample); - void OnInterstitialDecisionEvent(const char* histogram_name, + void OnInterstitialDecisionEvent(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample); diff --git a/components/p3a/histograms_braveizer.cc b/components/p3a/histograms_braveizer.cc index 511231b5dc30..df1fb96840d9 100644 --- a/components/p3a/histograms_braveizer.cc +++ b/components/p3a/histograms_braveizer.cc @@ -47,7 +47,7 @@ void HistogramsBraveizer::InitCallbacks() { histogram_sample_callbacks_.push_back( std::make_unique< base::StatisticsRecorder::ScopedHistogramSampleObserver>( - std::string(histogram_name), + histogram_name, base::BindRepeating(&HistogramsBraveizer::DoHistogramBravetization, this))); } @@ -56,11 +56,10 @@ void HistogramsBraveizer::InitCallbacks() { // TODO(iefremov): Replace a bunch of 'if's with something more elegant. // Records the given sample using the proper Brave way. void HistogramsBraveizer::DoHistogramBravetization( - const char* histogram_name, + std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample) { - DCHECK(histogram_name); - if (strcmp("DefaultBrowser.State", histogram_name) == 0) { + if ("DefaultBrowser.State" == histogram_name) { int answer = 0; switch (sample) { case 0: // Not default. @@ -79,7 +78,7 @@ void HistogramsBraveizer::DoHistogramBravetization( UMA_HISTOGRAM_BOOLEAN("Brave.Core.IsDefault", answer); } - if (strcmp("Extensions.LoadExtension", histogram_name) == 0) { + if ("Extensions.LoadExtension" == histogram_name) { int answer = 0; if (sample == 1) answer = 1; @@ -92,8 +91,8 @@ void HistogramsBraveizer::DoHistogramBravetization( return; } - if (strcmp("Tabs.TabCount", histogram_name) == 0 || - strcmp("Tabs.TabCountPerLoad", histogram_name) == 0) { + if ("Tabs.TabCount" == histogram_name || + "Tabs.TabCountPerLoad" == histogram_name) { int answer = 0; if (0 <= sample && sample <= 1) { answer = 0; @@ -111,7 +110,7 @@ void HistogramsBraveizer::DoHistogramBravetization( return; } - if (strcmp("Tabs.WindowCount", histogram_name) == 0) { + if ("Tabs.WindowCount" == histogram_name) { int answer = 0; if (sample <= 0) { answer = 0; diff --git a/components/p3a/histograms_braveizer.h b/components/p3a/histograms_braveizer.h index a2bd7e02e104..5298dfa2efac 100644 --- a/components/p3a/histograms_braveizer.h +++ b/components/p3a/histograms_braveizer.h @@ -33,7 +33,7 @@ class HistogramsBraveizer // i.e. reemitted using a different name and custom buckets. void InitCallbacks(); - void DoHistogramBravetization(const char* histogram_name, + void DoHistogramBravetization(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample); diff --git a/components/p3a/p3a_message.h b/components/p3a/p3a_message.h index 3bafb50ff526..c958cbc70b7c 100644 --- a/components/p3a/p3a_message.h +++ b/components/p3a/p3a_message.h @@ -11,6 +11,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "base/values.h" #include "brave/components/p3a/metric_config.h" diff --git a/components/p3a/p3a_service.cc b/components/p3a/p3a_service.cc index 4b6d425f6934..e2220ed1f4d3 100644 --- a/components/p3a/p3a_service.cc +++ b/components/p3a/p3a_service.cc @@ -107,9 +107,8 @@ void P3AService::RegisterPrefs(PrefRegistrySimple* registry, bool first_run) { void P3AService::InitCallback(std::string_view histogram_name) { histogram_sample_callbacks_.push_back( std::make_unique( - std::string(histogram_name), - base::BindRepeating(&P3AService::OnHistogramChanged, - base::Unretained(this)))); + histogram_name, base::BindRepeating(&P3AService::OnHistogramChanged, + base::Unretained(this)))); } void P3AService::InitCallbacks() { @@ -144,7 +143,7 @@ void P3AService::RegisterDynamicMetric(const std::string& histogram_name, dynamic_metric_log_types_[histogram_name] = log_type; dynamic_metric_sample_callbacks_[histogram_name] = std::make_unique( - std::string(histogram_name), + histogram_name, base::BindRepeating(&P3AService::OnHistogramChanged, this)); ScopedDictPrefUpdate update(&*local_state_, kDynamicMetricsDictPref); @@ -245,11 +244,9 @@ void P3AService::OnP3AEnabledChanged() { } } -void P3AService::OnHistogramChanged(const char* histogram_name, +void P3AService::OnHistogramChanged(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample) { - DCHECK(histogram_name != nullptr); - std::unique_ptr samples = base::StatisticsRecorder::FindHistogram(histogram_name)->SnapshotDelta(); @@ -277,7 +274,7 @@ void P3AService::OnHistogramChanged(const char* histogram_name, } // Special handling of P2A histograms. - if (std::string_view(histogram_name).starts_with("Brave.P2A")) { + if (histogram_name.starts_with("Brave.P2A")) { // We need the bucket count to make proper perturbation. // All P2A metrics should be implemented as linear histograms. base::SampleVector* vector = @@ -296,7 +293,7 @@ void P3AService::OnHistogramChanged(const char* histogram_name, histogram_name, sample, bucket)); } -void P3AService::OnHistogramChangedOnUI(const char* histogram_name, +void P3AService::OnHistogramChangedOnUI(std::string_view histogram_name, base::HistogramBase::Sample32 sample, size_t bucket) { VLOG(2) << "P3AService::OnHistogramChanged: histogram_name = " @@ -314,7 +311,7 @@ void P3AService::HandleHistogramChange( size_t bucket, std::optional only_update_for_constellation) { if (IsSuspendedMetric(histogram_name, bucket)) { - message_manager_->RemoveMetricValue(std::string(histogram_name), + message_manager_->RemoveMetricValue(histogram_name, only_update_for_constellation); return; } @@ -322,7 +319,7 @@ void P3AService::HandleHistogramChange( if (metric_config && *metric_config && (*metric_config)->constellation_only) { only_update_for_constellation = true; } - message_manager_->UpdateMetricValue(std::string(histogram_name), bucket, + message_manager_->UpdateMetricValue(histogram_name, bucket, only_update_for_constellation); } diff --git a/components/p3a/p3a_service.h b/components/p3a/p3a_service.h index c451f88a5f5c..0a7e70ded712 100644 --- a/components/p3a/p3a_service.h +++ b/components/p3a/p3a_service.h @@ -96,7 +96,7 @@ class P3AService : public base::RefCountedThreadSafe, // Invoked by callbacks registered by our service. Since these callbacks // can fire on any thread, this method reposts everything to UI thread. - void OnHistogramChanged(const char* histogram_name, + void OnHistogramChanged(std::string_view histogram_name, uint64_t name_hash, base::HistogramBase::Sample32 sample); @@ -119,7 +119,7 @@ class P3AService : public base::RefCountedThreadSafe, void OnP3AEnabledChanged(); - void OnHistogramChangedOnUI(const char* histogram_name, + void OnHistogramChangedOnUI(std::string_view histogram_name, base::HistogramBase::Sample32 sample, size_t bucket); diff --git a/components/password_manager_strings.grdp b/components/password_manager_strings.grdp index f42cb90180a6..c5332e826427 100644 --- a/components/password_manager_strings.grdp +++ b/components/password_manager_strings.grdp @@ -78,53 +78,25 @@ Suggest Strong Password… - - Never saved - Saved passwords - - Brave Smart Lock - Brave Passwords Password for $1chef@google.com - - Use Touch ID - Use screen lock Passkey - - Use Windows Hello - Use device sign-in - - Passkey from your Brave Profile - - - Passkey from iCloud Keychain - - - Passkey from Brave Password Manager - - - Passkey from Windows Hello - - - Passkey from "$1Pixel 7" - - - + Passkey • your Brave Profile @@ -140,16 +112,6 @@ Passkey • "$1Pixel 7" - - - Use a Passkey on a Different Device - - - - - Use a passkey on a different device - - Use a Different Passkey diff --git a/components/permissions/contexts/brave_google_sign_in_permission_context.cc b/components/permissions/contexts/brave_google_sign_in_permission_context.cc index aea2027e4238..4aafd6ea5193 100644 --- a/components/permissions/contexts/brave_google_sign_in_permission_context.cc +++ b/components/permissions/contexts/brave_google_sign_in_permission_context.cc @@ -10,7 +10,6 @@ #include "components/content_settings/browser/page_specific_content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/permissions/permission_request_id.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom.h" namespace permissions { diff --git a/components/permissions/contexts/brave_localhost_permission_context.cc b/components/permissions/contexts/brave_localhost_permission_context.cc index bb16c8c7ad3a..160fa5704dfa 100644 --- a/components/permissions/contexts/brave_localhost_permission_context.cc +++ b/components/permissions/contexts/brave_localhost_permission_context.cc @@ -10,7 +10,6 @@ #include "components/content_settings/browser/page_specific_content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/permissions/permission_request_id.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom.h" namespace permissions { diff --git a/components/permissions_strings.grdp b/components/permissions_strings.grdp index 4b67b04fda69..e09e2492bd44 100644 --- a/components/permissions_strings.grdp +++ b/components/permissions_strings.grdp @@ -152,8 +152,8 @@ Lock and use your mouse - - $1google.com wants to use info they've saved about you + + $1google.com wants to use information they've saved about you Access cookies and site data. diff --git a/components/playlist/browser/mime_util.cc b/components/playlist/browser/mime_util.cc index 7efc96de4df3..61705bd7c11c 100644 --- a/components/playlist/browser/mime_util.cc +++ b/components/playlist/browser/mime_util.cc @@ -26,7 +26,7 @@ namespace { // * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types // constexpr inline auto kMimeToExtensionMap = - base::MakeFixedFlatMap( + base::MakeFixedFlatMap( {/*m3u8*/ {"application/x-mpegurl", FILE_PATH_LITERAL("m3u8")}, {"application/vnd.apple.mpegurl", FILE_PATH_LITERAL("m3u8")}, @@ -65,7 +65,7 @@ constexpr inline auto kMimeToExtensionMap = {"video/x-m4v", FILE_PATH_LITERAL("m4v")}}); constexpr inline auto kExtensionToMimeMap = - base::MakeFixedFlatMap( + base::MakeFixedFlatMap( {{FILE_PATH_LITERAL("m3u8"), "application/x-mpegurl"}, {FILE_PATH_LITERAL("aac"), "audio/aac"}, {FILE_PATH_LITERAL("flac"), "audio/flac"}, @@ -99,7 +99,7 @@ std::optional GetFileExtensionForMimetype( } std::optional GetMimeTypeForFileExtension( - base::FilePath::StringPieceType file_extension) { + base::FilePath::StringViewType file_extension) { if (decltype(kExtensionToMimeMap)::const_iterator iter = kExtensionToMimeMap.find(file_extension); iter != kExtensionToMimeMap.end()) { diff --git a/components/playlist/browser/mime_util.h b/components/playlist/browser/mime_util.h index fa9a0487f65d..d50a6937002c 100644 --- a/components/playlist/browser/mime_util.h +++ b/components/playlist/browser/mime_util.h @@ -21,7 +21,7 @@ std::optional GetFileExtensionForMimetype( std::string_view mime_type); std::optional GetMimeTypeForFileExtension( - base::FilePath::StringPieceType file_extension); + base::FilePath::StringViewType file_extension); std::vector GetSupportedMimetypes(); diff --git a/components/playlist/browser/playlist_service.cc b/components/playlist/browser/playlist_service.cc index 4e4d468cb57f..19d80b4ea331 100644 --- a/components/playlist/browser/playlist_service.cc +++ b/components/playlist/browser/playlist_service.cc @@ -37,10 +37,10 @@ namespace playlist { namespace { -constexpr base::FilePath::StringPieceType kBaseDirName = +constexpr base::FilePath::StringViewType kBaseDirName = FILE_PATH_LITERAL("playlist"); -constexpr base::FilePath::StringPieceType kThumbnailFileName = +constexpr base::FilePath::StringViewType kThumbnailFileName = FILE_PATH_LITERAL("thumbnail"); std::vector GetOrphanedPaths( diff --git a/components/resources/brave_components_resources.grd b/components/resources/brave_components_resources.grd index 68ef155a012a..754d0ba9959b 100644 --- a/components/resources/brave_components_resources.grd +++ b/components/resources/brave_components_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/resources/brave_components_strings.grd b/components/resources/brave_components_strings.grd index 1e34a348ec9d..cab932cd901c 100644 --- a/components/resources/brave_components_strings.grd +++ b/components/resources/brave_components_strings.grd @@ -1,5 +1,5 @@ - + diff --git a/components/search_engines/BUILD.gn b/components/search_engines/BUILD.gn index 5bf97133870f..649bc6160740 100644 --- a/components/search_engines/BUILD.gn +++ b/components/search_engines/BUILD.gn @@ -10,6 +10,7 @@ source_set("unit_tests") { deps = [ "//brave/components/search_engines", "//components/search_engines", + "//components/search_engines:test_support", "//testing/gtest", ] } diff --git a/components/search_engines/brave_prepopulated_engines.cc b/components/search_engines/brave_prepopulated_engines.cc index cda70eec9933..15dc7a990327 100644 --- a/components/search_engines/brave_prepopulated_engines.cc +++ b/components/search_engines/brave_prepopulated_engines.cc @@ -60,7 +60,7 @@ const std::map {PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, &duckduckgo_de}, {PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, &duckduckgo_au_nz_ie}, {PREPOPULATED_ENGINE_ID_QWANT, &qwant}, - {PREPOPULATED_ENGINE_ID_STARTPAGE, &startpage}, + {PREPOPULATED_ENGINE_ID_STARTPAGE, &brave_startpage}, {PREPOPULATED_ENGINE_ID_ECOSIA, &brave_ecosia}, {PREPOPULATED_ENGINE_ID_BRAVE, &brave_search}, }; @@ -165,17 +165,16 @@ const PrepopulatedEngine qwant = MakeBravePrepopulatedEngine( SEARCH_ENGINE_QWANT, PREPOPULATED_ENGINE_ID_QWANT); -const PrepopulatedEngine startpage = MakeBravePrepopulatedEngine( - u"Startpage", - u":sp", - "https://www.startpage.com/favicon.ico", - "https://www.startpage.com/do/" - "search?q={searchTerms}&segment=startpage.brave", - "UTF-8", - "https://www.startpage.com/cgi-bin/" - "csuggest?query={searchTerms}&limit=10&format=json", - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_STARTPAGE); +const PrepopulatedEngine brave_startpage = + ModifyEngineParams(startpage, + u"Startpage", + u":sp", + "https://www.startpage.com/do/" + "search?q={searchTerms}&segment=startpage.brave", + "https://www.startpage.com/cgi-bin/" + "csuggest?query={searchTerms}&limit=10&format=json", + nullptr, + PREPOPULATED_ENGINE_ID_STARTPAGE); const PrepopulatedEngine brave_yandex = ModifyEngineParams(yandex_com, diff --git a/components/search_engines/brave_prepopulated_engines.h b/components/search_engines/brave_prepopulated_engines.h index 8c0f6d2b70eb..2afe1318e4bb 100644 --- a/components/search_engines/brave_prepopulated_engines.h +++ b/components/search_engines/brave_prepopulated_engines.h @@ -16,7 +16,7 @@ namespace TemplateURLPrepopulateData { // IMPORTANT! Make sure to bump this value if you make changes to the // engines below or add/remove engines. -inline constexpr int kBraveCurrentDataVersion = 30; +inline constexpr int kBraveCurrentDataVersion = 31; // The version is important to increment because Chromium will cache the list // of search engines that are shown. When the version is incremented, Chromium @@ -46,7 +46,12 @@ enum BravePrepopulatedEngineID : unsigned int { PREPOPULATED_ENGINE_ID_NAVER = 67, PREPOPULATED_ENGINE_ID_DAUM = 68, PREPOPULATED_ENGINE_ID_ECOSIA = 101, + PREPOPULATED_ENGINE_ID_STARTPAGE = 112, // These engine IDs are not defined in Chromium + // When adding a new engine, also add it to kBraveAddedEngines in + // chromium_src/components/search_engines/ + // brave_template_url_prepopulate_data_unittest.cc, so that we would know if + // Chromium adds the same engine in the future. BRAVE_PREPOPULATED_ENGINES_START = 500, PREPOPULATED_ENGINE_ID_AMAZON = 500, // No longer in defaults (2/2019). PREPOPULATED_ENGINE_ID_DUCKDUCKGO, @@ -61,11 +66,11 @@ enum BravePrepopulatedEngineID : unsigned int { PREPOPULATED_ENGINE_ID_SEARX, // No longer in defaults (2/2019). PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, // No longer in defaults (2/2019). PREPOPULATED_ENGINE_ID_STACKOVERFLOW, // No longer in defaults (2/2019). - PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, // No longer in defaults (2/2019). - PREPOPULATED_ENGINE_ID_WIKIPEDIA, // No longer in defaults (2/2019). - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, // No longer in defaults (2/2019). - PREPOPULATED_ENGINE_ID_YOUTUBE, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_STARTPAGE_OLD, // Added to Chromium (2/2025). + PREPOPULATED_ENGINE_ID_TWITTER, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_WIKIPEDIA, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_YOUTUBE, // No longer in defaults (2/2019). PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, @@ -116,7 +121,7 @@ extern const PrepopulatedEngine duckduckgo_lite; #endif extern const PrepopulatedEngine brave_ecosia; extern const PrepopulatedEngine qwant; -extern const PrepopulatedEngine startpage; +extern const PrepopulatedEngine brave_startpage; extern const PrepopulatedEngine brave_yandex; extern const PrepopulatedEngine brave_search; extern const PrepopulatedEngine brave_search_tor; diff --git a/components/search_engines/brave_prepopulated_engines_unittest.cc b/components/search_engines/brave_prepopulated_engines_unittest.cc index f1c2b6cf843c..2a01d41362b5 100644 --- a/components/search_engines/brave_prepopulated_engines_unittest.cc +++ b/components/search_engines/brave_prepopulated_engines_unittest.cc @@ -4,13 +4,26 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "brave/components/search_engines/brave_prepopulated_engines.h" + +#include "components/search_engines/search_engine_choice/search_engine_choice_service.h" +#include "components/search_engines/search_engines_test_environment.h" #include "components/search_engines/template_url_data.h" #include "components/search_engines/template_url_prepopulate_data.h" #include "testing/gtest/include/gtest/gtest.h" -TEST(BravePrepopulatedEnginesTest, ModifiedProviderTest) { +class BravePrepopulatedEnginesTest : public testing::Test { + public: + BravePrepopulatedEnginesTest() = default; + + protected: + search_engines::SearchEnginesTestEnvironment search_engines_test_environment_; +}; + +TEST_F(BravePrepopulatedEnginesTest, ModifiedProviderTest) { auto data = TemplateURLPrepopulateData::GetPrepopulatedEngine( - nullptr, nullptr, + search_engines_test_environment_.pref_service(), + search_engines_test_environment_.search_engine_choice_service() + .GetCountryId(), TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BING); // Check modified bing provider url. EXPECT_EQ(data->url(), "https://www.bing.com/search?q={searchTerms}"); diff --git a/components/sidebar/browser/sidebar_service.cc b/components/sidebar/browser/sidebar_service.cc index 482b1997d635..ed3089c586ee 100644 --- a/components/sidebar/browser/sidebar_service.cc +++ b/components/sidebar/browser/sidebar_service.cc @@ -331,8 +331,8 @@ void SidebarService::MoveItem(size_t from, size_t to) { void SidebarService::UpdateItem(const GURL& old_url, const GURL& new_url, - const std::u16string& old_title, - const std::u16string& new_title) { + std::u16string_view old_title, + std::u16string_view new_title) { DCHECK(old_url.is_valid() && new_url.is_valid()); DCHECK(!old_title.empty() && !new_title.empty()); diff --git a/components/sidebar/browser/sidebar_service.h b/components/sidebar/browser/sidebar_service.h index bb44ce13dd3d..d39030686d11 100644 --- a/components/sidebar/browser/sidebar_service.h +++ b/components/sidebar/browser/sidebar_service.h @@ -74,8 +74,8 @@ class SidebarService : public KeyedService { // URL acts like an id for each item. void UpdateItem(const GURL& old_url, const GURL& new_url, - const std::u16string& old_title, - const std::u16string& new_title); + std::u16string_view old_title, + std::u16string_view new_title); void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); diff --git a/components/skus/browser/rs/lib/BUILD.gn b/components/skus/browser/rs/lib/BUILD.gn index d6a092aa1500..1afc3ce85c73 100644 --- a/components/skus/browser/rs/lib/BUILD.gn +++ b/components/skus/browser/rs/lib/BUILD.gn @@ -25,6 +25,7 @@ rust_static_library("rust_lib") { deps = [ "//brave/third_party/rust/async_trait/v0_1:lib", + "//brave/third_party/rust/base64/v0_13:lib", "//brave/third_party/rust/bigdecimal/v0_1:lib", "//brave/third_party/rust/challenge_bypass_ristretto/v2:lib", "//brave/third_party/rust/chrono/v0_4:lib", @@ -36,7 +37,6 @@ rust_static_library("rust_lib") { "//brave/third_party/rust/tracing/v0_1:lib", "//brave/third_party/rust/urlencoding/v1:lib", "//brave/third_party/rust/uuid/v1:lib", - "//third_party/rust/base64/v0_13:lib", "//third_party/rust/rand/v0_8:lib", "//third_party/rust/serde/v1:lib", "//third_party/rust/serde_json/v1:lib", diff --git a/components/supervised_user_strings.grdp b/components/supervised_user_strings.grdp index 3a85ee9369ca..a9e4f2385f31 100644 --- a/components/supervised_user_strings.grdp +++ b/components/supervised_user_strings.grdp @@ -99,4 +99,7 @@ You previously blocked $1example.com + + An error occurred. Try again later. + diff --git a/components/sync/service/brave_sync_auth_manager.cc b/components/sync/service/brave_sync_auth_manager.cc index d03d8ca746ad..77f7a4517f70 100644 --- a/components/sync/service/brave_sync_auth_manager.cc +++ b/components/sync/service/brave_sync_auth_manager.cc @@ -25,11 +25,8 @@ std::string AppendBraveServiceKeyHeaderString() { BraveSyncAuthManager::BraveSyncAuthManager( signin::IdentityManager* identity_manager, - const AccountStateChangedCallback& account_state_changed, - const CredentialsChangedCallback& credentials_changed) - : SyncAuthManager(identity_manager, - account_state_changed, - credentials_changed) {} + SyncAuthManager::Delegate* delegate) + : SyncAuthManager(identity_manager, delegate) {} BraveSyncAuthManager::~BraveSyncAuthManager() = default; @@ -129,7 +126,7 @@ void BraveSyncAuthManager::OnNetworkTimeFetched(const base::Time& time) { } access_token_ = GenerateAccessToken(timestamp); if (registered_for_auth_notifications_) { - credentials_changed_callback_.Run(); + delegate_->SyncAuthCredentialsChanged(); } } diff --git a/components/sync/service/brave_sync_auth_manager.h b/components/sync/service/brave_sync_auth_manager.h index b0347517281a..09b5bcabc2bc 100644 --- a/components/sync/service/brave_sync_auth_manager.h +++ b/components/sync/service/brave_sync_auth_manager.h @@ -17,8 +17,7 @@ namespace syncer { class BraveSyncAuthManager : public SyncAuthManager { public: BraveSyncAuthManager(signin::IdentityManager* identity_manager, - const AccountStateChangedCallback& account_state_changed, - const CredentialsChangedCallback& credentials_changed); + SyncAuthManager::Delegate* delegate); BraveSyncAuthManager(const BraveSyncAuthManager&) = delete; BraveSyncAuthManager& operator=(const BraveSyncAuthManager&) = delete; ~BraveSyncAuthManager() override; diff --git a/components/sync/service/brave_sync_auth_manager_unittest.cc b/components/sync/service/brave_sync_auth_manager_unittest.cc index 5b333ecd403b..cc5b76a0ad9c 100644 --- a/components/sync/service/brave_sync_auth_manager_unittest.cc +++ b/components/sync/service/brave_sync_auth_manager_unittest.cc @@ -42,23 +42,24 @@ constexpr char kAccountEmail[] = "502042270C8145247ED70A18F87022A3 " "9886900AB36F2FFF655635DBE516765E @brave.com"; +class MockDelegate : public SyncAuthManager::Delegate { + public: + MockDelegate() = default; + ~MockDelegate() override = default; + + MOCK_METHOD(void, SyncAuthAccountStateChanged, (), (override)); + MOCK_METHOD(void, SyncAuthCredentialsChanged, (), (override)); +}; + class BraveSyncAuthManagerTest : public testing::Test { protected: - using AccountStateChangedCallback = - SyncAuthManager::AccountStateChangedCallback; - using CredentialsChangedCallback = - SyncAuthManager::CredentialsChangedCallback; - BraveSyncAuthManagerTest() : identity_env_(&test_url_loader_factory_) {} ~BraveSyncAuthManagerTest() override = default; - std::unique_ptr CreateAuthManager( - const AccountStateChangedCallback& account_state_changed, - const CredentialsChangedCallback& credentials_changed) { + std::unique_ptr CreateAuthManager() { return std::make_unique( - identity_env_.identity_manager(), account_state_changed, - credentials_changed); + identity_env_.identity_manager(), &delegate_); } void SetNetworkTime() { @@ -66,19 +67,19 @@ class BraveSyncAuthManagerTest : public testing::Test { base::Time::FromMillisecondsSinceUnixEpoch(1234567)); } + MockDelegate& delegate() { return delegate_; } + private: base::test::TaskEnvironment task_environment_; network::TestURLLoaderFactory test_url_loader_factory_; signin::IdentityTestEnvironment identity_env_; + testing::NiceMock delegate_; }; TEST_F(BraveSyncAuthManagerTest, IgnoresEventsIfNotRegistered) { - base::MockCallback account_state_changed; - base::MockCallback credentials_changed; - EXPECT_CALL(account_state_changed, Run()).Times(0); - EXPECT_CALL(credentials_changed, Run()).Times(0); - auto auth_manager = - CreateAuthManager(account_state_changed.Get(), credentials_changed.Get()); + EXPECT_CALL(delegate(), SyncAuthAccountStateChanged).Times(0); + EXPECT_CALL(delegate(), SyncAuthCredentialsChanged).Times(0); + auto auth_manager = CreateAuthManager(); // Fire some auth events. We haven't called RegisterForAuthNotifications, so // none of this should result in any callback calls. @@ -90,12 +91,9 @@ TEST_F(BraveSyncAuthManagerTest, IgnoresEventsIfNotRegistered) { } TEST_F(BraveSyncAuthManagerTest, GetAccessToken) { - base::MockCallback account_state_changed; - base::MockCallback credentials_changed; - EXPECT_CALL(account_state_changed, Run()).Times(1); - EXPECT_CALL(credentials_changed, Run()).Times(1); - auto auth_manager = - CreateAuthManager(account_state_changed.Get(), credentials_changed.Get()); + EXPECT_CALL(delegate(), SyncAuthAccountStateChanged).Times(1); + EXPECT_CALL(delegate(), SyncAuthCredentialsChanged).Times(1); + auto auth_manager = CreateAuthManager(); SetNetworkTime(); auth_manager->RegisterForAuthNotifications(); @@ -116,12 +114,9 @@ TEST_F(BraveSyncAuthManagerTest, GetAccessToken) { } TEST_F(BraveSyncAuthManagerTest, Reset) { - base::MockCallback account_state_changed; - base::MockCallback credentials_changed; - EXPECT_CALL(account_state_changed, Run()).Times(2); - EXPECT_CALL(credentials_changed, Run()).Times(1); - auto auth_manager = - CreateAuthManager(account_state_changed.Get(), credentials_changed.Get()); + EXPECT_CALL(delegate(), SyncAuthAccountStateChanged).Times(2); + EXPECT_CALL(delegate(), SyncAuthCredentialsChanged).Times(1); + auto auth_manager = CreateAuthManager(); SetNetworkTime(); auth_manager->RegisterForAuthNotifications(); @@ -136,12 +131,9 @@ TEST_F(BraveSyncAuthManagerTest, Reset) { } TEST_F(BraveSyncAuthManagerTest, MalformedSyncCode) { - base::MockCallback account_state_changed; - base::MockCallback credentials_changed; - EXPECT_CALL(account_state_changed, Run()).Times(0); - EXPECT_CALL(credentials_changed, Run()).Times(0); - auto auth_manager = - CreateAuthManager(account_state_changed.Get(), credentials_changed.Get()); + EXPECT_CALL(delegate(), SyncAuthAccountStateChanged).Times(0); + EXPECT_CALL(delegate(), SyncAuthCredentialsChanged).Times(0); + auto auth_manager = CreateAuthManager(); SetNetworkTime(); auth_manager->RegisterForAuthNotifications(); diff --git a/components/sync_ui_strings.grdp b/components/sync_ui_strings.grdp index 16237a5e873d..89807c5e9878 100644 --- a/components/sync_ui_strings.grdp +++ b/components/sync_ui_strings.grdp @@ -14,6 +14,9 @@ Passwords + + Passwords and passkeys + Settings diff --git a/components/tor/constants.cc b/components/tor/constants.cc index 697078215bda..dd2f06f01914 100644 --- a/components/tor/constants.cc +++ b/components/tor/constants.cc @@ -19,7 +19,7 @@ namespace tor { namespace { // The filename for the tor client config file. -constexpr base::FilePath::StringPieceType kTorRcFilename = +constexpr base::FilePath::StringViewType kTorRcFilename = FILE_PATH_LITERAL("tor-torrc"); base::FilePath GetUserDataDir() { diff --git a/components/tor/resources/tor_static_resources.grd b/components/tor/resources/tor_static_resources.grd index 87f5d7bbad39..80ab8d735595 100644 --- a/components/tor/resources/tor_static_resources.grd +++ b/components/tor/resources/tor_static_resources.grd @@ -1,5 +1,5 @@ - + diff --git a/components/webpack/gen-webpack-grd.js b/components/webpack/gen-webpack-grd.js index f756751c5503..a8242d592eae 100644 --- a/components/webpack/gen-webpack-grd.js +++ b/components/webpack/gen-webpack-grd.js @@ -29,7 +29,7 @@ function getIncludesString (fileList) { */ function getGrdString (name, fileList) { return ` - + diff --git a/ios/browser/api/history/brave_history_api.mm b/ios/browser/api/history/brave_history_api.mm index a2079deb2c64..558ec7372167 100644 --- a/ios/browser/api/history/brave_history_api.mm +++ b/ios/browser/api/history/brave_history_api.mm @@ -244,9 +244,7 @@ - (void)removeHistoryForNodes:(NSArray*)nodes { for (IOSHistoryNode* history in nodes) { history::BrowsingHistoryService::HistoryEntry entry; entry.url = net::GURLWithNSURL(history.url); - entry.all_timestamps.insert(base::Time::FromNSDate(history.dateAdded) - .ToDeltaSinceWindowsEpoch() - .InMicroseconds()); + entry.all_timestamps.insert(base::Time::FromNSDate(history.dateAdded)); entries.push_back(entry); } _browsingHistoryService->RemoveVisits(entries); diff --git a/ios/browser/api/omnibox/autocomplete_classifier.h b/ios/browser/api/omnibox/autocomplete_classifier.h index 8d8dfe31d82f..b40bdeb935b2 100644 --- a/ios/browser/api/omnibox/autocomplete_classifier.h +++ b/ios/browser/api/omnibox/autocomplete_classifier.h @@ -17,8 +17,6 @@ typedef NS_ENUM(NSUInteger, BraveIOSAutocompleteMatchType) { BraveIOSAutocompleteMatchTypeUrlWhatYouTyped = 0, // The input as a URL. BraveIOSAutocompleteMatchTypeHistoryUrl = 1, // A past page whose URL contains the input. - BraveIOSAutocompleteMatchTypeHistoryKeyword = - 4, // A past page whose keyword contains the input. BraveIOSAutocompleteMatchTypeNavSuggest = 5, // A suggested URL. BraveIOSAutocompleteMatchTypeSearchWhatYouTyped = 6, // The input as a search query (with the default engine). diff --git a/ios/browser/api/omnibox/autocomplete_classifier.mm b/ios/browser/api/omnibox/autocomplete_classifier.mm index bcce1dd4cdec..ab13fddd22dd 100644 --- a/ios/browser/api/omnibox/autocomplete_classifier.mm +++ b/ios/browser/api/omnibox/autocomplete_classifier.mm @@ -25,8 +25,6 @@ return AutocompleteMatch::Type::URL_WHAT_YOU_TYPED; case BraveIOSAutocompleteMatchTypeHistoryUrl: return AutocompleteMatch::Type::HISTORY_URL; - case BraveIOSAutocompleteMatchTypeHistoryKeyword: - return AutocompleteMatch::Type::HISTORY_KEYWORD; case BraveIOSAutocompleteMatchTypeNavSuggest: return AutocompleteMatch::Type::NAVSUGGEST; case BraveIOSAutocompleteMatchTypeSearchWhatYouTyped: @@ -44,7 +42,7 @@ case BraveIOSAutocompleteMatchTypeOpenTab: return AutocompleteMatch::Type::OPEN_TAB; } - NOTREACHED(); + NOTREACHED() << "Unknown BraveIOSAutocompleteMatchType: " << type; } BraveIOSAutocompleteMatchType BraveTypeFromMatchType( @@ -54,8 +52,6 @@ BraveIOSAutocompleteMatchType BraveTypeFromMatchType( return BraveIOSAutocompleteMatchTypeUrlWhatYouTyped; case AutocompleteMatch::Type::HISTORY_URL: return BraveIOSAutocompleteMatchTypeHistoryUrl; - case AutocompleteMatch::Type::HISTORY_KEYWORD: - return BraveIOSAutocompleteMatchTypeHistoryKeyword; case AutocompleteMatch::Type::NAVSUGGEST: return BraveIOSAutocompleteMatchTypeNavSuggest; case AutocompleteMatch::Type::SEARCH_WHAT_YOU_TYPED: @@ -73,7 +69,7 @@ BraveIOSAutocompleteMatchType BraveTypeFromMatchType( case AutocompleteMatch::Type::OPEN_TAB: return BraveIOSAutocompleteMatchTypeOpenTab; default: - NOTREACHED(); + NOTREACHED() << "Unknown AutocompleteMatch::Type: " << type; } } } // namespace brave diff --git a/ios/browser/flags/about_flags.mm b/ios/browser/flags/about_flags.mm index 858282a040f6..3912dc2caeca 100644 --- a/ios/browser/flags/about_flags.mm +++ b/ios/browser/flags/about_flags.mm @@ -19,8 +19,8 @@ #include "brave/ios/browser/playlist/features.h" #include "brave/ios/browser/ui/browser_menu/features.h" #include "build/build_config.h" -#include "components/flags_ui/feature_entry_macros.h" -#include "components/flags_ui/flags_state.h" +#include "components/webui/flags/feature_entry_macros.h" +#include "components/webui/flags/flags_state.h" #include "net/base/features.h" #define EXPAND_FEATURE_ENTRIES(...) __VA_ARGS__, diff --git a/ios/browser/flags/sources.gni b/ios/browser/flags/sources.gni index 800bf90eb08a..58d356775505 100644 --- a/ios/browser/flags/sources.gni +++ b/ios/browser/flags/sources.gni @@ -17,6 +17,6 @@ brave_flags_deps = [ "//brave/components/skus/common", "//brave/ios/browser/playlist", "//brave/ios/browser/ui/browser_menu:features", - "//components/flags_ui", + "//components/webui/flags", "//net", ] diff --git a/ios/browser/providers/BUILD.gn b/ios/browser/providers/BUILD.gn index 7c4c4ecb4e7a..ac6f183cce38 100644 --- a/ios/browser/providers/BUILD.gn +++ b/ios/browser/providers/BUILD.gn @@ -23,6 +23,7 @@ group("brave_providers") { "//ios/chrome/browser/providers/follow:chromium_follow", "//ios/chrome/browser/providers/font:chromium_font", "//ios/chrome/browser/providers/fullscreen:chromium_fullscreen", + "//ios/chrome/browser/providers/google_one:chromium_google_one", "//ios/chrome/browser/providers/keyboard:chromium_keyboard", "//ios/chrome/browser/providers/lens:chromium_lens", "//ios/chrome/browser/providers/mailto_handler:chromium_mailto_handler", diff --git a/ios/web_view/BUILD.gn b/ios/web_view/BUILD.gn index 06cf2e5d692d..a525786c8ee5 100644 --- a/ios/web_view/BUILD.gn +++ b/ios/web_view/BUILD.gn @@ -28,7 +28,6 @@ source_set("web_view") { "internal/cwv_ssl_status_extras.mm", "internal/cwv_web_view_extras.mm", "internal/cwv_x509_certificate_extras.mm", - "internal/web_view_global_state_util.mm", "public/cwv_ssl_status_extras.h", "public/cwv_web_view_extras.h", "public/cwv_x509_certificate_extras.h", @@ -42,6 +41,7 @@ source_set("web_view") { "//ios/web/web_state", "//ios/web/web_state:web_state_impl_header", "//ios/web/web_state/ui", + "//ios/web_view:web_view", "//ios/web_view:web_view_sources", "//net", "//url", diff --git a/ios/web_view/internal/web_view_global_state_util.mm b/ios/web_view/internal/web_view_global_state_util.mm deleted file mode 100644 index cc7a3db45e87..000000000000 --- a/ios/web_view/internal/web_view_global_state_util.mm +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2024 The Brave Authors. All rights reserved. -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this file, -// You can obtain one at https://mozilla.org/MPL/2.0/. - -#include "ios/web_view/internal/web_view_global_state_util.h" - -namespace ios_web_view { - -void InitializeGlobalState() { - // We already provide global initialization with -[BraveCoreMain init] so this - // is a stub of a required function. - // - // This function when implemented by the main `//ios/web_view` target would - // typically setup the required Chromium web infrastructure required to - // support CWVWebView: `WebMain`, `WebMainDelegate` and `WebClient` - // - // We already set this up in a similar fashion to Chrome iOS however so there - // is no need to do it here. - // - // Note: This method is removed in M135 and replaced with a new type that - // handles things similarily: `CWVGlobalState`. This new type will need a - // chromium_src override to remove said initialization -} - -} // namespace ios_web_view diff --git a/package.json b/package.json index 2e58c1b62cd8..d1be8e8120ef 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "projects": { "chrome": { "dir": "src", - "tag": "134.0.6998.39", + "tag": "135.0.7047.1", "repository": { "url": "https://github.com/brave/chromium" } @@ -230,4 +230,4 @@ "elliptic": "6.6.1", "esbuild": "0.25.0" } -} +} \ No newline at end of file diff --git a/patches/base-BUILD.gn.patch b/patches/base-BUILD.gn.patch index 74964e00d9c3..7d1374c853ed 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 854457658bbdc09f21f61eb76928dfd423e1eedd..4d886fcd3339c23112565535f66bd56a61b04e98 100644 +index da6b76717d7b7b7b0d13f89f1785281dd4d915a6..2883a9888e33f7e09c2351a0df9b79b573ec9541 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -4482,6 +4482,7 @@ if (is_android) { +@@ -4495,6 +4495,7 @@ if (is_android) { "android/java/src/org/chromium/base/ValueChangedCallback.java", "android/java/src/org/chromium/base/WrappedClassLoader.java", ] @@ -10,7 +10,7 @@ index 854457658bbdc09f21f61eb76928dfd423e1eedd..4d886fcd3339c23112565535f66bd56a if (use_clang_profiling) { sources += [ -@@ -4953,6 +4954,7 @@ if (is_android) { +@@ -5027,6 +5028,7 @@ if (is_android) { "android/java/src/org/chromium/base/shared_preferences/SharedPreferencesManager.java", "android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java", ] diff --git a/patches/base-json-json_reader.cc.patch b/patches/base-json-json_reader.cc.patch deleted file mode 100644 index 3302fcff149d..000000000000 --- a/patches/base-json-json_reader.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc -index af1d4f46d02c97b46352cdaa4834732ce645e145..32d8707d3ad5d55e5479ab87352edcd911770e21 100644 ---- a/base/json/json_reader.cc -+++ b/base/json/json_reader.cc -@@ -164,6 +164,17 @@ std::optional JSONReader::ReadDict(std::string_view json, - return std::move(*value).TakeDict(); - } - -+// static -+std::optional JSONReader::ReadList(std::string_view json, -+ int options, -+ size_t max_depth) { -+ std::optional value = Read(json, options, max_depth); -+ if (!value || !value->is_list()) { -+ return std::nullopt; -+ } -+ return std::move(*value).TakeList(); -+} -+ - // static - JSONReader::Result JSONReader::ReadAndReturnValueWithError( - std::string_view json, diff --git a/patches/base-json-json_reader.h.patch b/patches/base-json-json_reader.h.patch deleted file mode 100644 index 5e134f21edd3..000000000000 --- a/patches/base-json-json_reader.h.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/base/json/json_reader.h b/base/json/json_reader.h -index b0b6f1949471a8ec7f86777d5b3fbdcb8e323de1..469546e8fcb2f0b60e7a3a36b09aab4cfa02b062 100644 ---- a/base/json/json_reader.h -+++ b/base/json/json_reader.h -@@ -123,6 +123,13 @@ class BASE_EXPORT JSONReader { - int options = JSON_PARSE_CHROMIUM_EXTENSIONS, - size_t max_depth = internal::kAbsoluteMaxDepth); - -+ // Reads and parses |json|, returning a Value::List. -+ // If |json| is not a properly formed JSON list string, returns std::nullopt. -+ static std::optional ReadList( -+ std::string_view json, -+ int options = JSON_PARSE_CHROMIUM_EXTENSIONS, -+ size_t max_depth = internal::kAbsoluteMaxDepth); -+ - // Reads and parses |json| like Read(). On success returns a Value as the - // expected value. Otherwise, it returns an Error instance, populated with a - // formatted error message, an error code, and the error location if diff --git a/patches/base-metrics-histogram_functions.h.patch b/patches/base-metrics-histogram_functions.h.patch index 299a15da3eb7..9a7bae6f4187 100644 --- a/patches/base-metrics-histogram_functions.h.patch +++ b/patches/base-metrics-histogram_functions.h.patch @@ -1,5 +1,5 @@ diff --git a/base/metrics/histogram_functions.h b/base/metrics/histogram_functions.h -index 9baec5417d6a097fb1d596b5c63a06bbf6cabf26..3f6577709bbede7b012b52b5247b5fd36a7f7109 100644 +index 20ca685ec430c00760a72da425a3c32ece12b28c..dfea10f252e9a2413ff60cf18d7e911ae60cdb00 100644 --- a/base/metrics/histogram_functions.h +++ b/base/metrics/histogram_functions.h @@ -80,6 +80,7 @@ void UmaHistogramEnumeration(std::string_view name, T sample) { diff --git a/patches/base-test-BUILD.gn.patch b/patches/base-test-BUILD.gn.patch index 4729da872393..261657479e7f 100644 --- a/patches/base-test-BUILD.gn.patch +++ b/patches/base-test-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn -index 37a7e20c415f7db3bee798e0f925c6a3edcf7f32..cc805a8cff290539625f27334040359d4457af9d 100644 +index 82fab133d08d67d9b7829f16605ac76413bcf1fd..9838e1538378c62d45ffc3fbd1c71ab2b522cd30 100644 --- a/base/test/BUILD.gn +++ b/base/test/BUILD.gn -@@ -357,6 +357,7 @@ static_library("test_support") { +@@ -355,6 +355,7 @@ static_library("test_support") { "trace_to_file.h", ] } diff --git a/patches/base-test-launcher-test_results_tracker.cc.patch b/patches/base-test-launcher-test_results_tracker.cc.patch index bdd6145c97be..0aa8d1640808 100644 --- a/patches/base-test-launcher-test_results_tracker.cc.patch +++ b/patches/base-test-launcher-test_results_tracker.cc.patch @@ -1,5 +1,5 @@ diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc -index 9b9e170d73ae7a085cbf44a84c45b09ae3b33e18..9788dd691131b2f76849407f0b993ad6251dcc75 100644 +index 1bf546b57fa37089d91a32fe32456a63aa22c748..f0f1a8f58be6296fc3ecca10e3c41ae522ccd65f 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc @@ -152,6 +152,7 @@ TestResultsTracker::~TestResultsTracker() { diff --git a/patches/base-test-values_test_util.cc.patch b/patches/base-test-values_test_util.cc.patch deleted file mode 100644 index 0cf4f899a26e..000000000000 --- a/patches/base-test-values_test_util.cc.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/base/test/values_test_util.cc b/base/test/values_test_util.cc -index a37b90d42083058013a38cbb7c62c408cfce8d37..45c27c59522dfa3ad7407c628f6dc2c6b0026a41 100644 ---- a/base/test/values_test_util.cc -+++ b/base/test/values_test_util.cc -@@ -168,9 +168,9 @@ class DictionaryHasValuesMatcher - // provided, treats `json` parsing as a Value of a different type as a failure. - // - std::optional ParseJsonHelper(std::string_view json, -- std::optional expected_type) { -- auto result = JSONReader::ReadAndReturnValueWithError( -- json, JSON_PARSE_CHROMIUM_EXTENSIONS | JSON_ALLOW_TRAILING_COMMAS); -+ std::optional expected_type, -+ int options) { -+ auto result = JSONReader::ReadAndReturnValueWithError(json, options); - if (!result.has_value()) { - ADD_FAILURE() << "Failed to parse \"" << json - << "\": " << result.error().message; -@@ -259,21 +259,21 @@ void IsJsonMatcher::DescribeNegationTo(std::ostream* os) const { - *os << "is not the JSON value " << expected_value_; - } - --Value ParseJson(std::string_view json) { -+Value ParseJson(std::string_view json, int options) { - std::optional result = -- ParseJsonHelper(json, /*expected_type=*/std::nullopt); -+ ParseJsonHelper(json, /*expected_type=*/std::nullopt, options); - return result.has_value() ? std::move(*result) : Value(); - } - --Value::Dict ParseJsonDict(std::string_view json) { -+Value::Dict ParseJsonDict(std::string_view json, int options) { - std::optional result = -- ParseJsonHelper(json, /*expected_type=*/Value::Type::DICT); -+ ParseJsonHelper(json, /*expected_type=*/Value::Type::DICT, options); - return result.has_value() ? std::move(*result).TakeDict() : Value::Dict(); - } - --Value::List ParseJsonList(std::string_view json) { -+Value::List ParseJsonList(std::string_view json, int options) { - std::optional result = -- ParseJsonHelper(json, /*expected_type=*/Value::Type::LIST); -+ ParseJsonHelper(json, /*expected_type=*/Value::Type::LIST, options); - return result.has_value() ? std::move(*result).TakeList() : Value::List(); - } - diff --git a/patches/base-test-values_test_util.h.patch b/patches/base-test-values_test_util.h.patch deleted file mode 100644 index 55fd1a460880..000000000000 --- a/patches/base-test-values_test_util.h.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/base/test/values_test_util.h b/base/test/values_test_util.h -index 692f673b7dab3e263dd4e339bc8eb5a84f00375f..fa86904e8a0ec5c4b509323d829d84e34944755b 100644 ---- a/base/test/values_test_util.h -+++ b/base/test/values_test_util.h -@@ -11,6 +11,7 @@ - #include - - #include "base/files/file_path.h" -+#include "base/json/json_reader.h" - #include "base/types/expected.h" - #include "base/values.h" - #include "testing/gmock/include/gmock/gmock-matchers.h" -@@ -44,6 +45,16 @@ void ExpectStringValue(const std::string& expected_str, const Value& actual); - - namespace test { - -+namespace internal { -+ -+// Default parsing options for the json util functions. By default, the content -+// will be parsed with the default set of Chromium-specific behaviours -+// implemented in `JSONReader`, and additionally allowing trailing commas. -+inline constexpr int kDefaultJsonParseOptions = -+ JSON_PARSE_CHROMIUM_EXTENSIONS | JSON_ALLOW_TRAILING_COMMAS; -+ -+} // namespace internal -+ - // A custom GMock matcher which matches if a base::Value::Dict has a key |key| - // that is equal to |value|. - testing::Matcher DictionaryHasValue( -@@ -97,16 +108,19 @@ inline testing::PolymorphicMatcher IsJson(const T& value) { - return testing::MakePolymorphicMatcher(IsJsonMatcher(value)); - } - --// Parses `json` as JSON, allowing trailing commas, and returns the resulting --// value. If `json` fails to parse, causes an EXPECT failure and returns the --// Null Value. --Value ParseJson(std::string_view json); -+// Parses `json` as JSON, using the provided `options`, and returns the -+// resulting value. If `json` fails to parse, causes an EXPECT failure and -+// returns the Null Value. -+Value ParseJson(std::string_view json, -+ int options = internal::kDefaultJsonParseOptions); - - // Just like ParseJson(), except returns Dicts/Lists. If `json` fails to parse - // or is not of the expected type, causes an EXPECT failure and returns an empty - // container. --Value::Dict ParseJsonDict(std::string_view json); --Value::List ParseJsonList(std::string_view json); -+Value::Dict ParseJsonDict(std::string_view json, -+ int options = internal::kDefaultJsonParseOptions); -+Value::List ParseJsonList(std::string_view json, -+ int options = internal::kDefaultJsonParseOptions); - - // Similar to `ParseJsonDict`, however it loads its contents from a file. - // Returns the parsed `Value::Dict` when successful. Otherwise, it causes an diff --git a/patches/base-threading-thread_restrictions.h.patch b/patches/base-threading-thread_restrictions.h.patch index 32450a93e6d7..76c638f049d1 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 ab355bfa81e995e31aa0decf68e1275c9bd69657..db17daffb0ee4930cab043152b2960757850b1a6 100644 +index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..265bbde9b3514c209ea50e9cb6eb84ab11a7f4e5 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h -@@ -732,6 +732,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives { +@@ -728,6 +728,7 @@ class BASE_EXPORT 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 0d97ce3f3cd0..7057cdb09b72 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 397fd890b7db6aed6f75ee3d685fe4b7c22e875f..d5df6689fc7ae7ed59ada8670731cf29b44942b8 100644 +index c428a5f8d79e826077ab05fb6c56ae8e0e4ff609..c9dcb476ffce5d6b41f71b1422c68c1bcbeba822 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h -@@ -208,6 +208,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS( +@@ -207,6 +207,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS( perfetto::Category("webrtc"), perfetto::Category("webrtc_stats"), perfetto::Category("xr"), diff --git a/patches/base-version_info-BUILD.gn.patch b/patches/base-version_info-BUILD.gn.patch index 8bfe8d056805..c684692680ee 100644 --- a/patches/base-version_info-BUILD.gn.patch +++ b/patches/base-version_info-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/base/version_info/BUILD.gn b/base/version_info/BUILD.gn -index fea0d0e00d8a63a1eca8f51b5041caa887e852ac..29ccc0ada686eaa097cfcef4d4f6a94301dede50 100644 +index b1f13fa6e555a874d1f96eacefcd5a8401739c75..aa0a9cd343d9ba3134e3673f295a2c73c7104474 100644 --- a/base/version_info/BUILD.gn +++ b/base/version_info/BUILD.gn -@@ -24,6 +24,7 @@ static_library("version_info") { +@@ -23,6 +23,7 @@ static_library("version_info") { ":generate_version_info", "//base", ] diff --git a/patches/build-android-gyp-create_app_bundle.py.patch b/patches/build-android-gyp-create_app_bundle.py.patch index c05bebb81051..a2ef3073be8e 100644 --- a/patches/build-android-gyp-create_app_bundle.py.patch +++ b/patches/build-android-gyp-create_app_bundle.py.patch @@ -1,8 +1,8 @@ diff --git a/build/android/gyp/create_app_bundle.py b/build/android/gyp/create_app_bundle.py -index 279898876b70c759dcfd1762a6ac36eee2559caf..7c2a51bbc051dafd81334474e4f54dfa7abc2276 100755 +index 43efec3ce978c0c425d6da169ef2e7ae47e04bb3..59b42cdace895df93d90f8ad3400d2fd1b30098d 100755 --- a/build/android/gyp/create_app_bundle.py +++ b/build/android/gyp/create_app_bundle.py -@@ -80,6 +80,7 @@ _ALLOWLISTED_NON_BASE_SERVICES = { +@@ -79,6 +79,7 @@ _ALLOWLISTED_NON_BASE_SERVICES = { 'com.google.apps.tiktok.concurrent.InternalForegroundService', } diff --git a/patches/build-android-gyp-proguard.py.patch b/patches/build-android-gyp-proguard.py.patch index e1ffa55e4503..9c5b7a7cea7b 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 ff2df0113967324f05797c05fe4f1f9a9f087a5c..5cc8745e35e27431ebc99bf72b53ac59c0a93ca7 100755 +index 2e562de665f81b986a19b540e1b13090b32594e0..7d5d73a78a6e884f162317e327653d7132a392f0 100755 --- a/build/android/gyp/proguard.py +++ b/build/android/gyp/proguard.py -@@ -381,6 +381,7 @@ def _OptimizeWithR8(options, config_paths, libraries, dynamic_config_data): +@@ -374,6 +374,7 @@ def _OptimizeWithR8(options, config_paths, libraries, dynamic_config_data): '--pg-map-output', tmp_mapping_path, ] diff --git a/patches/build-config-BUILDCONFIG.gn.patch b/patches/build-config-BUILDCONFIG.gn.patch index 5cec95b40278..51b8bc832199 100644 --- a/patches/build-config-BUILDCONFIG.gn.patch +++ b/patches/build-config-BUILDCONFIG.gn.patch @@ -1,5 +1,5 @@ diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index c01896919e5a4549bd5e1d2d8d54f69fcb2b8aa6..0a85381cd077fc8e3f1015498d00f9d2e88ca11d 100644 +index 632de02789948ae581e57359e1bc303b2106bf46..87b1265814a91f72494c04d847a3b4c2acbe2b23 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -340,6 +340,7 @@ is_posix = !is_win && !is_fuchsia diff --git a/patches/build-config-android-config.gni.patch b/patches/build-config-android-config.gni.patch index e34b2071c498..344e3c9420f3 100644 --- a/patches/build-config-android-config.gni.patch +++ b/patches/build-config-android-config.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/config.gni b/build/config/android/config.gni -index 5480b31d91ce585458596bab6031fbaac9228b90..8a225378df67f85067b7c31a54c90921372c9a48 100644 +index 13bf3e43a5fdcdd001b7aa9113732e9a9209ac76..f7089c4f1f993938f5bdb4ce6439b7ea65e5f40f 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -29,6 +29,7 @@ assert(!(incremental_install && !is_java_debug), diff --git a/patches/build-config-android-internal_rules.gni.patch b/patches/build-config-android-internal_rules.gni.patch index d4e062d2299f..d3c4752afa27 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 04dc65115fb7f677bfa36087c1f08c96e44b95b2..cff2b1bae98ec7c39e87399f70400e6f80a523bc 100644 +index 2585163776efcd3bb3b173d7430d74dd889357bf..3fd7eb12f69d334d3e63ca1606f29a1ed0d379d8 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni -@@ -4219,6 +4219,7 @@ if (enable_java_templates) { +@@ -4231,6 +4231,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 9066c7a4d4b4..5b0c3960a9a8 100644 --- a/patches/build-config-android-rules.gni.patch +++ b/patches/build-config-android-rules.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni -index be82605fa87067e865bdb82e81a4898916766620..2f4cd137bc23882bf5d60056366e8b2dfaf9d6b5 100644 +index fbb3ba1e994e45aa5890c61c8582f4ead95f8e09..67fd52e54887d66002a4ddbf17156bd72c3edbaa 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -208,6 +208,7 @@ if (!is_robolectric && enable_java_templates) { diff --git a/patches/build-dotfile_settings.gni.patch b/patches/build-dotfile_settings.gni.patch index 8833358453ec..24760d375fbf 100644 --- a/patches/build-dotfile_settings.gni.patch +++ b/patches/build-dotfile_settings.gni.patch @@ -1,8 +1,8 @@ diff --git a/build/dotfile_settings.gni b/build/dotfile_settings.gni -index 29e01306126b6635297457e4452f090f0f519964..95a6c891abdfcb73ea91c5fb17e3acb1e8862f3a 100644 +index b2c1bc1f18b1ff70096861e6d0b1e653c532e70b..acdf9028dcc6c35f0036a86b7aacfd979209ec46 100644 --- a/build/dotfile_settings.gni +++ b/build/dotfile_settings.gni -@@ -47,3 +47,4 @@ build_dotfile_settings = { +@@ -45,3 +45,4 @@ build_dotfile_settings = { # so that we don't need to keep supporting `exec_script_whitelist`. exec_script_whitelist = exec_script_allowlist } diff --git a/patches/build-util-action_remote.py.patch b/patches/build-util-action_remote.py.patch deleted file mode 100644 index 19f4461fc6db..000000000000 --- a/patches/build-util-action_remote.py.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/build/util/action_remote.py b/build/util/action_remote.py -index 040d5118ffe822f265e3c9ce13896682302c96ee..e7bd51a3c415c2f6015835d8ed8ef0a77bfaa28d 100755 ---- a/build/util/action_remote.py -+++ b/build/util/action_remote.py -@@ -99,6 +99,7 @@ def _get_mojom_parser_inputs(exec_root, output_files, extra_args): - processed_inputs) - - -+from brave_chromium_utils import inline_chromium_src_override; inline_chromium_src_override(globals(), locals()) - def main(): - # Set up argparser with some rewrapper flags. - argparser = argparse.ArgumentParser(description='rewrapper executor for gn', diff --git a/patches/buildtools-checkdeps-checkdeps.py.patch b/patches/buildtools-checkdeps-checkdeps.py.patch index 382844163ebb..5a0f88af28db 100644 --- a/patches/buildtools-checkdeps-checkdeps.py.patch +++ b/patches/buildtools-checkdeps-checkdeps.py.patch @@ -1,5 +1,5 @@ diff --git a/buildtools/checkdeps/checkdeps.py b/buildtools/checkdeps/checkdeps.py -index 19e0854786de291fd9c94ac64dbbe181faee6180..55e02d2aee620da2312c0d41e5965ea828fc471b 100755 +index 00e5da345c451a66c33fabd206b91093b01e6351..121bcb8849264e00650d6ac421fddac383654687 100755 --- a/buildtools/checkdeps/checkdeps.py +++ b/buildtools/checkdeps/checkdeps.py @@ -290,5 +290,6 @@ def main(): diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 8e9e67233674..290b0f846943 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 9bb34fe40f0cc08cb832ee6728ac8e32458c969b..d9996a8931038ceebb89b77db255f675f286c6cf 100644 +index 7bad6d2fe242bc71014d3fbd6be4481280297366..e3667c7cadd76e63e9b05e7ea89fac9e726470f4 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -195,6 +195,7 @@ if (!is_android && !is_mac) { diff --git a/patches/chrome-android-BUILD.gn.patch b/patches/chrome-android-BUILD.gn.patch index 74828daabf4b..ec8333aeb859 100644 --- a/patches/chrome-android-BUILD.gn.patch +++ b/patches/chrome-android-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb1828c153 100644 +index cd1f242c915a4dca7b547f8261eac658bfe5707f..d510fd20d8b9e9324e735742b2fa8b2e24155d66 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -189,6 +189,7 @@ if (current_toolchain == default_toolchain) { +@@ -187,6 +187,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", ] @@ -10,7 +10,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb } android_resources("chrome_app_java_resources") { -@@ -286,6 +287,7 @@ if (current_toolchain == default_toolchain) { +@@ -284,6 +285,7 @@ if (current_toolchain == default_toolchain) { if (enable_screen_capture) { deps += [ "//chrome/browser:screen_capture_java_resources" ] } @@ -18,7 +18,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb } android_resources("java_overlay_resources") { -@@ -766,6 +768,7 @@ if (current_toolchain == default_toolchain) { +@@ -767,6 +769,7 @@ if (current_toolchain == default_toolchain) { ] deps += feed_deps @@ -26,7 +26,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb srcjar_deps = [ ":chrome_android_java_enums_srcjar", -@@ -782,6 +785,7 @@ if (current_toolchain == default_toolchain) { +@@ -783,6 +786,7 @@ if (current_toolchain == default_toolchain) { "//components/sharing_message:sharing_send_message_result_generated_enum", "//components/supervised_user/core/browser:supervised_user_utils_enum_javagen", ] @@ -34,7 +34,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb # From java_sources.gni. sources = chrome_java_sources -@@ -904,6 +908,7 @@ if (current_toolchain == default_toolchain) { +@@ -909,6 +913,7 @@ if (current_toolchain == default_toolchain) { "//components/saved_tab_groups/public:conversion_utils_java", "//components/segmentation_platform/internal:internal_java", ] @@ -42,7 +42,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb } action_with_pydeps("chrome_android_java_google_api_keys_srcjar") { -@@ -1591,6 +1596,7 @@ if (current_toolchain == default_toolchain) { +@@ -1603,6 +1608,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,7 +50,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb # Dep needed to ensure override works properly. deps = [ ":chrome_base_module_resources" ] -@@ -1803,6 +1809,7 @@ if (current_toolchain == default_toolchain) { +@@ -1815,6 +1821,7 @@ if (current_toolchain == default_toolchain) { ":${_variant}_locale_pak_assets", ":${_variant}_paks", ] @@ -58,7 +58,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb if (_is_monochrome) { deps += [ "//android_webview:locale_pak_assets" ] } -@@ -2081,6 +2088,7 @@ if (current_toolchain == default_toolchain) { +@@ -2095,6 +2102,7 @@ if (current_toolchain == default_toolchain) { "//third_party/androidx:androidx_annotation_annotation_experimental_java", "//third_party/androidx:androidx_browser_browser_java", ] @@ -66,7 +66,7 @@ index 9cd6abf563e8b515f80abbe71267b0654e527db4..3e19087e7209f09172367f240a6976bb # More deps for DFMs. if (dfmify_dev_ui) { -@@ -3180,6 +3188,7 @@ generate_jni("chrome_jni_headers") { +@@ -3207,6 +3215,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 905a03614cc9..e1411efb2bef 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 64ed77fb95b4c9cb92b22436c217ac9775bb757f..4c749d57ff94cfcf03a76bb1d65c9215e9870578 100644 +index 2025e554a74d02fc638b7ec4d47db0b201c0ea9a..6673659cdae28234944405f6885869378ccbff6a 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -1238,3 +1238,4 @@ if (enable_screen_capture) { +@@ -1169,3 +1169,4 @@ if (enable_screen_capture) { "java/src/org/chromium/chrome/browser/media/MediaCapturePickerItemViewBinder.java", ] } diff --git a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch index 2e7dfe91d77f..3456332183db 100644 --- a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch +++ b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni -index b1ab5a7b2a4522ece9a277673ae95430afc4f3a6..e7071b6e2fda8ea91f56b79b0d37d1768c94d5e2 100644 +index 44d95c96a3deaf5f15871bb5e105616afd426699..86172e5d13929dd040c0ccc83b7f5c3912eb308b 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni @@ -319,6 +319,7 @@ template("chrome_common_apk_or_module_tmpl") { diff --git a/patches/chrome-android-features-tab_ui-BUILD.gn.patch b/patches/chrome-android-features-tab_ui-BUILD.gn.patch index b4375ba734cc..48acc8c82f7a 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 bfeb16019ca06f2cd603a68a550728abd601ed23..fd7e7c7195495f29dfdba1408198b7c2d6fec462 100644 +index 0154319845b0720f9d3f017e4f1375a2e0063972..62ae01d96deb9bd8695c7ea0760ac9a74f4b4148 100644 --- a/chrome/android/features/tab_ui/BUILD.gn +++ b/chrome/android/features/tab_ui/BUILD.gn -@@ -119,6 +119,7 @@ android_resources("java_resources") { +@@ -121,6 +121,7 @@ android_resources("java_resources") { "java/res/xml/tab_archive_time_delta_preference.xml", "java/res/xml/tabs_settings.xml", ] diff --git a/patches/chrome-android-feed-core-java-src-org-chromium-chrome-browser-feed-FeedSurfaceMediator.java.patch b/patches/chrome-android-feed-core-java-src-org-chromium-chrome-browser-feed-FeedSurfaceMediator.java.patch index ae9c2adab16d..e2a846643256 100644 --- a/patches/chrome-android-feed-core-java-src-org-chromium-chrome-browser-feed-FeedSurfaceMediator.java.patch +++ b/patches/chrome-android-feed-core-java-src-org-chromium-chrome-browser-feed-FeedSurfaceMediator.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java -index f13f117522639750b3d1f979bd7020900c90ba6e..010ae0911b8a7b8982a877ce83d5f29f0816c1f8 100644 +index 935df752479098ff882afaf46043f96bd532e175..6b654aea1a5a80dee7a721bed6e1f5dbac6c2b07 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java @@ -372,7 +372,7 @@ public class FeedSurfaceMediator diff --git a/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch b/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch index 7a76362257c6..22f62dcea083 100644 --- a/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch +++ b/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch @@ -1,10 +1,10 @@ diff --git a/chrome/android/java/res/layout/custom_tabs_toolbar.xml b/chrome/android/java/res/layout/custom_tabs_toolbar.xml -index 517017eb89801f7c17e4fc53fdb7b9b97654c6e3..b59b984d7a677233a45dca3c7db5f8d65ff74f7b 100644 +index 9f991b6b098fc04faf1c1af561c418e8fda5b39a..824ec7987acb8011b10c06be4b803dad544512fb 100644 --- a/chrome/android/java/res/layout/custom_tabs_toolbar.xml +++ b/chrome/android/java/res/layout/custom_tabs_toolbar.xml -@@ -139,7 +139,7 @@ found in the LICENSE file. - android:gravity="center_vertical" - android:orientation="horizontal" /> +@@ -147,7 +147,7 @@ found in the LICENSE file. + style="@style/ToolbarHoverableButton" /> + - + diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-SwipeRefreshHandler.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-SwipeRefreshHandler.java.patch index 7f286002faf9..adb826d7e557 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-SwipeRefreshHandler.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-SwipeRefreshHandler.java.patch @@ -1,13 +1,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java -index 04b773ec01e971282222c98c45f82f1a42f2a001..9f453746a337e46f4f589326b9455185a1ddfb1b 100644 +index 7cc13873ebd20d1ed7b7346358ac35f4487993ba..be4f000d6480581396ee6f80465b452b96a0a951 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java -@@ -140,7 +140,7 @@ public class SwipeRefreshHandler extends TabWebContentsUserData - * +@@ -170,7 +170,7 @@ public class SwipeRefreshHandler extends TabWebContentsUserData * @param tab The Tab where the swipe occurs. + * @param swipeRefreshLayoutCreator Creates {@link SwipeRefreshLayout}. */ -- private SwipeRefreshHandler(Tab tab) { -+ public SwipeRefreshHandler(Tab tab) { +- private SwipeRefreshHandler( ++ public SwipeRefreshHandler( + Tab tab, @NonNull SwipeRefreshLayoutCreator swipeRefreshLayoutCreator) { super(tab); mTab = tab; - mTabObserver = diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkManagerOpenerImpl.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkManagerOpenerImpl.java.patch new file mode 100644 index 000000000000..a2af538149b6 --- /dev/null +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkManagerOpenerImpl.java.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerOpenerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerOpenerImpl.java +index bf6d5afbc892c7c78e57c8a712f8cb4255fdb9bd..a1227424592a097a7d68c1a6911f98d474277e5e 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerOpenerImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerOpenerImpl.java +@@ -66,7 +66,7 @@ public class BookmarkManagerOpenerImpl implements BookmarkManagerOpener { + Intent intent = + new Intent( + activity == null ? ContextUtils.getApplicationContext() : activity, +- BookmarkActivity.class); ++ org.chromium.chrome.browser.app.bookmarks.BraveBookmarkActivity.class); + ProfileIntentUtils.addProfileToIntent(profile, intent); + intent.setData(Uri.parse(url)); + if (activity != null) { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-contextmenu-ChromeContextMenuPopulator.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-contextmenu-ChromeContextMenuPopulator.java.patch index 273d5f4797af..1607f056a15f 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-contextmenu-ChromeContextMenuPopulator.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-contextmenu-ChromeContextMenuPopulator.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java -index 86d47316899b1872d4d6751f5154f3d6f469e25f..9d57752110c2d69538550c05e856054821ed9120 100644 +index 64694353ca0095c099e5941fa02098cbc7a7f84e..badd4f0ac06d16889e010cc17b9e4180cf952f64 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java -@@ -172,7 +172,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -171,7 +171,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { Action.SHARE_HIGHLIGHT, Action.REMOVE_HIGHLIGHT, Action.LEARN_MORE, @@ -11,7 +11,7 @@ index 86d47316899b1872d4d6751f5154f3d6f469e25f..9d57752110c2d69538550c05e8560548 }) @Retention(RetentionPolicy.SOURCE) public @interface Action { -@@ -217,7 +217,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -216,7 +216,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { int LEARN_MORE = 38; int OPEN_IN_NEW_TAB_IN_GROUP = 39; int OPEN_IN_NEW_WINDOW = 40; @@ -20,7 +20,7 @@ index 86d47316899b1872d4d6751f5154f3d6f469e25f..9d57752110c2d69538550c05e8560548 } } -@@ -374,6 +374,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -312,6 +312,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { if (!MailTo.isMailTo(mParams.getLinkUrl().getSpec()) && !UrlUtilities.isTelScheme(mParams.getLinkUrl())) { linkGroup.add(createListItem(Item.COPY_LINK_ADDRESS)); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch index e3e74dece04c..85345a6a7ddb 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java -index c9979ab733723c80f617f34852c1bf7fbbe2732c..cda93fa3fffc766a729c7ccdd5666fa7afdd05e9 100644 +index de78a81263c4564b5371c668f10f695cbec8cce9..5da176ba9d07805fc88193c5083b7265a957bc1c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java @@ -65,7 +65,7 @@ import org.chromium.chrome.browser.ui.signin.SigninUtils; diff --git a/patches/chrome-browser-BUILD.gn.patch b/patches/chrome-browser-BUILD.gn.patch index b398ed49b409..d28e9ff787dc 100644 --- a/patches/chrome-browser-BUILD.gn.patch +++ b/patches/chrome-browser-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index ab4deb1a228f512166251cce44aac7138e53c1f8..650636a69ae45b6515d5fb287335b4fe3fd4e066 100644 +index 3740daf52f9067bcfb0a17602ff67b65e3a221a5..c8d51455f5feeddf9c9346f8ef3769b03205ec49 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -2529,6 +2529,7 @@ static_library("browser") { +@@ -2551,6 +2551,7 @@ static_library("browser") { } else { sources += [ "net/net_error_diagnostics_dialog_stub.cc" ] } @@ -10,7 +10,7 @@ index ab4deb1a228f512166251cce44aac7138e53c1f8..650636a69ae45b6515d5fb287335b4fe if (is_android) { sources += [ -@@ -8373,6 +8374,7 @@ static_library("browser_public_dependencies") { +@@ -8406,6 +8407,7 @@ static_library("browser_public_dependencies") { "//rlz:rlz_lib", ] } diff --git a/patches/chrome-browser-about_flags.cc.patch b/patches/chrome-browser-about_flags.cc.patch index da1b7626bbd5..e49af9fe27a5 100644 --- a/patches/chrome-browser-about_flags.cc.patch +++ b/patches/chrome-browser-about_flags.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 71b8c74866b4fd842a440dccca36c3f087e1c322..9c48c0b452ee1b89d64d33e5c03b5aaab5782149 100644 +index de8e7918a621405f67a3fa1e470089255e0bd494..878061cff161676db4bc5d36b7ce28e2f5a1b399 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -4405,6 +4405,7 @@ const FeatureEntry::FeatureVariation kTabSwitcherColorBlendAnimateVariations[] = +@@ -4375,6 +4375,7 @@ constexpr char kDisableFacilitatedPaymentsMerchantAllowlistInternalName[] = // // When adding a new choice, add it to the end of the list. const FeatureEntry kFeatureEntries[] = { diff --git a/patches/chrome-browser-bookmarks-android-BUILD.gn.patch b/patches/chrome-browser-bookmarks-android-BUILD.gn.patch new file mode 100644 index 000000000000..e5d8623d145f --- /dev/null +++ b/patches/chrome-browser-bookmarks-android-BUILD.gn.patch @@ -0,0 +1,12 @@ +diff --git a/chrome/browser/bookmarks/android/BUILD.gn b/chrome/browser/bookmarks/android/BUILD.gn +index 8e7097e3a8edcf86091c401c02536ba88a749814..f0e18890e73a29f600cc9313060017adbe9e304c 100644 +--- a/chrome/browser/bookmarks/android/BUILD.gn ++++ b/chrome/browser/bookmarks/android/BUILD.gn +@@ -81,6 +81,7 @@ android_library("java") { + "java/src/org/chromium/chrome/browser/bookmarks/bar/BookmarkBarProperties.java", + "java/src/org/chromium/chrome/browser/bookmarks/bar/BookmarkBarViewBinder.java", + ] ++ sources += brave_browser_bookmarks_android_sources + + deps = [ + "//base:base_java", diff --git a/patches/chrome-browser-browser_process_impl.h.patch b/patches/chrome-browser-browser_process_impl.h.patch index baf86a9da669..5d9f35ce649c 100644 --- a/patches/chrome-browser-browser_process_impl.h.patch +++ b/patches/chrome-browser-browser_process_impl.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h -index db887bc023639301e2f939c952544e51ca5eb25a..c0466a8fd4105ad6f90aff8e6aa5b9c02eccedeb 100644 +index c9600922e50e0007c453ba8956916cd9ed60e739..c9182e85bf7a8b7e0e9eb12806c808a7c5c0c0ce 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -246,6 +246,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -243,6 +243,7 @@ class BrowserProcessImpl : public BrowserProcess, void CreateGlobalFeaturesForTesting() override; private: diff --git a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.cc.patch b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.cc.patch index c9a5a91b8a39..9c3e542be6a6 100644 --- a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.cc.patch +++ b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc -index e7f573eff852cdf57dd05ede711ba9ba1b1f11e0..e54ffa5def3a25e2d657bf8c04e311214c3fc1c5 100644 +index 4edb6fb0e562a4567fe442d001fa6d66be381ac4..c7703b9610c9afc6f810ddbcdf01b71e0cacc4be 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc -@@ -1677,6 +1677,7 @@ const char* ChromeBrowsingDataRemoverDelegate::GetHistogramSuffix( +@@ -1685,6 +1685,7 @@ const char* ChromeBrowsingDataRemoverDelegate::GetHistogramSuffix( return "WebrtcVideoPerfHistory"; case TracingDataType::kMediaDeviceSalts: return "MediaDeviceSalts"; diff --git a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch index 264c93983b4a..e87372da5ebe 100644 --- a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch +++ b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h -index 99101411ce40137b106131e12e2f0cd8b16659f3..5e5776c8afed519fe018d75736f03eadcc07068e 100644 +index c8585bdaf839ff156aa2a968f3a3c948550f02f4..f4ac002a55e9364f09ab0dacd82e1f84321392e6 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h -@@ -95,6 +95,7 @@ class ChromeBrowsingDataRemoverDelegate +@@ -94,6 +94,7 @@ class ChromeBrowsingDataRemoverDelegate void OverrideDomainReliabilityClearerForTesting( DomainReliabilityClearer clearer); @@ -10,7 +10,7 @@ index 99101411ce40137b106131e12e2f0cd8b16659f3..5e5776c8afed519fe018d75736f03ead private: using WebRtcEventLogManager = webrtc_event_logging::WebRtcEventLogManager; -@@ -150,8 +151,9 @@ class ChromeBrowsingDataRemoverDelegate +@@ -149,8 +150,9 @@ class ChromeBrowsingDataRemoverDelegate kMediaDeviceSalts = 45, // See also kDisableAutoSigninForProfilePasswords. kDisableAutoSigninForAccountPasswords = 46, diff --git a/patches/chrome-browser-download-background_download_service_factory.cc.patch b/patches/chrome-browser-download-background_download_service_factory.cc.patch deleted file mode 100644 index d6bfd24ee54f..000000000000 --- a/patches/chrome-browser-download-background_download_service_factory.cc.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff --git a/chrome/browser/download/background_download_service_factory.cc b/chrome/browser/download/background_download_service_factory.cc -index 54fbadcbc0d2779bf2317ac4d4dd7dae3835a10d..c4f2ae62b0679cdf8ed072076f33f49c5a068f25 100644 ---- a/chrome/browser/download/background_download_service_factory.cc -+++ b/chrome/browser/download/background_download_service_factory.cc -@@ -20,7 +20,6 @@ - #include "chrome/browser/download/deferred_client_wrapper.h" - #include "chrome/browser/download/download_manager_utils.h" - #include "chrome/browser/download/simple_download_manager_coordinator_factory.h" --#include "chrome/browser/net/system_network_context_manager.h" - #include "chrome/browser/optimization_guide/prediction/prediction_model_download_client.h" - #include "chrome/browser/profiles/incognito_helpers.h" - #include "chrome/browser/profiles/profile.h" -@@ -35,6 +34,7 @@ - #include "components/download/public/background_service/blob_context_getter_factory.h" - #include "components/download/public/background_service/clients.h" - #include "components/download/public/background_service/features.h" -+#include "components/download/public/background_service/url_loader_factory_getter.h" - #include "components/download/public/common/simple_download_manager_coordinator.h" - #include "components/keyed_service/core/simple_dependency_manager.h" - #include "components/leveldb_proto/public/proto_database_provider.h" -@@ -108,6 +108,33 @@ class DownloadBlobContextGetterFactory - raw_ptr key_; - }; - -+void OnProfileCreated(download::URLLoaderFactoryGetterCallback callback, -+ Profile* profile) { -+ DCHECK(callback); -+ std::move(callback).Run(profile->GetURLLoaderFactory()); -+} -+ -+class URLLoaderFactoryGetter : public download::URLLoaderFactoryGetter { -+ public: -+ explicit URLLoaderFactoryGetter(SimpleFactoryKey* key) : key_(key) { -+ DCHECK(key_); -+ } -+ -+ URLLoaderFactoryGetter(const URLLoaderFactoryGetter&) = delete; -+ URLLoaderFactoryGetter& operator=(const URLLoaderFactoryGetter&) = delete; -+ -+ ~URLLoaderFactoryGetter() override = default; -+ -+ private: -+ void RetrieveURLLoaderFactory( -+ download::URLLoaderFactoryGetterCallback callback) override { -+ FullBrowserTransitionManager::Get()->RegisterCallbackOnProfileCreation( -+ key_, base::BindOnce(&OnProfileCreated, std::move(callback))); -+ } -+ -+ raw_ptr key_; -+}; -+ - } // namespace - - // static -@@ -169,13 +196,11 @@ BackgroundDownloadServiceFactory::BuildServiceInstanceFor( - std::make_unique(key); - scoped_refptr io_task_runner = - content::GetIOThreadTaskRunner({}); -- scoped_refptr url_loader_factory = -- SystemNetworkContextManager::GetInstance()->GetSharedURLLoaderFactory(); - - return download::BuildInMemoryDownloadService( - key, std::move(clients), content::GetNetworkConnectionTracker(), - base::FilePath(), std::move(blob_context_getter_factory), -- io_task_runner, url_loader_factory); -+ io_task_runner, std::make_unique<::URLLoaderFactoryGetter>(key)); - } else { - // Build download service for normal profile. - base::FilePath storage_dir; diff --git a/patches/chrome-browser-download-download_item_model.h.patch b/patches/chrome-browser-download-download_item_model.h.patch index f37daff74fd0..213c2029aa03 100644 --- a/patches/chrome-browser-download-download_item_model.h.patch +++ b/patches/chrome-browser-download-download_item_model.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h -index 643c18ab2a26477ac5aedba62112385af9ed9874..815f5585a089e933505ee80006a279395e5ca17b 100644 +index 61cff67a70503be691442433115ce2315bcdb18d..14aadc598b89115bbb2cac24525b18b2c57a201a 100644 --- a/chrome/browser/download/download_item_model.h +++ b/chrome/browser/download/download_item_model.h @@ -151,6 +151,7 @@ class DownloadItemModel : public DownloadUIModel, diff --git a/patches/chrome-browser-download-download_target_determiner.cc.patch b/patches/chrome-browser-download-download_target_determiner.cc.patch index ffa8eb72e762..0d822f1ca066 100644 --- a/patches/chrome-browser-download-download_target_determiner.cc.patch +++ b/patches/chrome-browser-download-download_target_determiner.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc -index 8ac82dc70ee78a7db876ba195efd62532cc81b8a..66d5eaf018dbe02ae7bb2246b6ad4141f4d80895 100644 +index 30f54fd479fa9e6e4be69ce44f37dddfdc86ab52..c2b9f98f7af285e75d4f8683a2c15930e614c73a 100644 --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc -@@ -1316,6 +1316,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( +@@ -1325,6 +1325,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( download_->GetDownloadSource() != download::DownloadSource::DRAG_AND_DROP; if (HasPromptedForPath() || confirmation_reason_ != DownloadConfirmationReason::NONE || @@ -10,11 +10,11 @@ index 8ac82dc70ee78a7db876ba195efd62532cc81b8a..66d5eaf018dbe02ae7bb2246b6ad4141 user_approved_path) { // If the "DownloadRestrictions" enterprise policy explicitly disallows the // download, don't let the user gesture bypass the dangerous verdict. -@@ -1351,6 +1352,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( +@@ -1365,6 +1366,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0 || (download_->HasUserGesture() && visits == VISITED_REFERRER))) return DownloadFileType::NOT_DANGEROUS; + BRAVE_DOWNLOAD_TARGET_DETERMINER_GET_DANGER_LEVEL2 return danger_level; - } - + #else + return DownloadFileType::NOT_DANGEROUS; diff --git a/patches/chrome-browser-extensions-BUILD.gn.patch b/patches/chrome-browser-extensions-BUILD.gn.patch index ad10ed6b7e0f..e1ce5bd0e5a3 100644 --- a/patches/chrome-browser-extensions-BUILD.gn.patch +++ b/patches/chrome-browser-extensions-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn -index d629eae2162b78f22aaa53795efe0d6d54d3d40d..dd63b3ab6627d7ab6b449e783e81c562b35f9270 100644 +index 668e8d6f415a3e17efd4dc7bbf3667d0e2fd2786..f0e41257dee6a0ab776d289d66f6bbad2109a613 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn -@@ -1438,6 +1438,7 @@ source_set("extensions") { +@@ -1476,6 +1476,7 @@ source_set("extensions") { allow_circular_includes_from += [ "//chrome/browser/glic:impl" ] } } # if (enable_extensions) + deps += brave_extensions_resources } - if (enable_extensions) { + if (enable_extensions_core) { diff --git a/patches/chrome-browser-extensions-api-developer_private-extension_info_generator.cc.patch b/patches/chrome-browser-extensions-api-developer_private-extension_info_generator.cc.patch deleted file mode 100644 index d2bd55bb83f8..000000000000 --- a/patches/chrome-browser-extensions-api-developer_private-extension_info_generator.cc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc -index 20e7578e086aabd7c389191e69438f03b7ae3222..a99acbd109733032c0ff12f19481e9051ea01713 100644 ---- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc -+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc -@@ -706,6 +706,7 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper( - info->incognito_access.is_enabled = util::CanBeIncognitoEnabled(&extension); - info->incognito_access.is_active = - util::IsIncognitoEnabled(extension.id(), browser_context_); -+ BRAVE_CREATE_EXTENSION_INFO_HELPER - - // Install warnings, but only if unpacked, the error console isn't enabled - // (otherwise it shows these), and we're in developer mode (normal users don't diff --git a/patches/chrome-browser-extensions-api-developer_private-extension_info_generator_shared.cc.patch b/patches/chrome-browser-extensions-api-developer_private-extension_info_generator_shared.cc.patch new file mode 100644 index 000000000000..3b35087c7d97 --- /dev/null +++ b/patches/chrome-browser-extensions-api-developer_private-extension_info_generator_shared.cc.patch @@ -0,0 +1,12 @@ +diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc +index d174346f293cf51c949e4470556d7314b25c0b7e..1544e3c29415ad68d9a5f877b87ca724de36528e 100644 +--- a/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc ++++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_shared.cc +@@ -583,6 +583,7 @@ void ExtensionInfoGeneratorShared::FillExtensionInfo( + info.incognito_access.is_enabled = util::CanBeIncognitoEnabled(&extension); + info.incognito_access.is_active = + util::IsIncognitoEnabled(extension.id(), browser_context_); ++ BRAVE_CREATE_EXTENSION_INFO_HELPER + + // User Scripts toggle. + info.user_scripts_access.is_enabled = CanRunOrRequestUserScripts(extension); diff --git a/patches/chrome-browser-extensions-api-identity-identity_get_auth_token_function.cc.patch b/patches/chrome-browser-extensions-api-identity-identity_get_auth_token_function.cc.patch index b18ccfc5ad71..22ef1291a1b2 100644 --- a/patches/chrome-browser-extensions-api-identity-identity_get_auth_token_function.cc.patch +++ b/patches/chrome-browser-extensions-api-identity-identity_get_auth_token_function.cc.patch @@ -1,16 +1,16 @@ diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc -index 83b90ffb80436dc0cd08ca27023c131067fc61de..701a5fab72376cef955ddb693d4ebed14f1088d7 100644 +index 13b0f7f7a6a2bc2c3d0d22d9fbfa7894de2a7824..28a66ca131da691f33e88d00afc469aa54db4b17 100644 --- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc +++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc -@@ -189,6 +189,7 @@ ExtensionFunction::ResponseAction IdentityGetAuthTokenFunction::Run() { +@@ -190,6 +190,7 @@ ExtensionFunction::ResponseAction IdentityGetAuthTokenFunction::Run() { // From here on out, results must be returned asynchronously. StartAsyncRun(); + BRAVE_RUN // TODO(crbug.com/40614113): collapse the asynchronicity - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, -@@ -343,12 +344,14 @@ void IdentityGetAuthTokenFunction::StartSigninFlow() { + base::OnceCallback next_step = + base::BindOnce(&IdentityGetAuthTokenFunction::GetAuthTokenForAccount, +@@ -363,12 +364,14 @@ void IdentityGetAuthTokenFunction::StartSigninFlow() { void IdentityGetAuthTokenFunction::StartMintTokenFlow( IdentityMintRequestQueue::MintType type) { #if !BUILDFLAG(IS_CHROMEOS) diff --git a/patches/chrome-browser-extensions-extension_management.cc.patch b/patches/chrome-browser-extensions-extension_management.cc.patch index e4913c97c201..2f29bd7d9fcf 100644 --- a/patches/chrome-browser-extensions-extension_management.cc.patch +++ b/patches/chrome-browser-extensions-extension_management.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc -index c1cb5482f8fe4e8b32d9713620a93a206b655e01..07f07bf31d89c40b8feceaacbabb655fa9cb0276 100644 +index eb2350fca94903c7042fdd7dba141a71522dc24b..b7c55094dc3c847758bb4235af3d0d2011e4c3f1 100644 --- a/chrome/browser/extensions/extension_management.cc +++ b/chrome/browser/extensions/extension_management.cc @@ -1057,6 +1057,7 @@ ExtensionManagementFactory::BuildServiceInstanceForBrowserContext( diff --git a/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch b/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch index 0515d055bdaf..7a18966df9e6 100644 --- a/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch +++ b/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -index 1670df56885596e6424e2a7a80a84d88fa8feaa5..505c4f225de2770e99366aabb6ad14f18afbb214 100644 +index e988190705de58a06826ea17e789a01e8e7be24a..9c2cac7220d9f2fdd01120cbbe3650957a52b521 100644 --- a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc +++ b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -@@ -263,6 +263,7 @@ bool WebRtcEventLogUploaderImpl::PrepareUploadData(std::string* upload_data) { +@@ -262,6 +262,7 @@ bool WebRtcEventLogUploaderImpl::PrepareUploadData(std::string* upload_data) { } void WebRtcEventLogUploaderImpl::StartUpload(const std::string& upload_data) { diff --git a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch index af43da5c0090..b1268070cd8c 100644 --- a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch +++ b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -index 2d2a23fb8ba6e9ff474eb14b2f86ed684164980f..a38f3cba09fa1c991c6bc9a4ff082c492d28e7b1 100644 +index 6172daf31855ebe47ec988f6aecdb7c077d865ac..59354756e97af633cb73af813a658d5107005b0f 100644 --- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc +++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -496,6 +496,7 @@ std::string WebRtcLogUploader::CompressLog(WebRtcLogBuffer* buffer) { +@@ -493,6 +493,7 @@ std::string WebRtcLogUploader::CompressLog(WebRtcLogBuffer* buffer) { void WebRtcLogUploader::UploadCompressedLog( WebRtcLogUploader::UploadDoneData upload_done_data, std::unique_ptr post_data) { diff --git a/patches/chrome-browser-net-system_network_context_manager.cc.patch b/patches/chrome-browser-net-system_network_context_manager.cc.patch index a9ce8b746fd0..97c43930dcc9 100644 --- a/patches/chrome-browser-net-system_network_context_manager.cc.patch +++ b/patches/chrome-browser-net-system_network_context_manager.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc -index acef4b496befd7d7c3a2f4b763d73f5144c63e5f..b60ffc550428c7aea3b110ba4dd2d23b694ab429 100644 +index c4fc3c7ec7e6583b3cb72f6d6d843ba6ba1b8397..c59cee5dd696a373f13e72215e44502294848797 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc -@@ -409,7 +409,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem +@@ -408,7 +408,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem if (!manager_) return; manager_->GetURLLoaderFactory()->CreateLoaderAndStart( diff --git a/patches/chrome-browser-notifications-android-java-src-org-chromium-chrome-browser-notifications-channels-ChromeChannelDefinitions.java.patch b/patches/chrome-browser-notifications-android-java-src-org-chromium-chrome-browser-notifications-channels-ChromeChannelDefinitions.java.patch index f0d4169a68c3..06664777f040 100644 --- a/patches/chrome-browser-notifications-android-java-src-org-chromium-chrome-browser-notifications-channels-ChromeChannelDefinitions.java.patch +++ b/patches/chrome-browser-notifications-android-java-src-org-chromium-chrome-browser-notifications-channels-ChromeChannelDefinitions.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java -index 5bed1dc1fe971720ad4dbcf8beaa8e76d64ad84c..af5298de027f37236238fa667b72b5a4c73e4a4b 100644 +index a1a50693e330e93c7a1eb99f145db5502c851dcb..df20c92c5f48c3dcc58d96e1b5be882542a8cd55 100644 --- a/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java -@@ -75,6 +75,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { +@@ -78,6 +78,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { ChannelId.COLLABORATION, ChannelId.DOWNLOADS, ChannelId.INCOGNITO, @@ -10,7 +10,7 @@ index 5bed1dc1fe971720ad4dbcf8beaa8e76d64ad84c..af5298de027f37236238fa667b72b5a4 ChannelId.MEDIA_PLAYBACK, ChannelId.SCREEN_CAPTURE, ChannelId.CONTENT_SUGGESTIONS, -@@ -130,7 +131,8 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { +@@ -133,7 +134,8 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { String USB = "usb"; } @@ -20,7 +20,7 @@ index 5bed1dc1fe971720ad4dbcf8beaa8e76d64ad84c..af5298de027f37236238fa667b72b5a4 @Retention(RetentionPolicy.SOURCE) public @interface ChannelGroupId { String SITES = "sites"; -@@ -158,6 +160,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { +@@ -161,6 +163,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { Map map = new HashMap<>(); Set startup = new HashSet<>(); @@ -28,7 +28,7 @@ index 5bed1dc1fe971720ad4dbcf8beaa8e76d64ad84c..af5298de027f37236238fa667b72b5a4 map.put( ChannelId.BROWSER, PredefinedChannel.create( -@@ -397,6 +400,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { +@@ -400,6 +403,7 @@ public class ChromeChannelDefinitions extends ChannelDefinitions { static { Map map = new HashMap<>(); diff --git a/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch b/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch index 132c9ac19dfb..bd458fd17c1a 100644 --- a/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch +++ b/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/notifications/notification_display_service_impl.cc b/chrome/browser/notifications/notification_display_service_impl.cc -index 3b28efd187984303cdd624b5d84f8bcbb9b46d68..ee477863383b0c0e1dcd70a6cf6d18271fd6e4a3 100644 +index d3519b2140f86e2f546b74b1478b92ba822616c0..8e2f4097e9eef5ddb796dedfc2aeedf8865ed2f9 100644 --- a/chrome/browser/notifications/notification_display_service_impl.cc +++ b/chrome/browser/notifications/notification_display_service_impl.cc -@@ -115,6 +115,7 @@ NotificationDisplayServiceImpl::NotificationDisplayServiceImpl(Profile* profile) +@@ -119,6 +119,7 @@ NotificationDisplayServiceImpl::NotificationDisplayServiceImpl(Profile* profile) std::make_unique()); } #endif diff --git a/patches/chrome-browser-notifications-notification_platform_bridge_android.cc.patch b/patches/chrome-browser-notifications-notification_platform_bridge_android.cc.patch deleted file mode 100644 index 1cfb10eee80a..000000000000 --- a/patches/chrome-browser-notifications-notification_platform_bridge_android.cc.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/chrome/browser/notifications/notification_platform_bridge_android.cc b/chrome/browser/notifications/notification_platform_bridge_android.cc -index e4fefe63165d2ed6c1230460563312dd1cbbe261..ac737f9ee53f26ff560acc5d836bfb5c6b979e4d 100644 ---- a/chrome/browser/notifications/notification_platform_bridge_android.cc -+++ b/chrome/browser/notifications/notification_platform_bridge_android.cc -@@ -347,7 +347,9 @@ void NotificationPlatformBridgeAndroid::Display( - : (persistent_notification_metadata - ? persistent_notification_metadata->is_suspicious - : false), -- persistent_notification_metadata->skip_ua_buttons); -+ persistent_notification_metadata -+ ? persistent_notification_metadata->skip_ua_buttons -+ : false); - - regenerated_notification_infos_[notification.id()] = - RegeneratedNotificationInfo(scope_url, std::nullopt); diff --git a/patches/chrome-browser-prefs-browser_prefs.cc.patch b/patches/chrome-browser-prefs-browser_prefs.cc.patch index fd45843045c6..a09dcdd9eab6 100644 --- a/patches/chrome-browser-prefs-browser_prefs.cc.patch +++ b/patches/chrome-browser-prefs-browser_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index dc8800d422a2c17e2a6ada0b9b3afb0727922d22..c7166ca6a3931b9ac4dfcebca5e9a8ad51d6d6fe 100644 +index c95fca6d405cd53d39cbe68309384e4914089ff6..70764ec71935860f82fbfeabb2e1c4d3373ebb43 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -1939,6 +1939,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1841,6 +1841,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { registry->RegisterIntegerPref(prefs::kToastAlertLevel, 0); // This is intentionally last. @@ -10,7 +10,7 @@ index dc8800d422a2c17e2a6ada0b9b3afb0727922d22..c7166ca6a3931b9ac4dfcebca5e9a8ad RegisterLocalStatePrefsForMigration(registry); } -@@ -2380,6 +2381,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -2271,6 +2272,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, registry->RegisterIntegerPref(prefs::kLensOverlayStartCount, 0); registry->RegisterDictionaryPref(prefs::kReportingEndpoints); diff --git a/patches/chrome-browser-prefs-chrome_pref_service_factory.cc.patch b/patches/chrome-browser-prefs-chrome_pref_service_factory.cc.patch index a46078389a62..f342cd2d51e2 100644 --- a/patches/chrome-browser-prefs-chrome_pref_service_factory.cc.patch +++ b/patches/chrome-browser-prefs-chrome_pref_service_factory.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc -index 88e5b23953ed69688fb29b04c307b2dd4b38fc4f..1231f1f7b38d7317d31cd7a9cafdb4e4acf2eeb8 100644 +index 3d946ce955030f629a87ed99e1493d0938e2a153..44dac2ac268a8a452aca3ead37152d7c53038e8d 100644 --- a/chrome/browser/prefs/chrome_pref_service_factory.cc +++ b/chrome/browser/prefs/chrome_pref_service_factory.cc @@ -186,6 +186,7 @@ const auto kTrackedPrefs = std::to_array({ diff --git a/patches/chrome-browser-profiles-profile_attributes_entry.cc.patch b/patches/chrome-browser-profiles-profile_attributes_entry.cc.patch index 81426f56ffff..473ad099baf2 100644 --- a/patches/chrome-browser-profiles-profile_attributes_entry.cc.patch +++ b/patches/chrome-browser-profiles-profile_attributes_entry.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc -index 5388420f8201b608c223184ae15e14b842e1f264..73d13d35468545abaac5cdee62f300816ffcb5ec 100644 +index 5e38eaa11c6a05a43f7417da3e0c0539d8243a55..7ad9e03b47dd5eeb1590a0cd8ddd84e07b5179e7 100644 --- a/chrome/browser/profiles/profile_attributes_entry.cc +++ b/chrome/browser/profiles/profile_attributes_entry.cc -@@ -1084,6 +1084,7 @@ bool ProfileAttributesEntry::ClearValue(const char* key) { +@@ -1085,6 +1085,7 @@ bool ProfileAttributesEntry::ClearValue(const char* key) { // This method should be periodically pruned of year+ old migrations. void ProfileAttributesEntry::MigrateObsoleteProfileAttributes() { diff --git a/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch b/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch index f27aaaa07a65..da9d1e5fe300 100644 --- a/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch +++ b/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_avatar_icon_util.cc b/chrome/browser/profiles/profile_avatar_icon_util.cc -index a972d449ff08f76f82b055be9cb1d8b578469f5a..ebeee48dedcc7dc4d262c809a131d9110d2d0e5b 100644 +index a6dd56a5adf761cdc8f8e39a0f3eac5ecaa5012e..9099ff51bbbc2db9d0d96d8807eef6ca3cf0ccc0 100644 --- a/chrome/browser/profiles/profile_avatar_icon_util.cc +++ b/chrome/browser/profiles/profile_avatar_icon_util.cc -@@ -423,7 +423,7 @@ constexpr size_t kDefaultAvatarIconsCount = 1; +@@ -428,7 +428,7 @@ constexpr size_t kDefaultAvatarIconsCount = 1; #elif BUILDFLAG(IS_CHROMEOS_ASH) constexpr size_t kDefaultAvatarIconsCount = 27; #else @@ -11,7 +11,7 @@ index a972d449ff08f76f82b055be9cb1d8b578469f5a..ebeee48dedcc7dc4d262c809a131d911 #endif #if !BUILDFLAG(IS_ANDROID) -@@ -603,6 +603,7 @@ size_t GetPlaceholderAvatarIndex() { +@@ -611,6 +611,7 @@ size_t GetPlaceholderAvatarIndex() { size_t GetModernAvatarIconStartIndex() { #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID) @@ -19,7 +19,7 @@ index a972d449ff08f76f82b055be9cb1d8b578469f5a..ebeee48dedcc7dc4d262c809a131d911 return GetPlaceholderAvatarIndex() + 1; #else // Only use the placeholder avatar on ChromeOS and Android. -@@ -636,6 +637,7 @@ std::string GetPlaceholderAvatarIconUrl() { +@@ -644,6 +645,7 @@ std::string GetPlaceholderAvatarIconUrl() { const IconResourceInfo* GetDefaultAvatarIconResourceInfo(size_t index) { CHECK_LT(index, kDefaultAvatarIconsCount); @@ -27,7 +27,7 @@ index a972d449ff08f76f82b055be9cb1d8b578469f5a..ebeee48dedcc7dc4d262c809a131d911 static const std::array resource_info = {{ // Old avatar icons: -@@ -956,6 +958,7 @@ base::Value::List GetIconsAndLabelsForProfileAvatarSelector( +@@ -964,6 +966,7 @@ base::Value::List GetIconsAndLabelsForProfileAvatarSelector( selected_avatar_idx == GetPlaceholderAvatarIndex()); avatars.Insert(avatars.begin(), base::Value(std::move(generic_avatar_info))); diff --git a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch index 218ee7080db6..9850a2809f1c 100644 --- a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch +++ b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc -index b14b639735870711562c305092c6f2ea74b29a16..5f99d9535df797053d3dec0868389ec1f4e5c74f 100644 +index d73cefd1f7df0fb3a300173409d1ea928490e23c..71dfab0a40e0f2314ce2c951b559901c3db2f88a 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -2364,6 +2364,7 @@ void RenderViewContextMenu::AppendSearchProvider() { +@@ -2380,6 +2380,7 @@ void RenderViewContextMenu::AppendSearchProvider() { if (!selection_navigation_url_.is_valid()) { return; } diff --git a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch index a0ba96eb1b38..7e4053c5391f 100644 --- a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch +++ b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h -index e58e041b3ff5888b787ee8209b9a23fdfffa8192..2516eab9618bc06b6534408c86aa8df418bd36ed 100644 +index f9c86beaffb8e56d2f8343b9865e89ec8aba8aed..17ca48037719ea87ddba8cfbd506cde7c62f188f 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -201,6 +201,7 @@ class RenderViewContextMenu +@@ -204,6 +204,7 @@ class RenderViewContextMenu // Returns true if keyboard lock is active and requires the user to press and // hold escape to exit exclusive access mode. bool IsPressAndHoldEscRequiredToExitFullscreen() const; diff --git a/patches/chrome-browser-resources-bookmarks-api_listener.ts.patch b/patches/chrome-browser-resources-bookmarks-api_listener.ts.patch index 12c246e6fc96..226462bd335d 100644 --- a/patches/chrome-browser-resources-bookmarks-api_listener.ts.patch +++ b/patches/chrome-browser-resources-bookmarks-api_listener.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/bookmarks/api_listener.ts b/chrome/browser/resources/bookmarks/api_listener.ts -index f3e1f9285ee6f7f2b5b4bfa0edaceb2a9fca4faf..f08c14827d2e5d4d6c9532f101522f0cf321d31c 100644 +index 300d498a445814bb13fb89c436d5634255e755af..abdbd6b74374ec0de403118855c1780095fd4c36 100644 --- a/chrome/browser/resources/bookmarks/api_listener.ts +++ b/chrome/browser/resources/bookmarks/api_listener.ts @@ -118,6 +118,7 @@ function onChildrenReordered( @@ -11,7 +11,7 @@ index f3e1f9285ee6f7f2b5b4bfa0edaceb2a9fca4faf..f08c14827d2e5d4d6c9532f101522f0c } @@ -126,6 +127,7 @@ function onImportEnded() { - dispatch(refreshNodes(normalizeNodes(results[0]!))); + dispatch(refreshNodes(normalizeNodes(results[0]))); }); chrome.bookmarks.onCreated.addListener(onBookmarkCreated); + chrome.bookmarks.onMoved.addListener(onBookmarkMoved); diff --git a/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch b/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch index 3a26e97da278..9d687ad7084b 100644 --- a/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch +++ b/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/bookmarks/command_manager.ts b/chrome/browser/resources/bookmarks/command_manager.ts -index 9eaf18e6f6e65585e6c64fc29dc10b6f5be79fc1..64939372b7998be016119b0096206ecc286f6b32 100644 +index 4821b67b720fbdb283e795e129a9c94dc843407d..2bceba05dc7c11c2bee65706490aa402afdb8ebc 100644 --- a/chrome/browser/resources/bookmarks/command_manager.ts +++ b/chrome/browser/resources/bookmarks/command_manager.ts -@@ -424,7 +424,7 @@ export class BookmarksCommandManagerElement extends +@@ -445,7 +445,7 @@ export class BookmarksCommandManagerElement extends chrome.bookmarkManagerPrivate.export(); break; case Command.HELP_CENTER: diff --git a/patches/chrome-browser-resources-bookmarks-reducers.ts.patch b/patches/chrome-browser-resources-bookmarks-reducers.ts.patch index 78aa8983b396..f7fa78430d24 100644 --- a/patches/chrome-browser-resources-bookmarks-reducers.ts.patch +++ b/patches/chrome-browser-resources-bookmarks-reducers.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/bookmarks/reducers.ts b/chrome/browser/resources/bookmarks/reducers.ts -index a39cfe3662872d5a0bec5e6cfec12cec77b90f53..34b52727ca37c045dcfbc2cffd5a54b7963ef9a3 100644 +index b0baa90e1de3b65b6e669711a2f5afd6d68df6e9..c8a8adbf94c837be85d7184eb7e8e9a993a9b010 100644 --- a/chrome/browser/resources/bookmarks/reducers.ts +++ b/chrome/browser/resources/bookmarks/reducers.ts @@ -193,6 +193,9 @@ function editBookmark(nodes: NodeMap, action: EditBookmarkAction): NodeMap { @@ -13,11 +13,11 @@ index a39cfe3662872d5a0bec5e6cfec12cec77b90f53..34b52727ca37c045dcfbc2cffd5a54b7 // Change node's parent. nodeModifications[id] = @@ -330,7 +333,7 @@ export function updateFolderOpenState( - folderOpenState, nodes[(action as SelectFolderAction).id]!.parentId!, + folderOpenState, nodes[(action as SelectFolderAction).id].parentId!, nodes); case 'move-bookmark': -- if (!nodes[(action as MoveBookmarkAction).id]!.children) { -+ if (!nodes[(action as MoveBookmarkAction).id] || !nodes[(action as MoveBookmarkAction).id]!.children) { +- if (!nodes[(action as MoveBookmarkAction).id].children) { ++ if (!nodes[(action as MoveBookmarkAction).id] || !nodes[(action as MoveBookmarkAction).id].children) { return folderOpenState; } return openFolderAndAncestors( diff --git a/patches/chrome-browser-resources-history-shared_style.css.patch b/patches/chrome-browser-resources-history-shared_style.css.patch index bbf1d83001d2..0f0cbe367ce6 100644 --- a/patches/chrome-browser-resources-history-shared_style.css.patch +++ b/patches/chrome-browser-resources-history-shared_style.css.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/history/shared_style.css b/chrome/browser/resources/history/shared_style.css -index 5db7e1351e8e9f28e85bd26d26683718db58eeeb..ee1bd0150987feac40f2dc75804654b9d1381b2d 100644 +index 5f4da855dfba237f0771453f033c98cf4c793ad2..e0a446e79b4c37a5560a21a5e42a5b1fd5bbb79a 100644 --- a/chrome/browser/resources/history/shared_style.css +++ b/chrome/browser/resources/history/shared_style.css @@ -7,7 +7,7 @@ @@ -10,4 +10,4 @@ index 5db7e1351e8e9f28e85bd26d26683718db58eeeb..ee1bd0150987feac40f2dc75804654b9 + * #include=cr-hidden-style br-shared-style * #css_wrapper_metadata_end */ - a { + /* Purposefully empty since this style is generated at build time from the diff --git a/patches/chrome-browser-resources-history-synced_device_manager.html.patch b/patches/chrome-browser-resources-history-synced_device_manager.html.patch index 166576eef426..d01fe4ef7560 100644 --- a/patches/chrome-browser-resources-history-synced_device_manager.html.patch +++ b/patches/chrome-browser-resources-history-synced_device_manager.html.patch @@ -1,20 +1,20 @@ diff --git a/chrome/browser/resources/history/synced_device_manager.html b/chrome/browser/resources/history/synced_device_manager.html -index 29bfb59551de19095847bc97e5d290fb0d178c85..6b734a18a7c29b6396b60f7f5e860f5ba82d3361 100644 +index 054c5a8fea1014a1e5ad65ebefa04588f7fd2e27..b37a20308354db209974a4dcbad3842f62087e19 100644 --- a/chrome/browser/resources/history/synced_device_manager.html +++ b/chrome/browser/resources/history/synced_device_manager.html -@@ -73,6 +73,7 @@ - guestSession_)]]"> - [[noSyncedTabsMessage(fetchingSyncedTabs_, searchTerm)]] - +@@ -18,6 +18,7 @@ + ?hidden="${!this.showNoSyncedMessage_()}"> + ${this.noSyncedTabsMessage_()} + + - -