Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a25a4d9 authored by csagan5's avatar csagan5
Browse files

Release 94.0.4606.102

parent 3787e8e9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
# 94.0.4606.102
* add flag to disable pull-to-refresh effect
* add recents, offlinepage and send to home screen for always incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182 and https://github.com/bromite/bromite/issues/1362)
* prompt to restart when always-incognito is enabled
* merge patches for custom tab intents

# 94.0.4606.94
* Bromite auto-update feature, disabled by default (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/706)
* add site setting for images (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1339)
+1 −1
Original line number Diff line number Diff line
94.0.4606.94
94.0.4606.102
+2 −1
Original line number Diff line number Diff line
@@ -156,8 +156,9 @@ Override-UA-client-hint-for-model.patch
Disable-AGSA-by-default.patch
Allow-building-without-enable_reporting.patch
Disable-lock-icon-in-address-bar-by-default.patch
Add-custom-tab-intents-privacy-option.patch
Enable-share-intent.patch
Site-setting-for-images.patch
Bromite-auto-updater.patch
Add-flag-to-disable-pull-to-refresh-effect.patch
Automated-domain-substitution.patch
Add-intents-privacy-option.patch
 No newline at end of file
+6 −6
Original line number Diff line number Diff line
@@ -70,14 +70,14 @@ 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/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
@@ -54,6 +54,7 @@ public class PrivacySettings
     private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
     public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
     private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
