Skip to content

Commit 89750d5

Browse files
authored
Merge pull request #26068 from brave/cr132
Upgrade from Chromium 131 to Chromium 132
2 parents 14bc24f + 053f04c commit 89750d5

File tree

984 files changed

+6355
-6622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

984 files changed

+6355
-6622
lines changed

BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ if (is_mac) {
612612

613613
cargo_audit_target_dir = "$root_build_dir/cargo_audit"
614614
cargo_audit_exe = "$cargo_audit_target_dir/release/cargo-audit"
615-
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_20/crate"
615+
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_21/crate"
616616
if (host_os == "win") {
617617
cargo_audit_exe += ".exe"
618618
}

android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/BraveTabGroupUiCoordinator.java

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import android.app.Activity;
99
import android.view.View;
1010
import android.view.ViewGroup;
11-
import android.widget.LinearLayout;
1211

1312
import androidx.annotation.NonNull;
1413

@@ -19,11 +18,10 @@
1918
import org.chromium.chrome.browser.data_sharing.DataSharingTabManager;
2019
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
2120
import org.chromium.chrome.browser.tab_ui.TabContentManager;
22-
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
23-
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider.IncognitoStateObserver;
2421
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
2522
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
2623
import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver;
24+
import org.chromium.chrome.browser.theme.ThemeColorProvider;
2725
import org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator;
2826
import org.chromium.chrome.tab_ui.R;
2927
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
@@ -36,15 +34,12 @@ public class BraveTabGroupUiCoordinator extends TabGroupUiCoordinator {
3634
private TabGroupUiToolbarView mToolbarView;
3735

3836
// Own members.
39-
private IncognitoStateProvider mIncognitoStateProvider;
40-
private IncognitoStateObserver mIncognitoStateObserver;
4137
private TabModelSelector mTabModelSelector;
4238

4339
public BraveTabGroupUiCoordinator(
4440
@NonNull Activity activity,
4541
@NonNull ViewGroup parentView,
4642
@NonNull BrowserControlsStateProvider browserControlsStateProvider,
47-
@NonNull IncognitoStateProvider incognitoStateProvider,
4843
@NonNull ScrimCoordinator scrimCoordinator,
4944
@NonNull ObservableSupplier<Boolean> omniboxFocusStateSupplier,
5045
@NonNull BottomSheetController bottomSheetController,
@@ -53,12 +48,12 @@ public BraveTabGroupUiCoordinator(
5348
@NonNull TabContentManager tabContentManager,
5449
@NonNull TabCreatorManager tabCreatorManager,
5550
@NonNull OneshotSupplier<LayoutStateProvider> layoutStateProviderSupplier,
56-
@NonNull ModalDialogManager modalDialogManager) {
51+
@NonNull ModalDialogManager modalDialogManager,
52+
@NonNull ThemeColorProvider themeColorProvider) {
5753
super(
5854
activity,
5955
parentView,
6056
browserControlsStateProvider,
61-
incognitoStateProvider,
6257
scrimCoordinator,
6358
omniboxFocusStateSupplier,
6459
bottomSheetController,
@@ -67,9 +62,9 @@ public BraveTabGroupUiCoordinator(
6762
tabContentManager,
6863
tabCreatorManager,
6964
layoutStateProviderSupplier,
70-
modalDialogManager);
65+
modalDialogManager,
66+
themeColorProvider);
7167

72-
mIncognitoStateProvider = incognitoStateProvider;
7368
mTabModelSelector = tabModelSelector;
7469

7570
assert mToolbarView != null : "Make sure mToolbarView is properly patched in bytecode.";
@@ -133,20 +128,6 @@ private void callSuperInitializeWithNative(
133128
BottomControlsCoordinator.BottomControlsVisibilityController visibilityController,
134129
Callback<Object> onModelTokenChange) {
135130
super.initializeWithNative(activity, visibilityController, onModelTokenChange);
136-
137-
mIncognitoStateObserver =
138-
(isIncognito) -> {
139-
if (!isIncognito) {
140-
// Make sure that background color match bottom toolbar color.
141-
LinearLayout mainContent = mToolbarView.findViewById(R.id.main_content);
142-
assert mainContent != null : "Something has changed in upstream!";
143-
if (mainContent != null) {
144-
mainContent.setBackgroundColor(
145-
activity.getColor(R.color.dialog_bg_color_baseline));
146-
}
147-
}
148-
};
149-
mIncognitoStateProvider.addIncognitoStateObserverAndTrigger(mIncognitoStateObserver);
150131
}
151132

152133
@Override
@@ -157,6 +138,5 @@ public void destroy() {
157138
// mTabStripCoordinator could be null in a base class.
158139
// https://github.com/brave/brave-browser/issues/40673
159140
}
160-
mIncognitoStateProvider.removeObserver(mIncognitoStateObserver);
161141
}
162142
}

android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,6 @@
174174
<release seq="1">
175175
<messages fallback_to_english="true">
176176
<!-- In-Product Help strings -->
177-
<message name="IDS_IPH_TAB_GROUPS_QUICKLY_COMPARE_PAGES_TEXT" desc="When Brave detects that the user is searching or comparing multiple pages (e.g. while comparison shopping), this in-product help text appears at the bottom of the screen. The text informs the user that they can longpress on a link to open it as a new tab within a tab group.">
178-
Quickly compare pages by making a group. To start, touch &amp; hold a link.
179-
</message>
180-
<message name="IDS_IPH_TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_TEXT" desc="This in-product help text points to the strip of favicons at the bottom of the page. The favicons indicate all the open tabs within the tab group. The text informs the user that they can tap on any favicon to switch to that tab.">
181-
Tap to see another tab
182-
</message>
183-
<message name="IDS_IPH_TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_ACCESSIBILITY_TEXT" desc="This in-product help accessibility text points to the strip of favicons at the bottom of the page. The favicons indicate all the open tabs within the tab group. The text informs the user that they can tap on any favicon to switch to that tab.">
184-
Switch between tabs in your tab group near bottom of screen
185-
</message>
186177
<message name="IDS_IPH_TAB_SWITCHER_FLOATING_ACTION_BUTTON" desc="This in-product help points to the new location of the new tab button which floats atop the tabs rather than being located in the toolbar. The text informs users they can use the button to open new tabs.">
187178
You can now open a new tab here
188179
</message>
@@ -212,6 +203,9 @@
212203
<message name="IDS_TAB_GRID_SHARE_BUTTON_TEXT" desc="Text for sharing the current tab group from the tab group dialog toolbar.">
213204
Share
214205
</message>
206+
<message name="IDS_TAB_GRID_MANAGE_BUTTON_TEXT" desc="Text for managing the sharing of the current tab group from the tab group dialog toolbar.">
207+
Manage
208+
</message>
215209

216210
<!-- Bottom Tab Strip strings -->
217211
<message name="IDS_ACCESSIBILITY_BOTTOM_TAB_STRIP_EXPAND_TAB_SHEET" desc="Accessibility string for BottomTabStripToolbar button indicated visually by the '^' sign.">
@@ -222,18 +216,6 @@
222216
<message name="IDS_ACCESSIBILITY_TAB_SWITCHER" desc="Accessibility string for Tab Switcher view. This string is announced when the Tab Switcher is shown to screen.">
223217
Tab Switcher
224218
</message>
225-
<message name="IDS_ACCESSIBILITY_CLOSE_TAB_GROUP_BUTTON" desc="The accessibility text to read when the close button on a card representing a tab group is focused in grid tab switcher. When this close button is tapped, all tabs within the tab group will be closed. NUMBER_OF_TABS is the number of tabs within this group.">
226-
{NUMBER_OF_TABS, plural,
227-
=1 {Close tab group with <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
228-
other {Close tab group with <ph name="TABS_COUNT_MANY">%1$d<ex>2</ex></ph> tabs.}
229-
}
230-
</message>
231-
<message name="IDS_ACCESSIBILITY_CLOSE_TAB_GROUP_BUTTON_WITH_GROUP_NAME" desc="The accessibility text to read when the close button on a card representing a tab group is focused in grid tab switcher. When this close button is tapped, all tabs within the tab group will be closed. TITLE_OF_GROUP is the title of the group. NUMBER_OF_TABS is the number of tabs within this group.">
232-
{NUMBER_OF_TABS, plural,
233-
=1 {Close <ph name="TITLE_OF_GROUP">%1$s<ex>shopping</ex></ph> group with <ph name="TABS_COUNT_ONE">%2$d<ex>1</ex></ph> tab.}
234-
other {Close <ph name="TITLE_OF_GROUP">%1$s<ex>shopping</ex></ph> group with <ph name="TABS_COUNT_MANY">%2$d<ex>2</ex></ph> tabs.}
235-
}
236-
</message>
237219

238220
<!-- Tab Selection Editor strings -->
239221
<message name="IDS_TAB_SELECTION_EDITOR_TOOLBAR_SELECT_TABS" desc="Label shown on Tab Selection Editor Toolbar asking user to select tabs from the list.">
@@ -406,18 +388,6 @@
406388
</message>
407389

408390
<!-- Tab Grid Dialog accessibility strings -->
409-
<message name="IDS_ACCESSIBILITY_EXPAND_TAB_GROUP" desc="The accessibility text to read when a card representing a tab group is clicked in grid tab switcher. NUMBER_OF_TABS is the number of tabs within this group.">
410-
{NUMBER_OF_TABS, plural,
411-
=1 {Expand tab group with <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
412-
other {Expand tab group with <ph name="TABS_COUNT_MANY">%1$d<ex>2</ex></ph> tabs.}
413-
}
414-
</message>
415-
<message name="IDS_ACCESSIBILITY_EXPAND_TAB_GROUP_WITH_GROUP_NAME" desc="The accessibility text to read when a card representing a tab group is clicked in grid tab switcher. TITLE_OF_GROUP is the title of the group. NUMBER_OF_TABS is the number of tabs within this group.">
416-
{NUMBER_OF_TABS, plural,
417-
=1 {Expand <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph> tab group with <ph name="TABS_COUNT_ONE">%2$d<ex>1</ex></ph> tab.}
418-
other {Expand <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph> tab group with <ph name="TABS_COUNT_MANY">%2$d<ex>2</ex></ph> tabs.}
419-
}
420-
</message>
421391
<message name="IDS_ACCESSIBILITY_DIALOG_BACK_BUTTON" desc="The accessibility text to read when the back button in the dialog is focused. When this button is tapped, the dialog will be hidden. NUMBER_OF_TABS is the number of tabs within this group. Note that after collapsing with one tab, that group becomes a tab.">
422392
{TABS_COUNT, plural,
423393
=1 {Collapse <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
@@ -750,9 +720,6 @@
750720
<message name="IDS_DELETE_TAB_GROUP_NO_SYNC_DESCRIPTION" desc="Description of the action of deleting a tab group, shown in a confirmation dialog.">
751721
This will permanently delete the group from your device
752722
</message>
753-
<message name="IDS_CONFIRMATION_STOP_SHOWING" desc="Text next to a checkbox asking if confirmation should not be shown again. Used for various tab operations.">
754-
Don't ask again
755-
</message>
756723
<message name="IDS_DELETE_TAB_GROUP_ACTION" desc="Button text in a confirmation dialog which will delete a tab group.">
757724
Delete group
758725
</message>

android/java/apk_for_test.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
*** mModalDialogManagerSupplier;
146146
*** mTabObscuringHandler;
147147
*** mReadAloudControllerSupplier;
148+
*** mTopUiThemeColorProvider;
148149
*** onOrientationChange(...);
149150
*** updateBookmarkButtonStatus(...);
150151
*** updateReloadState(...);

android/java/org/chromium/chrome/browser/app/BraveActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ private void checkForYandexSE() {
16781678
BraveSearchEngineUtils.setDSEPrefs(yandexTemplateUrl, lastUsedRegularProfile);
16791679
BraveSearchEngineUtils.setDSEPrefs(
16801680
yandexTemplateUrl,
1681-
lastUsedRegularProfile.getPrimaryOTRProfile(/* createIfNeeded= */ true));
1681+
lastUsedRegularProfile.getPrimaryOtrProfile(/* createIfNeeded= */ true));
16821682
}
16831683
}
16841684
}

android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) {
2323
super.onCreate(savedInstanceState);
2424

2525
IntentRequestTracker intentRequestTracker = IntentRequestTracker.createFromActivity(this);
26-
mWindowAndroid = new ActivityWindowAndroid(this, true, intentRequestTracker);
26+
mWindowAndroid = new ActivityWindowAndroid(this, true, intentRequestTracker, null);
2727
mWindowAndroid.getIntentRequestTracker().restoreInstanceState(savedInstanceState);
2828
if (mBookmarkManagerCoordinator instanceof BraveBookmarkManagerCoordinator) {
2929
((BraveBookmarkManagerCoordinator) mBookmarkManagerCoordinator)

android/java/org/chromium/chrome/browser/app/helpers/ImageLoader.java

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ private static void downloadImage(String url, final RequestManager requestManage
110110
validUrl = url;
111111
}
112112

113-
WebContentsFactory webContentsFactory = new WebContentsFactory();
114113
WebContents webContents =
115-
webContentsFactory.createWebContentsWithWarmRenderer(
114+
WebContentsFactory.createWebContentsWithWarmRenderer(
116115
profile, true, NetId.INVALID);
117116
webContents.downloadImage(
118117
new GURL(validUrl), // Url
@@ -330,36 +329,50 @@ public static String sanitizeSvg(String input) {
330329
}
331330
}
332331

333-
private static void loadImage(ImageFetcherFacade imageFetcherFacade,
334-
RequestManager requestManager, boolean isCircular, final int roundedCorners,
335-
ImageView imageView, CustomTarget<Drawable> customTarget, Callback callback) {
332+
private static void loadImage(
333+
ImageFetcherFacade imageFetcherFacade,
334+
RequestManager requestManager,
335+
boolean isCircular,
336+
final int roundedCorners,
337+
ImageView imageView,
338+
CustomTarget<Drawable> customTarget,
339+
Callback callback) {
336340
if (imageFetcherFacade == null
337-
|| (imageFetcherFacade.data == null && imageFetcherFacade.drawable == null)) {
341+
|| (imageFetcherFacade.mData == null && imageFetcherFacade.mDrawable == null)) {
338342
if (callback != null) callback.onLoadFailed();
339343
return;
340344
}
341345
RequestBuilder<Drawable> request =
342346
requestManager
343-
.load(imageFetcherFacade.data != null ? imageFetcherFacade.data
344-
: imageFetcherFacade.drawable)
347+
.load(
348+
imageFetcherFacade.mData != null
349+
? imageFetcherFacade.mData
350+
: imageFetcherFacade.mDrawable)
345351
.transform(getTransformations(isCircular, roundedCorners))
346352
.diskCacheStrategy(DiskCacheStrategy.NONE)
347353
.priority(Priority.IMMEDIATE)
348-
.listener(new RequestListener<Drawable>() {
349-
@Override
350-
public boolean onLoadFailed(GlideException glideException, Object model,
351-
Target<Drawable> target, boolean isFirstResource) {
352-
return callback != null && callback.onLoadFailed();
353-
}
354-
355-
@Override
356-
public boolean onResourceReady(Drawable resource, Object model,
357-
Target<Drawable> target, DataSource dataSource,
358-
boolean isFirstResource) {
359-
return callback != null
360-
&& callback.onResourceReady(resource, target);
361-
}
362-
});
354+
.listener(
355+
new RequestListener<Drawable>() {
356+
@Override
357+
public boolean onLoadFailed(
358+
GlideException glideException,
359+
Object model,
360+
Target<Drawable> target,
361+
boolean isFirstResource) {
362+
return callback != null && callback.onLoadFailed();
363+
}
364+
365+
@Override
366+
public boolean onResourceReady(
367+
Drawable resource,
368+
Object model,
369+
Target<Drawable> target,
370+
DataSource dataSource,
371+
boolean isFirstResource) {
372+
return callback != null
373+
&& callback.onResourceReady(resource, target);
374+
}
375+
});
363376

364377
if (imageView != null) {
365378
request.into(imageView);
@@ -513,16 +526,17 @@ public interface Callback {
513526
}
514527

515528
private static class ImageFetcherFacade {
516-
final byte[] data;
517-
final Drawable drawable;
529+
final byte[] mData;
530+
final Drawable mDrawable;
531+
518532
public ImageFetcherFacade(byte[] data) {
519-
this.data = data;
520-
this.drawable = null;
533+
mData = data;
534+
mDrawable = null;
521535
}
522536

523537
ImageFetcherFacade(Drawable drawable) {
524-
this.drawable = drawable;
525-
this.data = null;
538+
mDrawable = drawable;
539+
mData = null;
526540
}
527541
}
528542
}

android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public void prepareMenu(Menu menu, AppMenuHandler handler) {
301301
// By this we forcibly initialize BookmarkBridge
302302
MenuItem bookmarkItem = menu.findItem(R.id.bookmark_this_page_id);
303303
if (bookmarkItem != null && currentTab != null) {
304-
updateBookmarkMenuItemShortcut(bookmarkItem, currentTab, /* fromCCT= */ false);
304+
updateBookmarkMenuItemShortcut(bookmarkItem, currentTab, /* fromCct= */ false);
305305
}
306306

307307
// Remove unused dividers. This needs to be done after the visibility of all the items is

android/java/org/chromium/chrome/browser/brave_leo/BraveLeoActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ protected RootUiCoordinator createRootUiCoordinator() {
9797
/* statusBarColorProvider= */ this,
9898
getIntentRequestTracker(),
9999
() -> mToolbarCoordinator,
100-
() -> mNavigationController,
101100
() -> mIntentDataProvider,
102101
mBackPressManager,
103102
() -> mTabController,

android/java/org/chromium/chrome/browser/brave_leo/BraveLeoCustomTabRootUiCoordinator.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerImpl;
2525
import org.chromium.chrome.browser.customtabs.BaseCustomTabRootUiCoordinator;
2626
import org.chromium.chrome.browser.customtabs.CustomTabFeatureOverridesManager;
27-
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController;
2827
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabController;
2928
import org.chromium.chrome.browser.customtabs.features.minimizedcustomtab.CustomTabMinimizeDelegate;
3029
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator;
@@ -83,7 +82,6 @@ public BraveLeoCustomTabRootUiCoordinator(
8382
@NonNull StatusBarColorProvider statusBarColorProvider,
8483
@NonNull IntentRequestTracker intentRequestTracker,
8584
@NonNull Supplier<CustomTabToolbarCoordinator> customTabToolbarCoordinator,
86-
@NonNull Supplier<CustomTabActivityNavigationController> customTabNavigationController,
8785
@NonNull Supplier<BrowserServicesIntentDataProvider> intentDataProvider,
8886
@NonNull BackPressManager backPressManager,
8987
@NonNull Supplier<CustomTabActivityTabController> tabController,
@@ -122,7 +120,6 @@ public BraveLeoCustomTabRootUiCoordinator(
122120
statusBarColorProvider,
123121
intentRequestTracker,
124122
customTabToolbarCoordinator,
125-
customTabNavigationController,
126123
intentDataProvider,
127124
backPressManager,
128125
tabController,

0 commit comments

Comments
 (0)