Ver Fonte

Various fixes

csagan5 há 3 anos atrás
pai
commit
a7bf22d52b

+ 7 - 7
build/patches/Add-custom-tab-intents-privacy-option.patch

@@ -143,10 +143,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
      @Override
      public boolean onPreferenceChange(Preference preference, Object newValue) {
          String key = preference.getKey();
-@@ -240,6 +246,14 @@ public class PrivacySettings
-         }
-         return true;
-     }
+@@ -225,6 +231,14 @@ public class PrivacySettings
+         } else if (PREF_AUTOFILL_ASSISTANT.equals(key)) {
+             mSharedPreferencesManager.writeBoolean(
+                 ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, (boolean) newValue);
 +        } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
 +            SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
 +            sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
@@ -155,9 +155,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +            SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
 +            sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
 +            sharedPreferencesEditor.apply();
- 
-     public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled";
-     @Override
+         } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
+             PrivacyPreferencesManagerImpl.getInstance().setNetworkPredictionEnabled(
+                     (boolean) newValue);
 @@ -260,6 +274,16 @@ public class PrivacySettings
              canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
          }

+ 12 - 15
build/patches/Enable-native-Android-autofill.patch

@@ -15,7 +15,7 @@ See also: https://github.com/bromite/bromite/issues/547
  android_webview/browser/aw_contents.cc        |  1 +
  chrome/android/BUILD.gn                       |  1 +
  .../settings/PasswordSettings.java            | 82 ++++++++++++++++++-
- .../chromium/chrome/browser/tab/TabImpl.java  | 51 ++++++++++++
+ .../chromium/chrome/browser/tab/TabImpl.java  | 50 +++++++++++
  .../browser/tab/TabViewAndroidDelegate.java   | 14 ++++
  chrome/browser/BUILD.gn                       |  8 ++
  chrome/browser/android/tab_android.cc         | 27 ++++++
@@ -30,10 +30,10 @@ See also: https://github.com/bromite/bromite/issues/547
  .../renderer/password_autofill_agent.cc       |  5 +-
  .../autofill/core/common/autofill_prefs.cc    |  8 ++
  .../autofill/core/common/autofill_prefs.h     |  2 +
- .../embedder_support/view/ContentView.java    | 48 +++++++++++
+ .../embedder_support/view/ContentView.java    | 46 +++++++++++
  .../chromium/ui/base/ViewAndroidDelegate.java |  8 ++
  weblayer/browser/tab_impl.cc                  |  3 +-
- 21 files changed, 332 insertions(+), 15 deletions(-)
+ 21 files changed, 329 insertions(+), 15 deletions(-)
 
 diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc
 --- a/android_webview/browser/aw_contents.cc
@@ -185,13 +185,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
-@@ -75,6 +75,18 @@ import org.chromium.url.GURL;
+@@ -75,6 +75,17 @@ import org.chromium.url.GURL;
  
  import java.nio.ByteBuffer;
  
 +import android.os.Build;
 +import android.util.SparseArray;
-+import org.chromium.base.annotations.VerifiesOnO;
 +import org.chromium.ui.base.EventOffsetHandler;
 +import android.view.ViewStructure;
 +import android.view.autofill.AutofillValue;
@@ -204,7 +203,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
  /**
   * Implementation of the interface {@link Tab}. Contains and manages a {@link ContentView}.
   * This class is not intended to be extended.
-@@ -218,6 +230,8 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
+@@ -218,6 +229,8 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
      /** Whether or not the user manually changed the user agent. */
      private boolean mUserForcedUserAgent;
  
@@ -213,7 +212,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
      /**
       * Creates an instance of a {@link TabImpl}.
       *
-@@ -768,6 +782,11 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
+@@ -768,6 +781,11 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
          for (TabObserver observer : mObservers) observer.onDestroyed(this);
          mObservers.clear();
  
@@ -225,7 +224,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
          mUserDataHost.destroy();
          mTabViewManager.destroy();
          hideNativePage(false, null);
-@@ -1359,6 +1378,16 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
+@@ -1359,6 +1377,16 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
          return tabsPtrArray;
      }
  
@@ -242,7 +241,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
      /**
       * Initializes the {@link WebContents}. Completes the browser content components initialization
       * around a native WebContents pointer.
-@@ -1408,6 +1437,27 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
+@@ -1408,6 +1436,27 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
                              mDelegateFactory.createContextMenuPopulatorFactory(this), this));
  
              mWebContents.notifyRendererPreferenceUpdate();
@@ -270,7 +269,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
              TabHelpers.initWebContentsHelpers(this);
              notifyContentChanged();
          } finally {
-@@ -1772,5 +1822,6 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
+@@ -1772,5 +1821,6 @@ public class TabImpl implements Tab, TabObscuringHandler.Observer {
          void setActiveNavigationEntryTitleForUrl(long nativeTabAndroid, String url, String title);
          void loadOriginalImage(long nativeTabAndroid);
          boolean handleNonNavigationAboutURL(GURL url);
@@ -747,12 +746,11 @@ diff --git a/components/autofill/core/common/autofill_prefs.h b/components/autof
 diff --git a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java
 --- a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java
 +++ b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java
-@@ -36,6 +36,12 @@ import org.chromium.content_public.browser.WebContentsAccessibility;
+@@ -36,6 +36,11 @@ import org.chromium.content_public.browser.WebContentsAccessibility;
  import org.chromium.ui.base.EventForwarder;
  import org.chromium.ui.base.EventOffsetHandler;
  
 +import org.chromium.base.Log;
-+import org.chromium.base.annotations.VerifiesOnO;
 +import android.util.SparseArray;
 +import android.view.autofill.AutofillValue;
 +import org.chromium.ui.base.ViewAndroidDelegate;
@@ -760,7 +758,7 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component
  /**
   * The containing view for {@link WebContents} that exists in the Android UI hierarchy and exposes
   * the various {@link View} functionality to it.
-@@ -82,6 +88,8 @@ public class ContentView extends FrameLayout
+@@ -82,6 +87,8 @@ public class ContentView extends FrameLayout
       */
      public static ContentView createContentView(Context context,
              @Nullable EventOffsetHandler eventOffsetHandler, @Nullable WebContents webContents) {
@@ -769,7 +767,7 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
              return new ContentViewApi23(context, eventOffsetHandler, webContents);
          }
