浏览代码

Add-custom-tab-intents-privacy-option.patch

none 4 年之前
父节点
当前提交
abc7811615
共有 1 个文件被更改,包括 25 次插入15 次删除
  1. 25 15
      build/patches/Add-custom-tab-intents-privacy-option.patch

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

@@ -3,11 +3,11 @@ Date: Wed, 29 Aug 2018 11:03:44 +0200
 Subject: Add custom tab intents privacy option
 
 ---
- chrome/android/java/res/xml/privacy_preferences.xml |  5 +++++
- .../chrome/browser/LaunchIntentDispatcher.java      |  4 ++++
- .../browser/privacy/settings/PrivacySettings.java   | 13 ++++++++++++-
- .../ui/android/strings/android_chrome_strings.grd   |  7 +++++++
- 4 files changed, 28 insertions(+), 1 deletion(-)
+ .../android/java/res/xml/privacy_preferences.xml |  5 +++++
+ .../chrome/browser/LaunchIntentDispatcher.java   |  4 ++++
+ .../privacy/settings/PrivacySettings.java        | 16 +++++++++++++++-
+ .../android/strings/android_chrome_strings.grd   |  7 +++++++
+ 4 files changed, 31 insertions(+), 1 deletion(-)
 
 diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
 --- a/chrome/android/java/res/xml/privacy_preferences.xml
@@ -27,7 +27,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
-@@ -55,6 +55,8 @@ import org.chromium.url.Origin;
+@@ -53,6 +53,8 @@ import org.chromium.url.Origin;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  
@@ -36,7 +36,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis
  /**
   * Dispatches incoming intents to the appropriate activity based on the current configuration and
   * Intent fired.
-@@ -271,6 +273,8 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
+@@ -269,6 +271,8 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
       */
      public static boolean isCustomTabIntent(Intent intent) {
          if (intent == null) return false;
@@ -48,24 +48,34 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
-@@ -47,10 +47,12 @@ public class PrivacySettings
-     private static final String PREF_DO_NOT_TRACK = "do_not_track";
+@@ -34,6 +34,9 @@ import org.chromium.components.user_prefs.UserPrefs;
+ import org.chromium.ui.text.NoUnderlineClickableSpan;
+ import org.chromium.ui.text.SpanApplier;
+ 
++import org.chromium.base.ContextUtils;
++import android.content.SharedPreferences;
++
+ /**
+  * Fragment to keep track of the all the privacy related preferences.
+  */
+@@ -46,10 +49,12 @@ public class PrivacySettings
      private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
+     private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
      private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
 +    public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
      private static final String[] NEW_PRIVACY_PREFERENCE_ORDER = {PREF_CLEAR_BROWSING_DATA,
              PREF_CAN_MAKE_PAYMENT, PREF_NETWORK_PREDICTIONS,
-             PREF_SECURE_DNS, PREF_DO_NOT_TRACK,
+             PREF_SECURE_DNS, PREF_DO_NOT_TRACK, PREF_PRIVACY_SANDBOX,
 -            PREF_ALWAYS_INCOGNITO
 +            PREF_ALWAYS_INCOGNITO,
 +            PREF_ALLOW_CUSTOM_TAB_INTENTS
          };
  
      private ManagedPreferenceDelegate mManagedPreferenceDelegate;
-@@ -101,6 +103,10 @@ public class PrivacySettings
-                     .setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
+@@ -106,6 +111,10 @@ public class PrivacySettings
          } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
-             PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((boolean) newValue);
+             PrivacyPreferencesManagerImpl.getInstance().setNetworkPredictionEnabled(
+                     (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);
@@ -73,7 +83,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
          }
  
          return true;
-@@ -124,6 +130,11 @@ public class PrivacySettings
+@@ -129,6 +138,11 @@ public class PrivacySettings
              canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
          }
  
@@ -88,7 +98,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 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
-@@ -3956,6 +3956,13 @@ Data from your Incognito session will only be cleared from Chrome when you <ph n
+@@ -3962,6 +3962,13 @@ Data from your Incognito session will only be cleared from Chrome when you <ph n
        <message name="IDS_NEAR_OOM_REDUCTION_DECLINE" desc="The text of the button letting the user decline the browser's intervention, so that the page can be reloaded.">
           Show original
        </message>