Skip to content

Commit

Permalink
Merge pull request #26068 from brave/cr132
Browse files Browse the repository at this point in the history
Upgrade from Chromium 131 to Chromium 132
  • Loading branch information
emerick authored Dec 2, 2024
2 parents 14bc24f + 053f04c commit 89750d5
Show file tree
Hide file tree
Showing 984 changed files with 6,355 additions and 6,622 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ if (is_mac) {

cargo_audit_target_dir = "$root_build_dir/cargo_audit"
cargo_audit_exe = "$cargo_audit_target_dir/release/cargo-audit"
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_20/crate"
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_21/crate"
if (host_os == "win") {
cargo_audit_exe += ".exe"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

Expand All @@ -19,11 +18,10 @@
import org.chromium.chrome.browser.data_sharing.DataSharingTabManager;
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
import org.chromium.chrome.browser.tab_ui.TabContentManager;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider.IncognitoStateObserver;
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator;
import org.chromium.chrome.tab_ui.R;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
Expand All @@ -36,15 +34,12 @@ public class BraveTabGroupUiCoordinator extends TabGroupUiCoordinator {
private TabGroupUiToolbarView mToolbarView;

// Own members.
private IncognitoStateProvider mIncognitoStateProvider;
private IncognitoStateObserver mIncognitoStateObserver;
private TabModelSelector mTabModelSelector;

public BraveTabGroupUiCoordinator(
@NonNull Activity activity,
@NonNull ViewGroup parentView,
@NonNull BrowserControlsStateProvider browserControlsStateProvider,
@NonNull IncognitoStateProvider incognitoStateProvider,
@NonNull ScrimCoordinator scrimCoordinator,
@NonNull ObservableSupplier<Boolean> omniboxFocusStateSupplier,
@NonNull BottomSheetController bottomSheetController,
Expand All @@ -53,12 +48,12 @@ public BraveTabGroupUiCoordinator(
@NonNull TabContentManager tabContentManager,
@NonNull TabCreatorManager tabCreatorManager,
@NonNull OneshotSupplier<LayoutStateProvider> layoutStateProviderSupplier,
@NonNull ModalDialogManager modalDialogManager) {
@NonNull ModalDialogManager modalDialogManager,
@NonNull ThemeColorProvider themeColorProvider) {
super(
activity,
parentView,
browserControlsStateProvider,
incognitoStateProvider,
scrimCoordinator,
omniboxFocusStateSupplier,
bottomSheetController,
Expand All @@ -67,9 +62,9 @@ public BraveTabGroupUiCoordinator(
tabContentManager,
tabCreatorManager,
layoutStateProviderSupplier,
modalDialogManager);
modalDialogManager,
themeColorProvider);

mIncognitoStateProvider = incognitoStateProvider;
mTabModelSelector = tabModelSelector;

assert mToolbarView != null : "Make sure mToolbarView is properly patched in bytecode.";
Expand Down Expand Up @@ -133,20 +128,6 @@ private void callSuperInitializeWithNative(
BottomControlsCoordinator.BottomControlsVisibilityController visibilityController,
Callback<Object> onModelTokenChange) {
super.initializeWithNative(activity, visibilityController, onModelTokenChange);

mIncognitoStateObserver =
(isIncognito) -> {
if (!isIncognito) {
// Make sure that background color match bottom toolbar color.
LinearLayout mainContent = mToolbarView.findViewById(R.id.main_content);
assert mainContent != null : "Something has changed in upstream!";
if (mainContent != null) {
mainContent.setBackgroundColor(
activity.getColor(R.color.dialog_bg_color_baseline));
}
}
};
mIncognitoStateProvider.addIncognitoStateObserverAndTrigger(mIncognitoStateObserver);
}

@Override
Expand All @@ -157,6 +138,5 @@ public void destroy() {
// mTabStripCoordinator could be null in a base class.
// https://github.com/brave/brave-browser/issues/40673
}
mIncognitoStateProvider.removeObserver(mIncognitoStateObserver);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@
<release seq="1">
<messages fallback_to_english="true">
<!-- In-Product Help strings -->
<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.">
Quickly compare pages by making a group. To start, touch &amp; hold a link.
</message>
<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.">
Tap to see another tab
</message>
<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.">
Switch between tabs in your tab group near bottom of screen
</message>
<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.">
You can now open a new tab here
</message>
Expand Down Expand Up @@ -212,6 +203,9 @@
<message name="IDS_TAB_GRID_SHARE_BUTTON_TEXT" desc="Text for sharing the current tab group from the tab group dialog toolbar.">
Share
</message>
<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.">
Manage
</message>

<!-- Bottom Tab Strip strings -->
<message name="IDS_ACCESSIBILITY_BOTTOM_TAB_STRIP_EXPAND_TAB_SHEET" desc="Accessibility string for BottomTabStripToolbar button indicated visually by the '^' sign.">
Expand All @@ -222,18 +216,6 @@
<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.">
Tab Switcher
</message>
<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.">
{NUMBER_OF_TABS, plural,
=1 {Close tab group with <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
other {Close tab group with <ph name="TABS_COUNT_MANY">%1$d<ex>2</ex></ph> tabs.}
}
</message>
<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.">
{NUMBER_OF_TABS, plural,
=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.}
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.}
}
</message>

<!-- Tab Selection Editor strings -->
<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.">
Expand Down Expand Up @@ -406,18 +388,6 @@
</message>

<!-- Tab Grid Dialog accessibility strings -->
<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.">
{NUMBER_OF_TABS, plural,
=1 {Expand tab group with <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
other {Expand tab group with <ph name="TABS_COUNT_MANY">%1$d<ex>2</ex></ph> tabs.}
}
</message>
<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.">
{NUMBER_OF_TABS, plural,
=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.}
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.}
}
</message>
<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.">
{TABS_COUNT, plural,
=1 {Collapse <ph name="TABS_COUNT_ONE">%1$d<ex>1</ex></ph> tab.}
Expand Down Expand Up @@ -750,9 +720,6 @@
<message name="IDS_DELETE_TAB_GROUP_NO_SYNC_DESCRIPTION" desc="Description of the action of deleting a tab group, shown in a confirmation dialog.">
This will permanently delete the group from your device
</message>
<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.">
Don't ask again
</message>
<message name="IDS_DELETE_TAB_GROUP_ACTION" desc="Button text in a confirmation dialog which will delete a tab group.">
Delete group
</message>
Expand Down
1 change: 1 addition & 0 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
*** mModalDialogManagerSupplier;
*** mTabObscuringHandler;
*** mReadAloudControllerSupplier;
*** mTopUiThemeColorProvider;
*** onOrientationChange(...);
*** updateBookmarkButtonStatus(...);
*** updateReloadState(...);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ private void checkForYandexSE() {
BraveSearchEngineUtils.setDSEPrefs(yandexTemplateUrl, lastUsedRegularProfile);
BraveSearchEngineUtils.setDSEPrefs(
yandexTemplateUrl,
lastUsedRegularProfile.getPrimaryOTRProfile(/* createIfNeeded= */ true));
lastUsedRegularProfile.getPrimaryOtrProfile(/* createIfNeeded= */ true));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

IntentRequestTracker intentRequestTracker = IntentRequestTracker.createFromActivity(this);
mWindowAndroid = new ActivityWindowAndroid(this, true, intentRequestTracker);
mWindowAndroid = new ActivityWindowAndroid(this, true, intentRequestTracker, null);
mWindowAndroid.getIntentRequestTracker().restoreInstanceState(savedInstanceState);
if (mBookmarkManagerCoordinator instanceof BraveBookmarkManagerCoordinator) {
((BraveBookmarkManagerCoordinator) mBookmarkManagerCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ private static void downloadImage(String url, final RequestManager requestManage
validUrl = url;
}

WebContentsFactory webContentsFactory = new WebContentsFactory();
WebContents webContents =
webContentsFactory.createWebContentsWithWarmRenderer(
WebContentsFactory.createWebContentsWithWarmRenderer(
profile, true, NetId.INVALID);
webContents.downloadImage(
new GURL(validUrl), // Url
Expand Down Expand Up @@ -330,36 +329,50 @@ public static String sanitizeSvg(String input) {
}
}

private static void loadImage(ImageFetcherFacade imageFetcherFacade,
RequestManager requestManager, boolean isCircular, final int roundedCorners,
ImageView imageView, CustomTarget<Drawable> customTarget, Callback callback) {
private static void loadImage(
ImageFetcherFacade imageFetcherFacade,
RequestManager requestManager,
boolean isCircular,
final int roundedCorners,
ImageView imageView,
CustomTarget<Drawable> customTarget,
Callback callback) {
if (imageFetcherFacade == null
|| (imageFetcherFacade.data == null && imageFetcherFacade.drawable == null)) {
|| (imageFetcherFacade.mData == null && imageFetcherFacade.mDrawable == null)) {
if (callback != null) callback.onLoadFailed();
return;
}
RequestBuilder<Drawable> request =
requestManager
.load(imageFetcherFacade.data != null ? imageFetcherFacade.data
: imageFetcherFacade.drawable)
.load(
imageFetcherFacade.mData != null
? imageFetcherFacade.mData
: imageFetcherFacade.mDrawable)
.transform(getTransformations(isCircular, roundedCorners))
.diskCacheStrategy(DiskCacheStrategy.NONE)
.priority(Priority.IMMEDIATE)
.listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(GlideException glideException, Object model,
Target<Drawable> target, boolean isFirstResource) {
return callback != null && callback.onLoadFailed();
}

@Override
public boolean onResourceReady(Drawable resource, Object model,
Target<Drawable> target, DataSource dataSource,
boolean isFirstResource) {
return callback != null
&& callback.onResourceReady(resource, target);
}
});
.listener(
new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(
GlideException glideException,
Object model,
Target<Drawable> target,
boolean isFirstResource) {
return callback != null && callback.onLoadFailed();
}

@Override
public boolean onResourceReady(
Drawable resource,
Object model,
Target<Drawable> target,
DataSource dataSource,
boolean isFirstResource) {
return callback != null
&& callback.onResourceReady(resource, target);
}
});

if (imageView != null) {
request.into(imageView);
Expand Down Expand Up @@ -513,16 +526,17 @@ public interface Callback {
}

private static class ImageFetcherFacade {
final byte[] data;
final Drawable drawable;
final byte[] mData;
final Drawable mDrawable;

public ImageFetcherFacade(byte[] data) {
this.data = data;
this.drawable = null;
mData = data;
mDrawable = null;
}

ImageFetcherFacade(Drawable drawable) {
this.drawable = drawable;
this.data = null;
mDrawable = drawable;
mData = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void prepareMenu(Menu menu, AppMenuHandler handler) {
// By this we forcibly initialize BookmarkBridge
MenuItem bookmarkItem = menu.findItem(R.id.bookmark_this_page_id);
if (bookmarkItem != null && currentTab != null) {
updateBookmarkMenuItemShortcut(bookmarkItem, currentTab, /* fromCCT= */ false);
updateBookmarkMenuItemShortcut(bookmarkItem, currentTab, /* fromCct= */ false);
}

// Remove unused dividers. This needs to be done after the visibility of all the items is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ protected RootUiCoordinator createRootUiCoordinator() {
/* statusBarColorProvider= */ this,
getIntentRequestTracker(),
() -> mToolbarCoordinator,
() -> mNavigationController,
() -> mIntentDataProvider,
mBackPressManager,
() -> mTabController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerImpl;
import org.chromium.chrome.browser.customtabs.BaseCustomTabRootUiCoordinator;
import org.chromium.chrome.browser.customtabs.CustomTabFeatureOverridesManager;
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController;
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabController;
import org.chromium.chrome.browser.customtabs.features.minimizedcustomtab.CustomTabMinimizeDelegate;
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator;
Expand Down Expand Up @@ -83,7 +82,6 @@ public BraveLeoCustomTabRootUiCoordinator(
@NonNull StatusBarColorProvider statusBarColorProvider,
@NonNull IntentRequestTracker intentRequestTracker,
@NonNull Supplier<CustomTabToolbarCoordinator> customTabToolbarCoordinator,
@NonNull Supplier<CustomTabActivityNavigationController> customTabNavigationController,
@NonNull Supplier<BrowserServicesIntentDataProvider> intentDataProvider,
@NonNull BackPressManager backPressManager,
@NonNull Supplier<CustomTabActivityTabController> tabController,
Expand Down Expand Up @@ -122,7 +120,6 @@ public BraveLeoCustomTabRootUiCoordinator(
statusBarColorProvider,
intentRequestTracker,
customTabToolbarCoordinator,
customTabNavigationController,
intentDataProvider,
backPressManager,
tabController,
Expand Down
Loading

0 comments on commit 89750d5

Please sign in to comment.