-@@ -549,4 +557,44 @@ public class ContentView extends FrameLayout
+@@ -549,4 +556,43 @@ public class ContentView extends FrameLayout
              if (wcax != null) wcax.onProvideVirtualStructure(structure, false);
          }
      }
@@ -777,7 +775,6 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component
 +    /**
 +    * API level 26 implementation that includes autofill.
 +    */
-+    @VerifiesOnO
 +    public static class ContentViewWithAutofill extends ContentViewApi23 {
 +        private ViewAndroidDelegate viewAndroidDelegate;
 +

+ 21 - 2
build/patches/Remove-signin-and-data-saver-integrations.patch

@@ -69,12 +69,12 @@ ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
  .../ui/signin/SignOutDialogFragment.java      |  13 --
  .../ui/signin/SigninPromoController.java      |  15 +-
  .../AccountPickerDelegateImpl.java            |  24 ---
- .../ui/signin/fre/SigninFirstRunMediator.java |  27 +--
+ .../ui/signin/fre/SigninFirstRunMediator.java |  39 +---
  .../strings/android_chrome_strings.grd        |  18 --
  .../signin/SystemAccountManagerDelegate.java  |  25 +--
  .../net/HttpNegotiateAuthenticator.java       |  88 +--------
  .../chromoting/base/OAuthTokenFetcher.java    |   2 -
- 55 files changed, 52 insertions(+), 1270 deletions(-)
+ 55 files changed, 53 insertions(+), 1281 deletions(-)
 
 diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
 --- a/chrome/android/BUILD.gn
@@ -2775,6 +2775,25 @@ diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/brows
      }
  
      /**
+@@ -169,17 +144,7 @@ class SigninFirstRunMediator implements AccountsChangeObserver, ProfileDataCache
+     private void onDismissClicked() {
+         assert mModel.get(SigninFirstRunProperties.ARE_NATIVE_AND_POLICY_LOADED)
+             : "The dismiss button shouldn't be visible before the native is not initialized!";
+-        mDelegate.recordFreProgressHistogram(MobileFreProgress.WELCOME_DISMISS);
+-        if (IdentityServicesProvider.get()
+-                        .getIdentityManager(Profile.getLastUsedRegularProfile())
+-                        .hasPrimaryAccount(ConsentLevel.SIGNIN)) {
+-            IdentityServicesProvider.get()
+-                    .getSigninManager(Profile.getLastUsedRegularProfile())
+-                    .signOut(SignoutReason.ABORT_SIGNIN, mDelegate::acceptTermsOfService,
+-                            /* forceWipeUserData= */ false);
+-        } else {
+-            mDelegate.acceptTermsOfService();
+-        }
++        mDelegate.acceptTermsOfService();
+     }
+ 
+     private void setSelectedAccountName(String accountName) {
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd

+ 1 - 1
build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch

@@ -210,7 +210,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
          if (mCategory.showSites(SiteSettingsCategory.Type.SOUND)) {
              allowSpecifyingExceptions = true;
 +        } else if (mCategory.showSites(SiteSettingsCategory.Type.AUTOPLAY)) {
-+            exception = true;
++            allowSpecifyingExceptions = true;
          } else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
              allowSpecifyingExceptions = true;
          } else if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {

+ 2 - 2
build/patches/Site-setting-for-images.patch

@@ -198,11 +198,11 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
              if (mRequiresFourStateSetting) {
                  resource = cookieSettingsExceptionShouldBlock()
 @@ -742,6 +744,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
-             exception = true;
+             allowSpecifyingExceptions = true;
          } else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
              allowSpecifyingExceptions = true;
 +        } else if (mCategory.showSites(SiteSettingsCategory.Type.IMAGES)) {
-+            exception = true;
++            allowSpecifyingExceptions = true;
          } else if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {
              allowSpecifyingExceptions = true;
          } else if (mCategory.showSites(SiteSettingsCategory.Type.BACKGROUND_SYNC)

+ 1 - 1
build/patches/Timezone-customization.patch

@@ -423,7 +423,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
                          browserContextHandle, ContentSettingsType.AUTO_DARK_WEB_CONTENT)) {
              allowSpecifyingExceptions = true;
 +        } else if (mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE)) {
-+            exception = true;
++            allowSpecifyingExceptions = true;
          }
          if (allowSpecifyingExceptions) {
              getPreferenceScreen().addPreference(new AddExceptionPreference(getStyledContext(),