Skip to content

Commit

Permalink
Merge pull request #5204 from brave/81.0.4044.92-1.7.x
Browse files Browse the repository at this point in the history
Upgrade from Chromium 80.0.3987.163 to Chromium 81.0.4044.92 (1.7.x)
  • Loading branch information
bsclifton authored Apr 15, 2020
2 parents 69334ee + 18237f9 commit 2822d1b
Show file tree
Hide file tree
Showing 1,172 changed files with 32,231 additions and 19,495 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/components/brave_webtorrent/extension/out/
/components/brave_rewards/resources/extension/brave_rewards/out/
/components/brave_sync/extension/brave-sync/
/components/brave_sync/extension/brave-sync-android/
/components/brave_sync/extension/brave-crypto/
/components/third_party/adblock/LICENSE
/components/third_party/local_data/LICENSE
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 @@ -78,7 +78,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BackgroundImagesPreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BackgroundVideoPlaybackPreference.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BraveHomepagePreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BraveLicensePreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/BravePreferenceFragment.java",
Expand All @@ -93,8 +92,9 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/ClosingAllTabsClosesBravePreference.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/developer/BraveQAPreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/homepage/BraveHomepageSettings.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/privacy/BraveClearBrowsingDataPreferencesAdvanced.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/privacy/BravePrivacyPreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/privacy/BravePrivacySettings.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/SearchEngineTabModelSelectorObserver.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/themes/BraveRadioButtonGroupThemePreference.java",
"../../brave/android/java/org/chromium/chrome/browser/settings/themes/BraveThemePreferences.java",
Expand Down
4 changes: 2 additions & 2 deletions android/java/org/chromium/chrome/browser/BraveActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.chrome.browser.tabmodel.TabLaunchType;
import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.tabmodel.TabSelectionType;
import org.chromium.chrome.browser.tab.TabSelectionType;
import org.chromium.chrome.browser.toolbar.top.BraveToolbarLayout;
import org.chromium.chrome.browser.util.BraveReferrer;
import org.chromium.chrome.browser.util.UrlConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class BraveIntentHandler extends IntentHandler {
private static final String BRAVE_CONNECTION_INFO_HELP_URL =
"https://support.brave.com/hc/en-us/articles/360018185871-How-do-I-check-if-a-site-s-connection-is-secure-";

public BraveIntentHandler(IntentHandlerDelegate delegate, String packageName) {
super(delegate, packageName);
public BraveIntentHandler(Activity activity, IntentHandlerDelegate delegate) {
super(activity, delegate);
}

public boolean onNewIntent(Intent intent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.chrome.browser.tabmodel.TabModelImpl;
import org.chromium.chrome.browser.ui.widget.RoundedIconGenerator;
import org.chromium.chrome.browser.favicon.RoundedIconGenerator;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.BraveAdsNativeHelper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.TabModelImpl;
import org.chromium.chrome.browser.tabmodel.TabLaunchType;
import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl;
import org.chromium.chrome.browser.util.PackageUtils;
import org.chromium.chrome.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import android.graphics.Bitmap;
import android.widget.ImageView;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.ui.widget.RoundedIconGenerator;
import org.chromium.chrome.browser.favicon.RoundedIconGenerator;
import org.chromium.base.task.AsyncTask;
import android.graphics.BitmapFactory;
import org.chromium.base.annotations.CalledByNative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import android.widget.ImageButton;

import org.chromium.base.Log;
import org.chromium.base.ObservableSupplier;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ActivityTabProvider;
import org.chromium.chrome.browser.BraveFeatureList;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior;
import org.chromium.chrome.browser.flags.FeatureUtilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ protected void insertSiteSectionView() {
layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
// If the explore sites section exists as its own section, then space it more closely.
int variation = ExploreSitesBridge.getVariation();
if (ExploreSitesBridge.isEnabled(variation)
&& !ExploreSitesBridge.isIntegratedWithMostLikely(variation)) {
if (ExploreSitesBridge.isEnabled(variation)) {
((MarginLayoutParams) layoutParams).bottomMargin =
getResources().getDimensionPixelOffset(
R.dimen.tile_grid_layout_vertical_spacing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.chromium.base.TraceEvent;
import org.chromium.chrome.R;
import org.chromium.base.Log;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.ntp.NewTabPageView;
import org.chromium.chrome.browser.preferences.BravePref;
import org.chromium.chrome.browser.preferences.BravePrefServiceBridge;
Expand Down Expand Up @@ -109,10 +110,10 @@ public void onConfigurationChanged(Configuration newConfig) {
@Override
public void initialize(NewTabPageManager manager, Tab tab, TileGroup.Delegate tileGroupDelegate,
boolean searchProviderHasLogo, boolean searchProviderIsGoogle, int scrollPosition,
long constructedTimeNs) {
long constructedTimeNs, ActivityLifecycleDispatcher activityLifecycleDispatcher) {
super.initialize(manager, tab, tileGroupDelegate,
searchProviderHasLogo, searchProviderIsGoogle, scrollPosition,
constructedTimeNs);
constructedTimeNs, activityLifecycleDispatcher);

mTabImpl = (TabImpl) tab;
mTab = tab;
Expand Down Expand Up @@ -348,7 +349,7 @@ private void initilizeSponsoredTab() {

private TabObserver mTabObserver = new EmptyTabObserver() {
@Override
public void onInteractabilityChanged(boolean interactable) {
public void onInteractabilityChanged(Tab tab, boolean interactable) {
// Force a layout update if the tab is now in the foreground.
if (interactable) {
if (sponsoredTab == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package org.chromium.chrome.browser.ntp;

import static org.chromium.chrome.browser.util.ViewUtils.dpToPx;
import static org.chromium.ui.base.ViewUtils.dpToPx;

import android.content.Context;
import android.content.res.Configuration;
Expand All @@ -26,7 +26,7 @@
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.gesturenav.HistoryNavigationLayout;
import org.chromium.chrome.browser.util.ViewUtils;
import org.chromium.ui.base.ViewUtils;
import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.text.SpanApplier;
import org.chromium.ui.widget.ChromeBulletSpan;
Expand Down Expand Up @@ -55,6 +55,20 @@ interface IncognitoNewTabPageManager {
/** Loads a page explaining details about incognito mode in the current tab. */
void loadIncognitoLearnMore();

/**
* Enables/disables cookie controls mode as set from incognito NTP. By default
* nothing happens.
* @param enable A boolean specifying the state of third party cookie blocking in
* incognito. True will enable third-party cookie blocking in incognito and false
* will disable this feature.
* */
void setThirdPartyCookieBlocking(boolean enable);

/**
* Returns whether third-party cookies are currently being blocked.
* */
boolean shouldBlockThirdPartyCookies();

/**
* Called when the NTP has completely finished loading (all views will be inflated
* and any dependent resources will have been loaded).
Expand All @@ -63,8 +77,8 @@ interface IncognitoNewTabPageManager {
}

/** Default constructor needed to inflate via XML. */
public IncognitoNewTabPageView(Context context, AttributeSet attrs) {
super(context, attrs);
public IncognitoNewTabPageView(Context context) {
super(context);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.ntp_sponsored_images.NTPImage;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.BraveFeatureList;
import org.chromium.chrome.browser.preferences.BravePrefServiceBridge;
import org.chromium.chrome.browser.profiles.Profile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import org.chromium.chrome.browser.preferences.BravePref;
import org.chromium.chrome.browser.preferences.BravePrefServiceBridge;

import static org.chromium.chrome.browser.util.ViewUtils.dpToPx;
import static org.chromium.ui.base.ViewUtils.dpToPx;

public class NTPUtil {
private static final int BOTTOM_TOOLBAR_HEIGHT = 56;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.chrome.R;

import static org.chromium.chrome.browser.util.ViewUtils.dpToPx;
import static org.chromium.ui.base.ViewUtils.dpToPx;

public class RewardsBottomSheetDialogFragment extends BottomSheetDialogFragment{
private static final String BRAVE_TERMS_PAGE = "https://basicattentiontoken.org/user-terms-of-service/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.chromium.chrome.browser.BraveAdsNativeHelper;
import org.chromium.chrome.browser.BraveFeatureList;
import org.chromium.chrome.browser.BraveRewardsPanelPopup;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.notifications.BraveOnboardingNotification;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.util.PackageUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package org.chromium.chrome.browser.onboarding;

import static org.chromium.chrome.browser.util.ViewUtils.dpToPx;
import static org.chromium.ui.base.ViewUtils.dpToPx;

import android.app.Fragment;
import android.os.Bundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.ContentSettingsType;
import org.chromium.components.content_settings.ContentSettingsType;
import org.chromium.chrome.browser.preferences.website.BraveShieldsContentSettingsObserver;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.website.WebsitePreferenceBridge;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package org.chromium.chrome.browser.settings;

import static org.chromium.chrome.browser.settings.MainPreferences.PREF_UI_THEME;
import static org.chromium.chrome.browser.settings.MainSettings.PREF_UI_THEME;

import android.content.SharedPreferences;
import android.os.Bundle;
Expand All @@ -18,7 +18,7 @@
import org.chromium.chrome.browser.BraveRelaunchUtils;
import org.chromium.chrome.browser.BraveRewardsNativeWorker;
import org.chromium.chrome.browser.BraveRewardsObserver;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.FeatureUtilities;
import org.chromium.chrome.browser.night_mode.NightModeUtils;
import org.chromium.chrome.browser.preferences.BravePreferenceKeys;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

import org.chromium.chrome.R;
import org.chromium.chrome.browser.BraveFeatureList;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.onboarding.OnboardingPrefManager;
import org.chromium.chrome.browser.preferences.BravePrefServiceBridge;
import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory;
import org.chromium.chrome.browser.settings.BraveHomepagePreferences;
import org.chromium.chrome.browser.settings.privacy.BravePrivacyPreferences;
import org.chromium.chrome.browser.settings.homepage.BraveHomepageSettings;
import org.chromium.chrome.browser.settings.privacy.BravePrivacySettings;
import org.chromium.chrome.browser.settings.BravePreferenceFragment;
import org.chromium.components.search_engines.TemplateUrl;
import org.chromium.components.search_engines.TemplateUrlService;
Expand Down Expand Up @@ -78,13 +78,12 @@ public void onResume() {

private void updateBravePreferences() {
// Below prefs are removed from main settings.
removePreferenceIfPresent(MainPreferences.PREF_SIGN_IN);
removePreferenceIfPresent(MainPreferences.PREF_ACCOUNT_SECTION);
removePreferenceIfPresent(MainPreferences.PREF_DATA_REDUCTION);
removePreferenceIfPresent(MainPreferences.PREF_AUTOFILL_ASSISTANT);
removePreferenceIfPresent(MainPreferences.PREF_SYNC_AND_SERVICES);
removePreferenceIfPresent(MainPreferences.PREF_SEARCH_ENGINE);
removePreferenceIfPresent(MainPreferences.PREF_UI_THEME);
removePreferenceIfPresent(MainSettings.PREF_SIGN_IN);
removePreferenceIfPresent(MainSettings.PREF_ACCOUNT_SECTION);
removePreferenceIfPresent(MainSettings.PREF_DATA_REDUCTION);
removePreferenceIfPresent(MainSettings.PREF_SYNC_AND_SERVICES);
removePreferenceIfPresent(MainSettings.PREF_SEARCH_ENGINE);
removePreferenceIfPresent(MainSettings.PREF_UI_THEME);

updateSearchEnginePreference();
updateControlSectionPreferences();
Expand Down Expand Up @@ -129,12 +128,12 @@ private void rearrangePreferenceOrders() {
findPreference(PREF_SYNC).setOrder(++order);
findPreference(PREF_ACCESSIBILITY).setOrder(++order);
findPreference(PREF_CONTENT_SETTINGS).setOrder(++order);
findPreference(MainPreferences.PREF_LANGUAGES).setOrder(++order);
findPreference(MainPreferences.PREF_DATA_REDUCTION).setOrder(++order);
findPreference(MainPreferences.PREF_DOWNLOADS).setOrder(++order);
findPreference(MainSettings.PREF_LANGUAGES).setOrder(++order);
findPreference(MainSettings.PREF_DATA_REDUCTION).setOrder(++order);
findPreference(MainSettings.PREF_DOWNLOADS).setOrder(++order);
// This preference doesn't exist by default in Release mode
if (findPreference(MainPreferences.PREF_DEVELOPER) != null) {
findPreference(MainPreferences.PREF_DEVELOPER).setOrder(++order);
if (findPreference(MainSettings.PREF_DEVELOPER) != null) {
findPreference(MainSettings.PREF_DEVELOPER).setOrder(++order);
}
findPreference(PREF_ABOUT_CHROME).setOrder(++order);
}
Expand Down Expand Up @@ -173,8 +172,8 @@ private void updateControlSectionPreferences() {

private void overrideChromiumPreferences() {
// Replace fragment.
findPreference(PREF_PRIVACY).setFragment(BravePrivacyPreferences.class.getName());
findPreference(PREF_HOMEPAGE).setFragment(BraveHomepagePreferences.class.getName());
findPreference(PREF_PRIVACY).setFragment(BravePrivacySettings.class.getName());
findPreference(PREF_HOMEPAGE).setFragment(BraveHomepageSettings.class.getName());
}

private void initWelcomeTourPreference() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.view.View;

import org.chromium.base.Log;
import org.chromium.chrome.browser.settings.search_engine.SearchEngineAdapter;
import org.chromium.components.search_engines.TemplateUrl;

public class BraveSearchEngineAdapter extends SearchEngineAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.view.View;
import android.widget.ListView;

import org.chromium.chrome.browser.settings.search_engine.SearchEngineAdapter;
import org.chromium.chrome.R;

public class BraveSearchEnginePreference extends ListFragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.chromium.chrome.browser.settings;
package org.chromium.chrome.browser.settings.homepage;

import android.os.Bundle;

import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
import org.chromium.chrome.browser.settings.ChromeSwitchPreference;
import org.chromium.chrome.browser.settings.homepage.HomepageSettings;

public class BraveHomepagePreferences extends HomepagePreferences {
public class BraveHomepageSettings extends HomepageSettings {
private HomepageManager mHomepageManager;

@Override
Expand All @@ -23,7 +25,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
if (homepageSwitch.isVisible()) return;
// Show homepage switch if it is hidden.
homepageSwitch.setVisible(true);
boolean isHomepageEnabled = mHomepageManager.getPrefHomepageEnabled();
boolean isHomepageEnabled = HomepageManager.isHomepageEnabled();
homepageSwitch.setChecked(isHomepageEnabled);
homepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
mHomepageManager.setPrefHomepageEnabled((boolean) newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.List;
import java.util.Set;

public class BraveClearBrowsingDataPreferencesAdvanced extends ClearBrowsingDataPreferencesAdvanced {
public class BraveClearBrowsingDataPreferencesAdvanced extends ClearBrowsingDataFragmentAdvanced {
private static final int CLEAR_DOWNLOADS = DialogOption.NUM_ENTRIES;

// TODO(samartnik): disabling option as it requires futher research
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import org.chromium.chrome.browser.settings.ChromeBaseCheckBoxPreference;
import org.chromium.chrome.browser.settings.ChromeSwitchPreference;
import org.chromium.chrome.browser.settings.ManagedPreferenceDelegate;
import org.chromium.chrome.browser.settings.privacy.PrivacyPreferences;
import org.chromium.chrome.browser.settings.privacy.PrivacySettings;
import org.chromium.chrome.browser.settings.SettingsUtils;

public class BravePrivacyPreferences extends PrivacyPreferences {
public class BravePrivacySettings extends PrivacySettings {
private static final String PREF_HTTPSE = "httpse";
private static final String PREF_AD_BLOCK = "ad_block";
private static final String PREF_FINGERPRINTING_PROTECTION = "fingerprinting_protection";
Expand Down
Loading

0 comments on commit 2822d1b

Please sign in to comment.