Skip to content

Commit

Permalink
Merge pull request #14969 from brave/cr107
Browse files Browse the repository at this point in the history
Upgrade from Chromium 106 to Chromium 107
  • Loading branch information
bsclifton authored and emerick committed Oct 15, 2022
1 parent 63f9f4a commit c1abf25
Show file tree
Hide file tree
Showing 969 changed files with 6,205 additions and 6,146 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ deps = {
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bat-native-bip39wally-core.git@0d3a8713a2b388d2156fe49a70ef3f7cdb44b190",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@e3742ba3e8942eea9e4755d91532491871bd3116",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@800f9d40b7409239ff192e0be634764e747c7a75",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@c5d6d74fdbee467732bcb6b9084514839e656286",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@419995e4a873c294f1eaefca276f8ad25328e89f",
"vendor/gn-project-generators": "https://github.com/brave/gn-project-generators.git@b76e14b162aa0ce40f11920ec94bfc12da29e5d0",
"vendor/web-discovery-project": "https://github.com/brave/web-discovery-project@c4775a115f0800e0961e077d6a89b35cf92d3928",
"third_party/ethash/src": "https://github.com/chfast/ethash.git@e4a15c3d76dc09392c7efd3e30d84ee3b871e9ce",
Expand Down
1 change: 1 addition & 0 deletions android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import("//brave/android/features/tab_ui/brave_tab_management_java_sources.gni")
import("//brave/android/feed/brave_feed_java_sources.gni")
import("//brave/browser/brave_ads/android/java_sources.gni")
import("//brave/browser/flags/brave_flags_java_sources.gni")
import("//brave/browser/share/android/java_sources.gni")
import("//brave/components/brave_referrals/buildflags/buildflags.gni")
import("//brave/components/permissions/android/java_sources.gni")
Expand Down
29 changes: 29 additions & 0 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
*** mTabContentManager;
*** mTabCreatorManager;
*** mSnackbarManager;
*** mTabObscuringHandler;
*** onOrientationChange(...);
*** updateBookmarkButtonStatus(...);
*** updateReloadState(...);
Expand Down Expand Up @@ -585,3 +586,31 @@
-keep class org.chromium.chrome.browser.tasks.ReturnToChromeUtil {
*** shouldShowTabSwitcher(...);
}

-keep class org.chromium.chrome.browser.IntentHandler {
public <init>(...);
*** getUrlForCustomTab(...);
*** getUrlForWebapp(...);
*** isJavascriptSchemeOrInvalidUrl(...);
*** extractUrlFromIntent(...);
}

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

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

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

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

-keep class org.chromium.chrome.browser.flags.BraveCachedFlag {
<init>(...);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package org.chromium.chrome.browser.crash;

import org.chromium.base.annotations.MainDex;
import org.chromium.base.annotations.UsedByReflection;
import org.chromium.build.annotations.MainDex;
import org.chromium.build.annotations.UsedByReflection;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
// This function used when we have scanned the QR code to connect to the chain
private void seedHexReceived(String seedHex) {
assert seedHex != null && !seedHex.isEmpty();
assert isSeedHexValid(seedHex);
boolean seedHexValid = isSeedHexValid(seedHex);
assert seedHexValid;

if (null == getActivity()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.chrome.browser.tab.SadTab;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObscuringHandler;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
Expand All @@ -70,7 +71,6 @@
import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback;
import org.chromium.chrome.browser.toolbar.top.ToolbarControlContainer;
import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator;
import org.chromium.chrome.browser.ui.TabObscuringHandler;
import org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator;
import org.chromium.chrome.browser.ui.appmenu.AppMenuDelegate;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
Expand Down Expand Up @@ -113,6 +113,7 @@ public class BraveToolbarManager extends ToolbarManager {
private TabContentManager mTabContentManager;
private TabCreatorManager mTabCreatorManager;
private SnackbarManager mSnackbarManager;
private TabObscuringHandler mTabObscuringHandler;

// Own members.
private boolean mIsBottomToolbarVisible;
Expand Down Expand Up @@ -235,7 +236,7 @@ public void enableBottomControls() {
/* Below are parameters for BottomControlsCoordinator */
mActivity, mWindowAndroid, mLayoutManager,
mCompositorViewHolder.getResourceManager(), mBrowserControlsSizer,
mFullscreenManager, mBottomControls, mTabGroupUi,
mFullscreenManager, mBottomControls, mTabGroupUi, mTabObscuringHandler,
mOverlayPanelVisibilitySupplier, getConstraintsProxy()));
mBottomControls.setBottomControlsCoordinatorSupplier(
mBottomControlsCoordinatorSupplier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.chromium.chrome.browser.fullscreen.FullscreenManager;
import org.chromium.chrome.browser.layouts.LayoutManager;
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
import org.chromium.chrome.browser.tab.TabObscuringHandler;
import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.toolbar.HomeButton;
Expand Down Expand Up @@ -61,12 +62,12 @@ public BraveBottomControlsCoordinator(
Activity activity, WindowAndroid windowAndroid, LayoutManager layoutManager,
ResourceManager resourceManager, BrowserControlsSizer controlsSizer,
FullscreenManager fullscreenManager, ScrollingBottomViewResourceFrameLayout root,
BottomControlsContentDelegate contentDelegate,
BottomControlsContentDelegate contentDelegate, TabObscuringHandler tabObscuringHandler,
ObservableSupplier<Boolean> overlayPanelVisibilitySupplier,
ObservableSupplier<Integer> constraintsSupplier) {
super(activity, windowAndroid, layoutManager, resourceManager, controlsSizer,
fullscreenManager, root, contentDelegate, overlayPanelVisibilitySupplier,
constraintsSupplier);
fullscreenManager, root, contentDelegate, tabObscuringHandler,
overlayPanelVisibilitySupplier, constraintsSupplier);

mTabSwitcherLongclickListener = tabSwitcherLongclickListener;
mTabProvider = tabProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ public void onPageLoadFinished(final Tab tab, GURL url) {
}

@Override
public void onDidFinishNavigation(Tab tab, NavigationHandle navigation) {
public void onDidFinishNavigationInPrimaryMainFrame(
Tab tab, NavigationHandle navigation) {
if (getToolbarDataProvider().getTab() == tab && mBraveRewardsNativeWorker != null
&& !tab.isIncognito()) {
mBraveRewardsNativeWorker.OnNotifyFrontTabUrlChanged(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,15 @@ public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer,
ObservableSupplier<AppMenuButtonHelper> appMenuButtonHelperSupplier,
ObservableSupplier<TabModelSelector> tabModelSelectorSupplier,
ObservableSupplier<Boolean> homepageEnabledSupplier,
ObservableSupplier<Boolean> identityDiscStateSupplier,
Callback<Runnable> invalidatorCallback, Supplier<ButtonData> identityDiscButtonSupplier,
ButtonDataProvider identityDiscController, Callback<Runnable> invalidatorCallback,
Supplier<ButtonData> identityDiscButtonSupplier,
Supplier<ResourceManager> resourceManagerSupplier,
ObservableSupplier<Boolean> isProgressBarVisibleSupplier,
BooleanSupplier isIncognitoModeEnabledSupplier, boolean isGridTabSwitcherEnabled,
boolean isTabletGtsPolishEnabled, boolean isTabToGtsAnimationEnabled,
boolean isStartSurfaceEnabled, boolean isTabGroupsAndroidContinuationEnabled,
HistoryDelegate historyDelegate, BooleanSupplier partnerHomepageEnabledSupplier,
OfflineDownloader offlineDownloader, boolean initializeWithIncognitoColors,
ObservableSupplier<Profile> profileSupplier,
Callback<LoadUrlParams> startSurfaceLogoClickedCallback,
boolean isStartSurfaceRefactorEnabled,
ObservableSupplier<Integer> constraintsSupplier) {
Expand All @@ -74,13 +73,13 @@ public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer,
layoutStateProviderSupplier, normalThemeColorProvider, overviewThemeColorProvider,
browsingModeMenuButtonCoordinator, overviewModeMenuButtonCoordinator,
appMenuButtonHelperSupplier, tabModelSelectorSupplier, homepageEnabledSupplier,
identityDiscStateSupplier, invalidatorCallback, identityDiscButtonSupplier,
identityDiscController, invalidatorCallback, identityDiscButtonSupplier,
resourceManagerSupplier, isProgressBarVisibleSupplier,
isIncognitoModeEnabledSupplier, isGridTabSwitcherEnabled, isTabletGtsPolishEnabled,
isTabToGtsAnimationEnabled, isStartSurfaceEnabled,
isTabGroupsAndroidContinuationEnabled, historyDelegate,
partnerHomepageEnabledSupplier, offlineDownloader, initializeWithIncognitoColors,
profileSupplier, startSurfaceLogoClickedCallback, isStartSurfaceRefactorEnabled,
startSurfaceLogoClickedCallback, isStartSurfaceRefactorEnabled,
constraintsSupplier);

mBraveToolbarLayout = toolbarLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package org.chromium.chrome.browser.upgrade;

import org.chromium.base.annotations.IdentifierNameString;
import org.chromium.build.annotations.IdentifierNameString;
import org.chromium.chrome.browser.base.SplitCompatJobIntentService;

public class BraveUpgradeJobIntentService extends SplitCompatJobIntentService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package org.chromium.chrome.browser.vpn.wireguard;

import org.chromium.base.annotations.IdentifierNameString;
import org.chromium.build.annotations.IdentifierNameString;
import org.chromium.chrome.browser.base.SplitCompatService;

/** See {@link WireguardServiceImpl}. */
Expand Down
36 changes: 30 additions & 6 deletions android/javatests/org/chromium/chrome/browser/BytecodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Handler;
import android.util.AttributeSet;
Expand Down Expand Up @@ -71,6 +72,7 @@
import org.chromium.chrome.browser.share.crow.CrowButtonDelegate;
import org.chromium.chrome.browser.suggestions.tile.TileRenderer;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObscuringHandler;
import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager;
import org.chromium.chrome.browser.tabmodel.ChromeTabCreator;
import org.chromium.chrome.browser.tabmodel.ChromeTabCreator.OverviewNTPCreator;
Expand All @@ -79,6 +81,7 @@
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.theme.ThemeColorProvider;
import org.chromium.chrome.browser.theme.TopUiThemeColorProvider;
import org.chromium.chrome.browser.toolbar.ButtonDataProvider;
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
import org.chromium.chrome.browser.toolbar.ToolbarManager;
import org.chromium.chrome.browser.toolbar.ToolbarTabController;
Expand All @@ -88,7 +91,6 @@
import org.chromium.chrome.browser.toolbar.top.ToolbarControlContainer;
import org.chromium.chrome.browser.toolbar.top.ToolbarLayout;
import org.chromium.chrome.browser.toolbar.top.ToolbarTablet.OfflineDownloader;
import org.chromium.chrome.browser.ui.TabObscuringHandler;
import org.chromium.chrome.browser.ui.appmenu.AppMenuDelegate;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.native_page.NativePageHost;
Expand Down Expand Up @@ -285,6 +287,10 @@ public void testClassesExist() throws Exception {
Assert.assertTrue(
classExists("org/chromium/chrome/browser/omnibox/BraveLocationBarMediator"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/tasks/ReturnToChromeUtil"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/IntentHandler"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/BraveIntentHandler"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/flags/CachedFlag"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/flags/BraveCachedFlag"));
}

@Test
Expand Down Expand Up @@ -423,6 +429,14 @@ public void testMethodsExist() throws Exception {
"shouldShowDeleteButton", false, null));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/tasks/ReturnToChromeUtil",
"shouldShowTabSwitcher", true, boolean.class, long.class));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/IntentHandler",
"getUrlForCustomTab", true, String.class, Intent.class));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/IntentHandler",
"getUrlForWebapp", true, String.class, Intent.class));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/IntentHandler",
"isJavascriptSchemeOrInvalidUrl", true, boolean.class, String.class));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/IntentHandler",
"extractUrlFromIntent", true, String.class, Intent.class));
}

