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 92 to Chromium 93 (1.29.x). #9832

Merged
merged 15 commits into from
Aug 26, 2021
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
  •  
  •  
  •  
11 changes: 2 additions & 9 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,10 @@ hooks = [
'action': ['vpython3', 'script/download_rust_deps.py', '--platform', 'ios'],
},
{
# Download rust deps if necessary for Windows
# Download rust deps if necessary for Windows, Linux, and macOS
'name': 'download_rust_deps',
'pattern': '.',
'condition': 'checkout_win',
'action': ['vpython', 'script/download_rust_deps.py'],
},
{
# Download rust deps if necessary for Linux and macOS
'name': 'download_rust_deps',
'pattern': '.',
'condition': 'not checkout_android and not checkout_ios and not checkout_win',
'condition': 'not checkout_android and not checkout_ios',
'action': ['vpython3', 'script/download_rust_deps.py'],
},
{
Expand Down
7 changes: 5 additions & 2 deletions android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTCoordinatorPhone.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTPhone.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java",
"../../brave/android/java/org/chromium/chrome/browser/ui/brave_tricks/checkbox_to_switch/CheckBoxPreference.java",
"../../brave/android/java/org/chromium/chrome/browser/ui/messages/infobar/BraveSimpleConfirmInfoBarBuilder.java",
Expand Down Expand Up @@ -292,7 +292,10 @@ brave_components_browser_ui_site_settings_android_java = [

brave_browser_ui_android_appmenu_internal_sources = [ "//brave/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/BraveAppMenu.java" ]

brave_browser_ui_android_toolbar_sources = [ "//brave/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java" ]
brave_browser_ui_android_toolbar_sources = [
"//brave/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java",
"//brave/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java",
]

brave_java_base_sources = [
"//brave/android/java/org/chromium/base/BraveCommandLineInitUtil.java",
Expand Down
7 changes: 7 additions & 0 deletions android/browsertests_apk/AndroidManifest.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
</intent-filter>
</activity>

<receiver android:name="org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidgetProvider"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>

<service android:name="org.chromium.components.background_task_scheduler.BackgroundTaskJobService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.widget.FrameLayout;
import android.widget.ScrollView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.chromium.base.ApiCompatibilityUtils;
Expand All @@ -21,18 +22,20 @@
import org.chromium.chrome.browser.ntp.ScrollableContainerDelegate;
import org.chromium.chrome.browser.ntp.SnapScrollHelper;
import org.chromium.chrome.browser.ntp.snippets.SectionHeaderView;
import org.chromium.chrome.browser.privacy.settings.PrivacyPreferencesManagerImpl;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.toolbar.top.Toolbar;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
import org.chromium.ui.UiUtils;
import org.chromium.ui.base.WindowAndroid;

public class BraveFeedSurfaceCoordinator extends FeedSurfaceCoordinator {
private Activity mActivity;
private ScrollView mScrollViewForPolicy;
// To delete in bytecode, members from parent class will be used instead.
private @Nullable ScrollView mScrollViewForPolicy;
private View mNtpHeader;
private FrameLayout mRootView;

Expand All @@ -44,11 +47,17 @@ public BraveFeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarMa
boolean isPlaceholderShownInitially, BottomSheetController bottomSheetController,
Supplier<ShareDelegate> shareDelegateSupplier,
@Nullable ScrollableContainerDelegate externalScrollableContainerDelegate,
TabModelSelector tabModelSelector, @NewTabPageLaunchOrigin int launchOrigin) {
@NewTabPageLaunchOrigin int launchOrigin,
PrivacyPreferencesManagerImpl privacyPreferencesManager,
@NonNull Supplier<Toolbar> toolbarSupplier,
FeedLaunchReliabilityLoggingState launchReliabilityLoggingState,
@Nullable FeedSwipeRefreshLayout swipeRefreshLayout, boolean overScrollDisabled) {
super(activity, snackbarManager, windowAndroid, snapScrollHelper, ntpHeader,
sectionHeaderView, showDarkBackground, delegate, pageNavigationDelegate, profile,
isPlaceholderShownInitially, bottomSheetController, shareDelegateSupplier,
externalScrollableContainerDelegate, tabModelSelector, launchOrigin);
externalScrollableContainerDelegate, launchOrigin, privacyPreferencesManager,
toolbarSupplier, launchReliabilityLoggingState, swipeRefreshLayout,
overScrollDisabled);
}

@Override
Expand Down Expand Up @@ -82,4 +91,8 @@ void createScrollViewForPolicy() {
public boolean isEnhancedProtectionPromoEnabled() {
return false;
}

public boolean isReliabilityLoggingEnabled() {
return false;
}
}
39 changes: 37 additions & 2 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,20 @@
}

-keep class org.chromium.chrome.browser.omnibox.suggestions.editurl.EditUrlSuggestionProcessor {
public <init>(...);
*** mHasClearedOmniboxForFocus;
}

-keep class org.chromium.chrome.browser.omnibox.suggestions.editurl.BraveEditUrlSuggestionProcessor {
public <init>(...);
}

-keep class org.chromium.chrome.browser.sync.settings.ManageSyncSettings {
*** mGoogleActivityControls;
*** mSyncEncryption;
*** mManageSyncData;
*** mSyncPaymentsIntegration;
*** mTurnOffSync;
}

-keep class org.chromium.chrome.browser.search_engines.settings.SearchEngineAdapter {
Expand Down Expand Up @@ -132,6 +138,11 @@
-keep class org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator {
*** mTabSwitcherModeCoordinatorPhone;
*** mOptionalButtonController;
public <init>(...);
}

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

-keep class org.chromium.chrome.browser.toolbar.top.TabSwitcherModeTTCoordinatorPhone {
Expand Down Expand Up @@ -281,7 +292,7 @@

-keep class org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar

-keep class org.chromium.chrome.browser.toolbar.top.BraveToolbarLayout
-keep class org.chromium.chrome.browser.toolbar.top.BraveToolbarLayoutImpl

-keep class org.chromium.chrome.browser.toolbar.top.ToolbarPhone

Expand Down Expand Up @@ -321,4 +332,28 @@

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

-keep class org.chromium.chrome.browser.feed.FeedSurfaceCoordinator {
*** mScrollViewForPolicy;
*** mNtpHeader;
*** mRootView;
*** isEnhancedProtectionPromoEnabled(...);
*** isReliabilityLoggingEnabled(...);
}

-keep class org.chromium.chrome.browser.feed.BraveFeedSurfaceCoordinator {
*** mScrollViewForPolicy;
*** mNtpHeader;
*** mRootView;
*** isEnhancedProtectionPromoEnabled(...);
*** isReliabilityLoggingEnabled(...);
}

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

-keep class org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator {
public <init>(...);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ public class BraveRewardsDonationSentActivity extends Activity implements BraveR
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.brave_rewards_donation_sent);
currentTabId_ = IntentUtils.safeGetIntExtra(getIntent(), BraveRewardsSiteBannerActivity.TAB_ID_EXTRA, -1);
currentTabId_ = IntentUtils.safeGetIntExtra(
getIntent(), BraveRewardsSiteBannerActivity.TAB_ID_EXTRA, -1);
mBraveRewardsNativeWorker = BraveRewardsNativeWorker.getInstance();
mBraveRewardsNativeWorker.AddObserver(this);

String publisherFavIconURL = mBraveRewardsNativeWorker.GetPublisherFavIconURL(currentTabId_);
String publisherFavIconURL =
mBraveRewardsNativeWorker.GetPublisherFavIconURL(currentTabId_);
Tab currentActiveTab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
String url = currentActiveTab.getUrlString();
String url = currentActiveTab.getUrl().getSpec();
String favicon_url = (publisherFavIconURL.isEmpty()) ? url : publisherFavIconURL;
mIconFetcher = new org.chromium.chrome.browser.BraveRewardsHelper(currentActiveTab);
mIconFetcher.retrieveLargeIcon(favicon_url, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private void retrieveLargeIconInternal() {
//favIconURL (or content URL) is still not available, try to read it again
if (mFaviconUrl == null || mFaviconUrl.isEmpty() || mFaviconUrl.equals("clear")) {
if (mTab != null) {
mFaviconUrl = mTab.getUrlString();
mFaviconUrl = mTab.getUrl().getSpec();
}

mHandler.postDelayed(new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void TriggerOnNotifyFrontTabUrlChanged() {
public void run() {
Tab tab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
if (tab != null && !tab.isIncognito()) {
OnNotifyFrontTabUrlChanged(tab.getId(), tab.getUrlString());
OnNotifyFrontTabUrlChanged(tab.getId(), tab.getUrl().getSpec());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,22 +938,23 @@ public void ShowRewardsSummary() {

public void ShowWebSiteView() {
tvBrBatWallet.setText(String.format(Locale.getDefault(), "%.3f", 0.0));
String usdText = String.format(this.root.getResources().getString(R.string.brave_ui_usd), "0.00");
((TextView)this.root.findViewById(R.id.br_usd_wallet)).setText(usdText);
String usdText =
String.format(this.root.getResources().getString(R.string.brave_ui_usd), "0.00");
((TextView) this.root.findViewById(R.id.br_usd_wallet)).setText(usdText);
CreateUpdateBalanceTask();
ScrollView sv_new = (ScrollView)this.root.findViewById(R.id.sv_no_website);
ScrollView sv_new = (ScrollView) this.root.findViewById(R.id.sv_no_website);
sv_new.setVisibility(View.VISIBLE);
ShowRewardsSummary();
((LinearLayout)this.root.findViewById(R.id.website_summary)).setVisibility(View.VISIBLE);
((LinearLayout) this.root.findViewById(R.id.website_summary)).setVisibility(View.VISIBLE);
EnableWalletDetails(true);
Tab currentActiveTab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
if (currentActiveTab != null && !currentActiveTab.isIncognito()) {
String url = currentActiveTab.getUrlString();
String url = currentActiveTab.getUrl().getSpec();
if (URLUtil.isValidUrl(url)) {
mBraveRewardsNativeWorker.GetPublisherInfo(currentActiveTab.getId(), url);
mPublisherFetcher = new Timer();
mPublisherFetcher.schedule(new PublisherFetchTimer(currentActiveTab.getId(), url),
PUBLISHER_INFO_FETCH_RETRY, PUBLISHER_INFO_FETCH_RETRY);
PUBLISHER_INFO_FETCH_RETRY, PUBLISHER_INFO_FETCH_RETRY);
} else {
btRewardsSummary.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
btRewardsSummary.setClickable(false);
Expand Down Expand Up @@ -1421,7 +1422,6 @@ public void run() {
}
}


@Override
public void OnPublisherInfo(int tabId) {
publisherExist = true;
Expand All @@ -1433,14 +1433,14 @@ public void OnPublisherInfo(int tabId) {

String publisherFavIconURL = mBraveRewardsNativeWorker.GetPublisherFavIconURL(currentTabId);
Tab currentActiveTab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
String url = currentActiveTab.getUrlString();
String url = currentActiveTab.getUrl().getSpec();
final String favicon_url = (publisherFavIconURL.isEmpty()) ? url : publisherFavIconURL;

mIconFetcher.retrieveLargeIcon(favicon_url, this);

GridLayout gl = (GridLayout)this.root.findViewById(R.id.website_summary_grid);
GridLayout gl = (GridLayout) this.root.findViewById(R.id.website_summary_grid);
gl.setVisibility(View.VISIBLE);
LinearLayout ll = (LinearLayout)this.root.findViewById(R.id.br_central_layout);
LinearLayout ll = (LinearLayout) this.root.findViewById(R.id.br_central_layout);
ll.setBackgroundColor(Color.WHITE);

String pubName = thisObject.mBraveRewardsNativeWorker.GetPublisherName(currentTabId);
Expand All @@ -1452,22 +1452,25 @@ public void OnPublisherInfo(int tabId) {
pubSuffix = thisObject.root.getResources().getString(R.string.brave_ui_on_twitch);
}
pubName = "<b>" + pubName + "</b> " + pubSuffix;
TextView tv = (TextView)thisObject.root.findViewById(R.id.publisher_name);
TextView tv = (TextView) thisObject.root.findViewById(R.id.publisher_name);
tv.setText(Html.fromHtml(pubName));
tv = (TextView)thisObject.root.findViewById(R.id.publisher_attention);
String percent = Integer.toString(thisObject.mBraveRewardsNativeWorker.GetPublisherPercent(currentTabId)) + "%";
tv = (TextView) thisObject.root.findViewById(R.id.publisher_attention);
String percent = Integer.toString(thisObject.mBraveRewardsNativeWorker.GetPublisherPercent(
currentTabId))
+ "%";
tv.setText(percent);
if (btAutoContribute != null) {
btAutoContribute.setOnCheckedChangeListener(null);
btAutoContribute.setChecked(!thisObject.mBraveRewardsNativeWorker.GetPublisherExcluded(currentTabId));
btAutoContribute.setChecked(
!thisObject.mBraveRewardsNativeWorker.GetPublisherExcluded(currentTabId));
btAutoContribute.setOnCheckedChangeListener(autoContributeSwitchListener);
}

UpdatePublisherStatus(
thisObject.mBraveRewardsNativeWorker.GetPublisherStatus(currentTabId));
thisObject.mBraveRewardsNativeWorker.GetPublisherStatus(currentTabId));

tv = (TextView)root.findViewById(R.id.br_no_activities_yet);
gl = (GridLayout)thisObject.root.findViewById(R.id.br_activities);
tv = (TextView) root.findViewById(R.id.br_no_activities_yet);
gl = (GridLayout) thisObject.root.findViewById(R.id.br_activities);
if (tv != null && gl != null) {
tv.setVisibility(View.GONE);
gl.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void onClick(View view) {

String publisherFavIconURL = mBraveRewardsNativeWorker.GetPublisherFavIconURL(currentTabId_);
Tab currentActiveTab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
String url = currentActiveTab.getUrlString();
String url = currentActiveTab.getUrl().getSpec();
String favicon_url = (publisherFavIconURL.isEmpty()) ? url : publisherFavIconURL;
mIconFetcher = new BraveRewardsHelper(currentActiveTab);
mIconFetcher.retrieveLargeIcon(favicon_url, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.chromium.chrome.browser.preferences.BravePrefServiceBridge;
import org.chromium.chrome.browser.settings.BraveSyncScreensPreference;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.sync.ProfileSyncService;
import org.chromium.chrome.browser.sync.SyncService;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.ui.messages.infobar.BraveSimpleConfirmInfoBarBuilder;
import org.chromium.chrome.browser.ui.messages.infobar.SimpleConfirmInfoBarBuilder;
Expand All @@ -44,7 +44,7 @@ private static void showSetupV2IfRequired() {
return;
}

boolean isV2User = ProfileSyncService.get() != null && ProfileSyncService.get().isFirstSetupComplete();
boolean isV2User = SyncService.get() != null && SyncService.get().isFirstSetupComplete();
if (isV2User) {
braveSyncWorker.setSyncV2MigrateNoticeDismissed(true);
return;
Expand Down
Loading