Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from Chromium 130 to Chromium 131 1.72.x #26222

Merged
merged 7 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions android/android_browser_tests.gni
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,16 @@ android_only_test_deps = [
"//brave/browser/partnercustomizations:delegate_public_impl_java",
"//brave/components/brave_wallet/browser:test_support",
"//brave/components/cosmetic_filters/browser:browser",
"//brave/components/language/android:java",
"//brave/third_party/android_deps:com_android_installreferrer_java",
"//chrome:chrome_android_core",
"//chrome/android:app_hooks_java",
"//chrome/android:delegate_public_impl_java",
"//chrome/browser/flags:flags_android",
"//chrome/browser/lens:delegate_public_impl_java",
"//chrome/browser/locale:delegate_public_impl_java",
"//chrome/browser/metrics:test_support",
"//chrome/test:android_browsertests_assets",
"//chrome/test:android_browsertests_java",
"//chrome/test:test_support",
"//chrome/test:test_support_ui_android",
"//components/browser_ui/widget/android:java",
"//components/externalauth/android:google_delegate_public_impl_java",
"//components/language/android:ulp_delegate_public_java",

# TODO(crbug.com/961849): This is needed for ShellManager which is what
# the ChromeBrowserTestsActivity is using to build the java UI. It's
Expand Down
4 changes: 2 additions & 2 deletions android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import("//brave/android/features/tab_ui/brave_tab_management_java_sources.gni")
import("//brave/android/feed/brave_feed_java_sources.gni")
import("//brave/android/java/org/chromium/chrome/browser/billing/sources.gni")
import("//brave/android/java/org/chromium/chrome/browser/playlist/sources.gni")
import("//brave/base/brave_base_cached_flags_java_sources.gni")
import("//brave/base/brave_base_shared_preferences_java.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")
import("//brave/browser/share/android/java_sources.gni")
import("//brave/browser/tab_ui/android/brave_tab_ui_sources.gni")
import(
"//brave/components/cached_flags/brave_components_cached_flags_java_sources.gni")
import("//brave/components/embedder_support/android/java_sources.gni")
import("//brave/components/permissions/android/java_sources.gni")
import("//brave/components/safetynet/java_sources.gni")
Expand Down Expand Up @@ -539,7 +540,6 @@ brave_java_base_module_sources = [
]

brave_java_base_module_deps = [
"//brave/components/language/android:java",
"//brave/third_party/android_deps:com_wireguard_android_java",
"//third_party/androidx:androidx_core_core_java",
"//third_party/androidx:androidx_lifecycle_lifecycle_livedata_core_java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import androidx.annotation.Nullable;

import org.chromium.base.BraveReflectionUtil;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.browser.hub.ResourceButtonData;
import org.chromium.chrome.browser.incognito.reauth.IncognitoReauthController;
import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.tabmodel.TabModelFilter;
import org.chromium.chrome.browser.tabmodel.TabGroupModelFilter;
import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController;
import org.chromium.chrome.browser.user_education.UserEducationHelper;
import org.chromium.chrome.tab_ui.R;

Expand All @@ -29,11 +31,12 @@ public BraveIncognitoTabSwitcherPane(
@NonNull Context context,
@NonNull OneshotSupplier<ProfileProvider> profileProviderSupplier,
@NonNull TabSwitcherPaneCoordinatorFactory factory,
@NonNull Supplier<TabModelFilter> incognitoTabModelFilterSupplier,
@NonNull Supplier<TabGroupModelFilter> incognitoTabModelFilterSupplier,
@NonNull OnClickListener newTabButtonClickListener,
@Nullable OneshotSupplier<IncognitoReauthController> incognitoReauthControllerSupplier,
@NonNull DoubleConsumer onToolbarAlphaChange,
@NonNull UserEducationHelper userEducationHelper) {
@NonNull UserEducationHelper userEducationHelper,
@NonNull ObservableSupplier<EdgeToEdgeController> edgeToEdgeSupplier) {
super(
context,
profileProviderSupplier,
Expand All @@ -42,7 +45,8 @@ public BraveIncognitoTabSwitcherPane(
newTabButtonClickListener,
incognitoReauthControllerSupplier,
onToolbarAlphaChange,
userEducationHelper);
userEducationHelper,
edgeToEdgeSupplier);

ResourceButtonData newReferenceButtonData =
new ResourceButtonData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@

import androidx.annotation.NonNull;

import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.chrome.browser.hub.HubContainerView;
import org.chromium.chrome.browser.hub.HubLayoutAnimatorProvider;
import org.chromium.chrome.browser.profiles.ProfileProvider;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tasks.tab_management.TabListCoordinator.TabListMode;
import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController;
import org.chromium.chrome.browser.user_education.UserEducationHelper;

import java.util.function.DoubleConsumer;
Expand All @@ -26,14 +28,16 @@ public abstract class BraveTabSwitcherPaneBase extends TabSwitcherPaneBase {
@NonNull TabSwitcherPaneCoordinatorFactory factory,
boolean isIncognito,
@NonNull DoubleConsumer onToolbarAlphaChange,
@NonNull UserEducationHelper userEducationHelper) {
@NonNull UserEducationHelper userEducationHelper,
@NonNull ObservableSupplier<EdgeToEdgeController> edgeToEdgeSupplier) {
super(
context,
profileProviderSupplier,
factory,
isIncognito,
onToolbarAlphaChange,
userEducationHelper);
userEducationHelper,
edgeToEdgeSupplier);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,6 @@
The price of this item recently dropped from <ph name="PREVIOUS_PRICE">%1$s<ex>$42</ex></ph> to <ph name="NEW_PRICE">%2$s<ex>$30</ex></ph>
</message>

<!-- Price Alerts Card strings -->
<message name="IDS_PRICE_DROP_ALERTS_CARD_TITLE" desc="This text shows on the price drop alerts message card if any item in the open tabs has a price drop. It familiarizes users with the feature getting price drop alerts.">
Get alerts for price drops?
</message>
<message name="IDS_PRICE_DROP_ALERTS_CARD_GET_NOTIFIED_CONTENT" desc="This text shows below 'Get alerts for price drops?'. It describes what will happen when clicking 'Get notified' button.">
You'll get an alert when there's a lower price in an open tab
</message>
<message name="IDS_PRICE_DROP_ALERTS_CARD_GET_NOTIFIED" desc="This text button shows below 'Get alerts for price drops?'. When user clicks on the text button, the price drop notifications feature will be turned on.">
Get notified
</message>
<message name="IDS_PRICE_DROP_ALERTS_CARD_GO_TO_SETTINGS_CONTENT" desc="This text shows below 'Get alerts for price drops?'. It asks users to turn on notifications in Android settings to get the price drop notifications.">
To get an alert when there's a lower price in an open tab, turn on notifications in Settings.
</message>

<!-- Price Tracking Settings Dialog strings -->
<message name="IDS_TRACK_PRICES_ON_TABS" desc="This text shows in the price tracking settings dialog. It tells users the switch on the side can be used to turn on/off the 'Track prices on tabs' feature.">
Track prices on tabs
Expand Down Expand Up @@ -803,6 +789,9 @@
<message name="IDS_OPEN_NEW_TAB_IN_GROUP_CONTEXT_MENU_ITEM" desc="Menu item text which will be display for tab group context menu on strip to allow opening a new tab in the tab group.">
New tab in group
</message>
<message name="IDS_SHARE_TAB_GROUP_CONTEXT_MENU_ITEM" desc="Menu item text which will be display for tab group context menu on strip to allow sharing a tab group.">
Share group
</message>
<message name="IDS_TAB_GROUP_RENAME_DIALOG_TITLE" desc="When users edit an existing tab group, a dialog will pop up and this text is the title of that dialog. [CHAR_LIMIT=24]">
Rename tab group
</message>
Expand Down Expand Up @@ -832,17 +821,39 @@
<message name="IDS_CLOSE_FROM_GROUP_DIALOG_TITLE" desc="Title of a dialog asking if the user really wants to close a tab and group.">
Close tab and delete group?
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_TITLE" desc="Title of a dialog asking the user if they want to keep the tab group.">
Keep tab group?
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_DESCRIPTION_OWNER" desc="Main text content of a dialog asking the owner of a shared group if they want to keep it. The &#10; is a newline character to force formatting.">
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 "<ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>" tab group, and it will be deleted from all devices.
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_DESCRIPTION_MEMBER" desc="Main text content of a dialog asking a member of a shared group if they want to keep it or leave. The &#10; is a newline character to force formatting.">
Keep this group to add tabs later, or leave.

If you leave, you will immediately lose access to the "<ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>" tab group.
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_KEEP_ACTION" desc="Action button to keep the tab group in the keep group dialog.">
Keep group
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_DELETE_ACTION" desc="Action button for the owner of a group to delete the tab group in the keep group dialog.">
Delete group
</message>
<message name="IDS_KEEP_TAB_GROUP_DIALOG_LEAVE_ACTION" desc="Action button for a member of a group to leave the tab group in the keep group dialog.">
Leave group
</message>
<message name="IDS_CLOSE_TAB_GROUP_MENU_ITEM" desc="Menu item text which will prompt a confirmation dialog to close a tab group.">
Close
</message>
<message name="IDS_RENAME_TAB_GROUP_MENU_ITEM" desc="Menu item text which will prompt a confirmation dialog to rename a tab group.">
Rename
</message>
<message name="IDS_ACCESSIBILITY_OPEN_TAB_GROUP_OVERFLOW_MENU_WITH_GROUP_NAME" desc="Accessibility string for opening the overflow menu on a tab group, which will allow the user to perform several actions on the tab group. TITLE_OF_GROUP is the title of the group.">
Open the tab group action menu for tab group <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>
<message name="IDS_ACCESSIBILITY_OPEN_TAB_GROUP_OVERFLOW_MENU_WITH_GROUP_NAME_WITH_COLOR" desc="Accessibility string for opening the overflow menu on a tab group, which will allow the user to perform several actions on the tab group. TITLE_OF_GROUP is the title of the group. COLOR_NAME is the color of the group.">
Open the tab group action menu for tab group <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>, color <ph name="COLOR_NAME">%2$s<ex>Blue</ex></ph>.
</message>
<message name="IDS_ACCESSIBILITY_OPEN_SHARED_TAB_GROUP_OVERFLOW_MENU_WITH_GROUP_NAME" desc="Accessibility string for opening the overflow menu on a shared tab group, which will allow the user to perform several actions on the tab group. TITLE_OF_GROUP is the title of the group.">
Open the tab group action menu for shared tab group <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>
<message name="IDS_ACCESSIBILITY_OPEN_SHARED_TAB_GROUP_OVERFLOW_MENU_WITH_GROUP_NAME_WITH_COLOR" desc="Accessibility string for opening the overflow menu on a shared tab group, which will allow the user to perform several actions on the tab group. TITLE_OF_GROUP is the title of the group. COLOR_NAME is the color of the group.">
Open the tab group action menu for shared tab group <ph name="TITLE_OF_GROUP">%1$s<ex>Shopping cart</ex></ph>, color <ph name="COLOR_NAME">%2$s<ex>Blue</ex></ph>.
</message>
<message name="IDS_CLOSE_FROM_GROUP_DESCRIPTION" desc="Description of the action of deleting a tab and a group, shown in a confirmation dialog.">
This will delete the group from all devices signed into <ph name="USER_EMAIL">%1$s<ex>test@gmail.com</ex></ph>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.chrome.browser.toolbar.top.Toolbar;
import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
import org.chromium.ui.UiUtils;
Expand Down Expand Up @@ -58,7 +59,8 @@ public BraveFeedSurfaceCoordinator(
boolean overScrollDisabled,
@Nullable ViewGroup viewportView,
FeedActionDelegate actionDelegate,
@NonNull ObservableSupplier<Integer> tabStripHeightSupplier) {
@NonNull ObservableSupplier<Integer> tabStripHeightSupplier,
ObservableSupplier<EdgeToEdgeController> edgeToEdgeControllerSupplier) {
super(
activity,
snackbarManager,
Expand All @@ -81,7 +83,8 @@ public BraveFeedSurfaceCoordinator(
overScrollDisabled,
viewportView,
actionDelegate,
tabStripHeightSupplier);
tabStripHeightSupplier,
edgeToEdgeControllerSupplier);
}

public void createFrameLayoutForPolicy() {
Expand Down
24 changes: 7 additions & 17 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
public <init>(...);
}

-keep class org.chromium.chrome.browser.settings.SettingsLauncherImpl {
-keep class org.chromium.chrome.browser.settings.SettingsNavigationImpl {
<init>(...);
}

Expand Down Expand Up @@ -591,7 +591,7 @@
*** get(...);
}

-keep class org.chromium.chrome.browser.partnercustomizations.CustomizationProviderDelegateImpl {
-keep class org.chromium.chrome.browser.partnercustomizations.CustomizationProviderDelegateUpstreamImpl {
public <init>(...);
}

Expand Down Expand Up @@ -645,20 +645,20 @@
public <init>(...);
}

-keep class org.chromium.chrome.browser.AppHooksImpl {
-keep class org.chromium.chrome.browser.AppHooks {
public <init>(...);
}

-keep class org.chromium.chrome.browser.BraveAppHooks {
public <init>(...);
}

-keep class org.chromium.base.cached_flags.CachedFlag {
-keep class org.chromium.components.cached_flags.CachedFlag {
*** mDefaultValue;
<init>(...);
}

-keep class org.chromium.base.cached_flags.BraveCachedFlag {
-keep class org.chromium.components.cached_flags.BraveCachedFlag {
<init>(...);
}

Expand Down Expand Up @@ -745,12 +745,12 @@
public <init>(...);
}

-keep class org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter {
-keep class org.chromium.chrome.browser.tabmodel.TabGroupModelFilterImpl {
*** mIsResetting;
public <init>(...);
}

-keep class org.chromium.chrome.browser.tasks.tab_groups.BraveTabGroupModelFilter {
-keep class org.chromium.chrome.browser.tabmodel.BraveTabGroupModelFilter {
public <init>(...);
}

Expand Down Expand Up @@ -791,16 +791,6 @@
public <init>(...);
}

-keep class org.chromium.components.language.LocaleManagerDelegateImpl {
public <init>(...);
*** getApplicationLocale(...);
*** setApplicationLocale(...);
}

-keep class org.chromium.components.language.BraveLocaleManagerDelegateImpl {
public <init>(...);
}

-keep class org.chromium.chrome.browser.compositor.layouts.ToolbarSwipeLayout {
public <init>(...);
*** mMoveToolbar;
Expand Down
14 changes: 7 additions & 7 deletions android/java/org/chromium/base/BraveReflectionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public static Object invokeMethod(
return toInvoke.invoke(obj, args);
} catch (IllegalAccessException e) {
Log.e(TAG, "Illegal access for method: " + e);
assert (false);
assert false;
} catch (InvocationTargetException e) {
Log.e(TAG, "Method invocation error e: " + e);
assert (false);
assert false;
}
} catch (NoSuchMethodException e) {
Log.e(TAG, "Method not found: " + e);
assert (false);
assert false;
}
return null;
}
Expand All @@ -59,10 +59,10 @@ public static Object getField(Class ownerClass, String fieldName, Object obj) {
return field.get(obj);
} catch (NoSuchFieldException e) {
Log.e(TAG, "Field not found: " + e);
assert (false);
assert false;
} catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
Log.e(TAG, "Get field failed: " + e);
assert (false);
assert false;
}
return null;
}
Expand All @@ -74,10 +74,10 @@ public static void setField(Class ownerClass, String fieldName, Object obj, Obje
field.set(obj, newValue);
} catch (NoSuchFieldException e) {
Log.e(TAG, "Field not found: " + e);
assert (false);
assert false;
} catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
Log.e(TAG, "Get field failed: " + e);
assert (false);
assert false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmark;

public class BraveAppHooks extends AppHooksImpl {
public class BraveAppHooks extends AppHooks {
@Override
public PartnerBookmark.BookmarkIterator getPartnerBookmarkIterator() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public String call() {
}

private static String getUrlForCustomTab(Intent intent) {
assert (false);
assert false;
return null;
}

private static String getUrlForWebapp(Intent intent) {
assert (false);
assert false;
return null;
}

private static boolean isJavascriptSchemeOrInvalidUrl(String url) {
assert (false);
assert false;
return false;
}
}
Loading
Loading