@Test
Expand All @@ -434,7 +448,7 @@ public void testMethodsForInvocationExist() throws Exception {
Assert.assertTrue(methodExists(
"org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator",
"createViewProvider", true, ViewProvider.class, Context.class,
MVCListAdapter.ModelList.class));
MVCListAdapter.ModelList.class, LocationBarDataProvider.class));

// Check for method type declaration changes here
Assert.assertTrue(methodExists(
Expand Down Expand Up @@ -517,7 +531,8 @@ public void testConstructorsExistAndMatch() throws Exception {
"org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator",
"org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator",
WindowAndroid.class, PropertyModel.class, BrowserControlsSizer.class,
FullscreenManager.class, int.class, ObservableSupplier.class));
FullscreenManager.class, TabObscuringHandler.class, int.class,
ObservableSupplier.class));
Assert.assertTrue(constructorsMatch(
"org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl",
"org/chromium/chrome/browser/app/appmenu/BraveAppMenuPropertiesDelegateImpl",
Expand Down Expand Up @@ -571,11 +586,11 @@ public void testConstructorsExistAndMatch() throws Exception {
List.class, OneshotSupplier.class, ThemeColorProvider.class,
ThemeColorProvider.class, MenuButtonCoordinator.class, MenuButtonCoordinator.class,
ObservableSupplier.class, ObservableSupplier.class, ObservableSupplier.class,
ObservableSupplier.class, Callback.class, Supplier.class, Supplier.class,
ButtonDataProvider.class, Callback.class, Supplier.class, Supplier.class,
ObservableSupplier.class, BooleanSupplier.class, boolean.class, boolean.class,
boolean.class, boolean.class, boolean.class, HistoryDelegate.class,
BooleanSupplier.class, OfflineDownloader.class, boolean.class,
ObservableSupplier.class, Callback.class, boolean.class, ObservableSupplier.class));
BooleanSupplier.class, OfflineDownloader.class, boolean.class, Callback.class,
boolean.class, ObservableSupplier.class));
Assert.assertTrue(constructorsMatch(
"org/chromium/chrome/browser/toolbar/menu_button/MenuButtonCoordinator",
"org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator",
Expand Down Expand Up @@ -661,6 +676,13 @@ public void testConstructorsExistAndMatch() throws Exception {
BraveLocationBarMediator.getLensControllerClass(), Runnable.class,
BraveLocationBarMediator.getSaveOfflineButtonStateClass(),
BraveLocationBarMediator.getOmniboxUmaClass(), BooleanSupplier.class));
Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/IntentHandler",
"org/chromium/chrome/browser/BraveIntentHandler", Activity.class,
IntentHandler.IntentHandlerDelegate.class));
Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/AppHooksImpl",
"org/chromium/chrome/browser/BraveAppHooks"));
Assert.assertTrue(constructorsMatch("org/chromium/chrome/browser/flags/CachedFlag",
"org/chromium/chrome/browser/flags/BraveCachedFlag", String.class, boolean.class));
}

