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 99 to Chromium 100 (uplift to 1.37.x) #12683

Merged
merged 1 commit into from
Mar 22, 2022
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
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ patches/*.java.patch @samartnik
# Bitcoin-core
third_party/bitcoin-core/BUILD.gn @orspetol

# Boost imports (i.e. config, multiprecision)
third_party/boost @brave/deps-reviewers

# Network auditor
browser/net/brave_network_audit_allowed_lists.h @brave/sec-team

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ patches/**/*.patchinfo
/third_party/argon2/src
/third_party/ethash/src
/third_party/bitcoin-core/src
/third_party/boost/config
/third_party/boost/multiprecision
/third_party/rust/cxx
*.xcodeproj
*.swp
Expand Down
29 changes: 19 additions & 10 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,21 @@ if (!is_ios) {
branding_dir = "//chrome/app/theme/$branding_path_component"
copy("theme_files") {
visibility = [ ":*" ]
sources = [
"$branding_dir/product_logo_128_beta.png",
"$branding_dir/product_logo_128_dev.png",
"$branding_dir/product_logo_128_development.png",
"$branding_dir/product_logo_128_nightly.png",
]
if (is_linux) {
sources = [
"$branding_dir/linux/product_logo_128_beta.png",
"$branding_dir/linux/product_logo_128_dev.png",
"$branding_dir/linux/product_logo_128_development.png",
"$branding_dir/linux/product_logo_128_nightly.png",
]
} else {
sources = [
"$branding_dir/product_logo_128_beta.png",
"$branding_dir/product_logo_128_dev.png",
"$branding_dir/product_logo_128_development.png",
"$branding_dir/product_logo_128_nightly.png",
]
}
outputs = [ "$root_out_dir/installer/theme/{{source_file_part}}" ]
}

Expand Down Expand Up @@ -221,7 +230,7 @@ if (!is_mac && !is_android && !is_ios) {
deps = [ "//chrome:packed_resources" ]

sources = []
foreach(locale, locales) {
foreach(locale, platform_pak_locales) {
sources += [ "$root_out_dir/locales/$locale.pak" ]
}
outputs = [ "$brave_dist_dir/locales/{{source_file_part}}" ]
Expand All @@ -235,7 +244,7 @@ if (!is_mac && !is_android && !is_ios) {
]

public_deps = []
foreach(locale, locales) {
foreach(locale, platform_pak_locales) {
# public_deps is used intentionaly because ":create_dist_zip" needs the all dependency
# of all locale files.
public_deps += [
Expand All @@ -245,7 +254,7 @@ if (!is_mac && !is_android && !is_ios) {
}
}

foreach(locale, locales) {
foreach(locale, platform_pak_locales) {
copy("brave_rewards_locales_${locale}") {
deps = [ "//brave/components/brave_rewards/resources/extension:locales_$locale" ]

Expand Down Expand Up @@ -392,7 +401,7 @@ action("create_dist_zips") {
inputs += get_target_outputs(":brave_dist_resources")
inputs += get_target_outputs(":brave_locale_dist_resources")
if (enable_extensions) {
foreach(locale, locales) {
foreach(locale, platform_pak_locales) {
inputs += get_target_outputs(":brave_shields_locales_${locale}")
inputs += get_target_outputs(":brave_rewards_locales_${locale}")
}
Expand Down
2 changes: 2 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ deps = {
"third_party/ethash/src": "https://github.com/chfast/ethash.git@e4a15c3d76dc09392c7efd3e30d84ee3b871e9ce",
"third_party/bitcoin-core/src": "https://github.com/bitcoin/bitcoin.git@95ea54ba089610019a74c1176a2c7c0dba144b1c",
"third_party/argon2/src": "https://github.com/P-H-C/phc-winner-argon2.git@62358ba2123abd17fccf2a108a301d4b52c01a7c",
"third_party/boost/config": "https://github.com/boostorg/config.git@e108255ffb5d2557ed3398b3fc575a2e9fd434cc",
"third_party/boost/multiprecision": "https://github.com/boostorg/multiprecision.git@db0bb4d2d2611605b7ce97220fb9973fd7e072c9",
}

recursedeps = [
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/site_settings/DesktopModePreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/site_settings/PlayYTVideoInBrowserPreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/suggestions/tile/BraveTileView.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/BraveAndroidSyncSettings.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/BraveSyncDevices.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java",
"../../brave/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java",
Expand Down
1 change: 1 addition & 0 deletions android/features/tab_ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ android_library("java") {
"//chrome/browser/preferences:java",
"//chrome/browser/tabmodel:java",
"//chrome/browser/ui/android/theme:java",
"//chrome/browser/ui/android/toolbar:java",
"//chrome/browser/ui/messages/android:java",
"//components/browser_ui/bottomsheet/android:java",
"//components/browser_ui/widget/android:java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

Expand All @@ -22,8 +23,10 @@
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.share.ShareDelegate;
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.toolbar.bottom.BottomControlsCoordinator;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.tab_ui.R;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
Expand All @@ -35,6 +38,10 @@ public class BraveTabGroupUiCoordinator extends TabGroupUiCoordinator {
// To delete in bytecode, members from parent class will be used instead.
private TabGroupUiToolbarView mToolbarView;

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

public BraveTabGroupUiCoordinator(@NonNull Activity activity, @NonNull ViewGroup parentView,
@NonNull IncognitoStateProvider incognitoStateProvider,
@NonNull ScrimCoordinator scrimCoordinator,
Expand All @@ -55,6 +62,8 @@ public BraveTabGroupUiCoordinator(@NonNull Activity activity, @NonNull ViewGroup
dynamicResourceLoaderSupplier, tabCreatorManager, shareDelegateSupplier,
overviewModeBehaviorSupplier, snackbarManager);

mIncognitoStateProvider = incognitoStateProvider;

assert mToolbarView != null : "Make sure mToolbarView is properly patched in bytecode.";
ChromeImageView fadingEdgeStart =
mToolbarView.findViewById(R.id.tab_strip_fading_edge_start);
Expand All @@ -73,4 +82,30 @@ public BraveTabGroupUiCoordinator(@NonNull Activity activity, @NonNull ViewGroup
toolbarRightButton.setImageResource(R.drawable.brave_new_group_tab);
}
}

@Override
public void initializeWithNative(Activity activity,
BottomControlsCoordinator.BottomControlsVisibilityController visibilityController) {
super.initializeWithNative(activity, visibilityController);

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.getResources().getColor(R.color.dialog_bg_color_baseline));
}
}
};
mIncognitoStateProvider.addIncognitoStateObserverAndTrigger(mIncognitoStateObserver);
}

@Override
public void destroy() {
super.destroy();

mIncognitoStateProvider.removeObserver(mIncognitoStateObserver);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import androidx.annotation.Nullable;

import org.chromium.chrome.browser.feed.sort_ui.FeedOptionsCoordinator;
import org.chromium.ui.modelutil.PropertyModel;

public class BraveFeedSurfaceMediator extends FeedSurfaceMediator {
Expand All @@ -19,9 +20,10 @@ public class BraveFeedSurfaceMediator extends FeedSurfaceMediator {

BraveFeedSurfaceMediator(FeedSurfaceCoordinator coordinator, Context context,
@Nullable SnapScrollHelper snapScrollHelper, PropertyModel headerModel,
@FeedSurfaceCoordinator.StreamTabId int openingTabId,
FeedActionDelegate actionDelegate) {
super(coordinator, context, snapScrollHelper, headerModel, openingTabId, actionDelegate);
@FeedSurfaceCoordinator.StreamTabId int openingTabId, FeedActionDelegate actionDelegate,
FeedOptionsCoordinator optionsCoordinator) {
super(coordinator, context, snapScrollHelper, headerModel, openingTabId, actionDelegate,
optionsCoordinator);
}

@Override
Expand Down
18 changes: 5 additions & 13 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
# needed for checking of existence for bytecode manipulation
-keepnames class org.chromium.chrome.browser.settings.MainSettings

-keep class org.chromium.chrome.browser.sync.AndroidSyncSettings {
*** updateCachedSettings(...);
*** setChromeSyncEnabled(...);
*** mIsSyncable;
*** mChromeSyncEnabled;
*** mMasterSyncEnabled;
}

-keep class org.chromium.chrome.browser.bookmarks.BookmarkBridge {
*** extensiveBookmarkChangesBeginning(...);
*** extensiveBookmarkChangesEnded(...);
Expand Down Expand Up @@ -66,7 +58,7 @@
-keep class org.chromium.chrome.browser.sync.settings.ManageSyncSettings {
*** mGoogleActivityControls;
*** mSyncEncryption;
*** mManageSyncData;
*** mReviewSyncData;
*** mSyncPaymentsIntegration;
*** mTurnOffSync;
}
Expand Down Expand Up @@ -203,14 +195,14 @@
}

-keep class org.chromium.chrome.browser.toolbar.bottom.BottomControlsMediator {
public <init>(...);
<init>(...);
*** mBottomControlsHeight;
*** mModel;
*** mBrowserControlsSizer;
}

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

-keep class org.chromium.chrome.browser.query_tiles.QueryTileSection {
Expand Down Expand Up @@ -336,14 +328,14 @@
}

-keep class org.chromium.chrome.browser.feed.FeedSurfaceMediator {
public <init>(...);
<init>(...);
*** mCoordinator;
*** mSnapScrollHelper;
*** destroyPropertiesForStream(...);
}

-keep class org.chromium.chrome.browser.feed.BraveFeedSurfaceMediator {
public <init>(...);
<init>(...);
*** mCoordinator;
*** mSnapScrollHelper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ public void OnStartProcess() {
public void showLikePopDownMenu(int xOffset, int yOffset) {
this.preShow();

this.window.setAnimationStyle(R.style.OverflowMenuAnim);
this.window.setAnimationStyle(R.style.EndIconMenuAnim);

if (SysUtils.isLowEndDevice()) {
this.window.setAnimationStyle(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1209,4 +1209,10 @@ public void initializeCompositor() {
BraveTabUiFeatureUtilities.maybeOverrideEnableTabGroupAutoCreationPreference(
ContextUtils.getApplicationContext());
}

@Override
protected boolean supportsDynamicColors() {
// Dynamic colors cause styling issues with Brave theme.
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void attachBaseContext(Context context) {
} else {
context = SplitCompatApplication.createChromeContext(context);
}
mImpl = (Impl) SplitCompatUtils.newInstance(context, mServiceClassName);
mImpl = (Impl) BundleUtils.newInstance(context, mServiceClassName);
mImpl.setService(this);
super.attachBaseContext(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public BraveTalkOptInPopup(View anchor, BraveTalkOptInPopupListener listener) {
}

public void showLikePopDownMenu() {
mWindow.setAnimationStyle(R.style.OverflowMenuAnim);
mWindow.setAnimationStyle(R.style.EndIconMenuAnim);

if (SysUtils.isLowEndDevice()) {
mWindow.setAnimationStyle(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ public void showLikePopDownMenu() {
mPopupWindow.setFocusable(true);
mPopupWindow.setOutsideTouchable(true);

mPopupWindow.setAnimationStyle(R.style.OverflowMenuAnim);
mPopupWindow.setAnimationStyle(R.style.EndIconMenuAnim);

if (SysUtils.isLowEndDevice()) {
mPopupWindow.setAnimationStyle(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ private void updateBravePreferences() {
// Below prefs are removed from main settings.
removePreferenceIfPresent(MainSettings.PREF_SYNC_PROMO);
removePreferenceIfPresent(MainSettings.PREF_SIGN_IN);
removePreferenceIfPresent(MainSettings.PREF_DATA_REDUCTION);
removePreferenceIfPresent(MainSettings.PREF_SEARCH_ENGINE);
removePreferenceIfPresent(MainSettings.PREF_UI_THEME);
removePreferenceIfPresent(MainSettings.PREF_DOWNLOADS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,11 +1369,8 @@ public void run() {
}

private void setSyncDoneLayout() {
if (SyncSettingsUtils.getSyncError() == SyncError.ANDROID_SYNC_DISABLED) {
mBraveSyncBtnAndroidSyncSettings.setVisibility(View.VISIBLE);
} else {
mBraveSyncBtnAndroidSyncSettings.setVisibility(View.GONE);
}
// We probably don't need this UI element anymore.
mBraveSyncBtnAndroidSyncSettings.setVisibility(View.GONE);

if (!deviceInfoObserverSet) {
BraveSyncDevices.get().addDeviceInfoChangedListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.chromium.chrome.browser.settings;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
Expand Down Expand Up @@ -46,6 +47,7 @@ public class BraveWebrtcPolicyPreference
protected static final String FALLBACK_SUPPORT_URL =
"https://support.brave.com/hc/en-us/articles/360017989132-How-do-I-change-my-Privacy-Settings-#webrtc";

@SuppressLint("WrongConstant")
public BraveWebrtcPolicyPreference(Context context, AttributeSet attrs) {
super(context, attrs);

Expand Down Expand Up @@ -96,6 +98,7 @@ public void onClick(View v) {
}

@Override
@SuppressLint("WrongConstant")
public void onCheckedChanged(RadioGroup group, int checkedId) {
for (int i = 0; i < WebrtcPolicy.NUM_ENTRIES; i++) {
if (mButtons.get(i).isChecked()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
import org.chromium.chrome.browser.preferences.BravePreferenceKeys;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;

public class BraveShareDelegateImpl extends ShareDelegateImpl {
public BraveShareDelegateImpl(BottomSheetController controller,
ActivityLifecycleDispatcher lifecycleDispatcher, Supplier<Tab> tabProvider,
ShareSheetDelegate delegate, boolean isCustomTab) {
super(controller, lifecycleDispatcher, tabProvider, delegate, isCustomTab);
Supplier<TabModelSelector> tabModelSelectorProvider, ShareSheetDelegate delegate,
boolean isCustomTab) {
super(controller, lifecycleDispatcher, tabProvider, tabModelSelectorProvider, delegate,
isCustomTab);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public PopupWindow showPopupMenu(View anchorView) {
//Set the location of the window on the screen
popupWindow.showAsDropDown(anchorView, 0, 0);
popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
popupWindow.setAnimationStyle(R.style.OverflowMenuAnim);
popupWindow.setAnimationStyle(R.style.EndIconMenuAnim);

// Turn off window animations for low end devices, and on Android M, which has built-in menu
// animations.
Expand Down Expand Up @@ -579,7 +579,7 @@ public void onClick(View view) {
ImageView mBlockShieldsIcon = mShieldsLayout.findViewById(R.id.toggle_favicon);
mBlockShieldsIcon.setImageResource(R.drawable.ic_chevron_right);
mBlockShieldsIcon.setColorFilter(
mContext.getResources().getColor(R.color.default_icon_color_tint_list));
mContext.getResources().getColor(R.color.default_icon_color_baseline));
TextView mBlockShieldsText = mShieldsLayout.findViewById(R.id.toggle_text);
mBlockShieldsText.setText(titleStringId);

Expand Down
Loading