@@ -50,6 +50,7 @@ import org.chromium.ui.text.SpanApplier;
 public class PrivacySettings
         extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener,
                                                     INeedSnackbarManager {
+    private static final String PREF_PROXY_OPTIONS = "proxy";
     private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
     private SnackbarManager mSnackbarManager;
     private Snackbar mSnackbar;
 
     private ManagedPreferenceDelegate mManagedPreferenceDelegate;
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+94 −20
Original line number Diff line number Diff line
@@ -2,17 +2,23 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 29 Aug 2018 11:03:44 +0200
Subject: Add custom tab intents privacy option

Add custom tab intents privacy option and force
open external links in incognito flag.

Flags are mutually exclusive.

See also: https://github.com/bromite/bromite/issues/1474
---
 chrome/android/java/res/xml/privacy_preferences.xml    |  5 +++++
 .../chrome/browser/LaunchIntentDispatcher.java         |  4 ++++
 .../browser/privacy/settings/PrivacySettings.java      | 10 ++++++++++
 .../ui/android/strings/android_chrome_strings.grd      |  7 +++++++
 4 files changed, 26 insertions(+)
 .../java/res/xml/privacy_preferences.xml      | 10 ++++++
 .../browser/LaunchIntentDispatcher.java       | 19 ++++++++++
 .../privacy/settings/PrivacySettings.java     | 36 +++++++++++++++++++
 .../strings/android_chrome_strings.grd        | 15 ++++++++
 4 files changed, 80 insertions(+)

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
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -37,6 +37,11 @@
@@ -56,6 +56,16 @@
         android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
         android:key="do_not_track"
         android:title="@string/do_not_track_title"/>
@@ -20,6 +26,11 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
+        android:key="allow_custom_tab_intents"
+        android:title="@string/allow_custom_tab_intents_title"
+        android:summary="@string/allow_custom_tab_intents_summary"
+        android:defaultValue="false" />
+    <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+        android:key="open_external_links_incognito"
+        android:title="@string/open_external_links_incognito_title"
+        android:summary="@string/open_external_links_incognito_summary"
+        android:defaultValue="false" />
     <Preference
         android:key="privacy_sandbox"
@@ -36,45 +47,100 @@ 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.
@@ -279,6 +281,8 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
@@ -279,6 +281,12 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
      */
     public static boolean isCustomTabIntent(Intent intent) {
         if (intent == null) return false;
+        if (!ContextUtils.getAppSharedPreferences().getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+        if (ContextUtils.getAppSharedPreferences()
+                .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
+            return false;
+        if (!ContextUtils.getAppSharedPreferences()
+                .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+            return false;
         if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
                 || !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
             return false;
@@ -417,6 +425,17 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
 
         if (Intent.ACTION_VIEW.equals(newIntent.getAction())
                 && !IntentHandler.wasIntentSenderChrome(newIntent)) {
+
+            if (ContextUtils.getAppSharedPreferences().getBoolean(
+                    PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false)) {
+                Context applicationContext = ContextUtils.getApplicationContext();
+                newIntent = IntentHandler.createTrustedOpenNewTabIntent(applicationContext,
+                    /*incognito*/true);
+                newIntent.setData(mIntent.getData());
+                newIntent.setPackage(applicationContext.getPackageName());
+                newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            }
+
             long time = SystemClock.elapsedRealtime();
             if (!chromeTabbedTaskExists()) {
                 newIntent.putExtra(IntentHandler.EXTRA_STARTED_TABBED_CHROME_TASK, true);
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
@@ -49,6 +49,7 @@ public class PrivacySettings
     private static final String PREF_SECURE_DNS = "secure_dns";
     private static final String PREF_DO_NOT_TRACK = "do_not_track";
     private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
+    public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
     private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
@@ -90,6 +90,9 @@ public class PrivacySettings
 
     private ManagedPreferenceDelegate mManagedPreferenceDelegate;
@@ -119,6 +120,10 @@ public class PrivacySettings
         } else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
 
+    private ChromeSwitchPreference allowCustomTabIntentsPref;
+    private ChromeSwitchPreference openExternalLinksPref;
+
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
         PrivacyPreferencesManagerImpl privacyPrefManager =
@@ -191,6 +194,9 @@ public class PrivacySettings
         updateSummaries();
     }
 
+    public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
+    public static final String PREF_OPEN_EXTERNAL_LINKS_INCOGNITO = "open_external_links_incognito";
+
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         String key = preference.getKey();
@@ -222,6 +228,26 @@ public class PrivacySettings
         } else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
             UserPrefs.get(Profile.getLastUsedRegularProfile())
                     .setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
                     .setBoolean(Pref.INCOGNITO_TAB_HISTORY_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);
+            sharedPreferencesEditor.apply();
+
+            // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
+            // are mutually exclusive
+            if((boolean)newValue && ContextUtils.getAppSharedPreferences()
+                    .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
+                openExternalLinksPref.setChecked(!(boolean)newValue);
+        } else if (PREF_OPEN_EXTERNAL_LINKS_INCOGNITO.equals(key)) {
+            SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+            sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
+            sharedPreferencesEditor.apply();
+
+            // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
+            // are mutually exclusive
+            if((boolean)newValue && ContextUtils.getAppSharedPreferences()
+                    .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+                allowCustomTabIntentsPref.setChecked(false);
         }
 
         return true;
@@ -142,6 +147,11 @@ public class PrivacySettings
@@ -257,6 +283,16 @@ public class PrivacySettings
             canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
         }
 
+        ChromeSwitchPreference allowCustomTabIntentsPref =
+        allowCustomTabIntentsPref =
+                (ChromeSwitchPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
+        allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
+        allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
+        openExternalLinksPref =
+                (ChromeSwitchPreference) findPreference(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO);
+        openExternalLinksPref.setOnPreferenceChangeListener(this);
+        openExternalLinksPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
         Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
         if (doNotTrackPref != null) {
@@ -82,7 +148,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
@@ -4405,6 +4405,13 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
@@ -4496,6 +4496,21 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
       <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>
@@ -92,6 +158,14 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
+      </message>
+      <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
+        Allow applications to open custom tab intents, similar to webview.
+      </message>
+
+      <!-- Open External Links in Incognito -->
+      <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_TITLE" desc="Text for 'Open external links in incognito' settings-privacy option.">
+        Open external links in incognito
+      </message>
+      <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_SUMMARY" desc="Summary text for 'Open external links in incognito' settings-privacy option.">
+        Force the opening of all external links in incognito mode
+      </message>
 
       <!-- Autofill Assistant preferences -->
Loading