@Test
Expand Down Expand Up @@ -761,6 +783,8 @@ public void testFieldsExist() throws Exception {
"org/chromium/chrome/browser/toolbar/ToolbarManager", "mTabCreatorManager"));
Assert.assertTrue(fieldExists(
"org/chromium/chrome/browser/toolbar/ToolbarManager", "mSnackbarManager"));
Assert.assertTrue(fieldExists(
"org/chromium/chrome/browser/toolbar/ToolbarManager", "mTabObscuringHandler"));
Assert.assertTrue(
fieldExists("org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator",
"mTabSwitcherModeCoordinator"));
Expand Down
5 changes: 3 additions & 2 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&blink::features::kSharedStorageAPI,
&blink::features::kSpeculationRulesPrefetchProxy,
&blink::features::kTextFragmentAnchor,
&commerce::kCommerceAllowOnDemandBookmarkUpdates,
&commerce::kCommerceDeveloper,
&commerce::kCommerceMerchantViewer,
&commerce::kCommercePriceTracking,
Expand All @@ -123,13 +124,14 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&features::kFirstPartySets,
&features::kIdleDetection,
&features::kIsolatePrerenders,
&features::kKAnonymityService,
&features::kNavigationRequestPreconnect,
&features::kNotificationTriggers,
&features::kOmniboxTriggerForNoStatePrefetch,
&features::kPrivacyGuide2,
&features::kPrivacySandboxAdsAPIsOverride,
&features::kSCTAuditing,
&features::kSignedExchangeSubresourcePrefetch,
&features::kSignedExchangeReportingForDistributors,
&features::kSignedHTTPExchange,
&features::kSubresourceWebBundles,
#if !BUILDFLAG(IS_ANDROID)
Expand All @@ -152,7 +154,6 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&optimization_guide::features::kRemoteOptimizationGuideFetching,
&optimization_guide::features::
kRemoteOptimizationGuideFetchingAnonymousDataConsent,
&password_manager::features::kUnifiedPasswordManagerDesktop,
#if !BUILDFLAG(IS_ANDROID)
&permissions::features::kPermissionsPostPromptSurvey,
&permissions::features::kRecordPermissionExpirationTimestamps,
Expand Down
Loading

0 comments on commit c1abf25

Please sign in to comment.