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

Commit 2d13c5a2 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Merge tag 85.0.4183.84 from bromite



5daca635 Release 85.0.4183.84
9b30907d Minor fixes to proxy patch
576f8eb7 Cleanup proxy configuration patch, fix mode
bfd783f6 Introduce direct mode for proxy configuration
21c6b879 Updated patches for v85
67177304 Add changelog entry for issue #654

Signed-off-by: Aayush Gupta's avatarAayush Gupta <theimpulson@e.email>
parents 1065efc2 5daca635
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
# 85.0.4183.84
* fix crash in About page (fixes https://github.com/bromite/bromite/issues/710)
* fix adding more than one proxy (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/679)
* fix system proxy configuration (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/377)

# 85.0.4183.82
* fixes bookmark button not working with always-incognito (fixes https://github.com/bromite/bromite/issues/654)
* disable scroll-to-text-fragment
* remove NTP blocklisted URLs when adding an URL as bookmark
* removed duet flags
+1 −1
Original line number Diff line number Diff line
85.0.4183.82
85.0.4183.84
+79 −36
Original line number Diff line number Diff line
@@ -13,20 +13,20 @@ Offer auto-complete for the proxy page URL.
 chrome/browser/browser_resources.grd          |   6 +
 .../prefs/chrome_command_line_pref_store.cc   |   2 +-
 chrome/browser/resources/proxy_config.css     |  61 +++
 chrome/browser/resources/proxy_config.html    |  78 ++++
 chrome/browser/resources/proxy_config.js      | 252 +++++++++++
 chrome/browser/resources/proxy_config.html    |  79 ++++
 chrome/browser/resources/proxy_config.js      | 262 +++++++++++
 chrome/browser/ui/BUILD.gn                    |   2 +
 .../webui/chrome_web_ui_controller_factory.cc |   3 +
 chrome/browser/ui/webui/proxy_config_ui.cc    | 395 ++++++++++++++++++
 chrome/browser/ui/webui/proxy_config_ui.cc    | 413 ++++++++++++++++++
 chrome/browser/ui/webui/proxy_config_ui.h     |  33 ++
 chrome/common/webui_url_constants.cc          |   4 +
 chrome/common/webui_url_constants.h           |   2 +
 .../core/browser/proxy_policy_handler.cc      |   2 +-
 .../proxy_config/proxy_config_dictionary.cc   |  22 +-
 .../proxy_config/proxy_config_dictionary.h    |   6 +-
 net/proxy_resolution/proxy_config.cc          |  45 ++
 net/proxy_resolution/proxy_config.cc          |  52 ++-
 net/proxy_resolution/proxy_config.h           |   3 +
 19 files changed, 913 insertions(+), 12 deletions(-)
 19 files changed, 948 insertions(+), 13 deletions(-)
 create mode 100644 chrome/browser/resources/proxy_config.css
 create mode 100644 chrome/browser/resources/proxy_config.html
 create mode 100644 chrome/browser/resources/proxy_config.js
@@ -170,7 +170,7 @@ diff --git a/chrome/browser/resources/proxy_config.html b/chrome/browser/resourc
new file mode 100644
--- /dev/null
+++ b/chrome/browser/resources/proxy_config.html
@@ -0,0 +1,78 @@
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+<head>
@@ -217,7 +217,8 @@ new file mode 100644
+        Reset will update the displayed configuration to match the one currently in use.
+      </div>
+      <div class="section-container">
+          <input type="radio" id="empty" name="mode" value="empty" checked><label for="empty">None</label><br/>
+          <input type="radio" id="empty" name="mode" value="empty"><label for="empty">System Default</label><br/>
+          <input type="radio" id="direct" name="mode" value="direct"><label for="direct">Direct</label><br/>
+          <input type="radio" id="auto-detect" name="mode" value="auto-detect"><label for="auto-detect">Auto-detect (WPAD DHCP/DNS)</label><br/>
+          <input type="radio" id="use-pac-url" name="mode" value="use-pac-url"><label for="use-pac-url">Use PAC URL: <input id='pac-url' value="" size="40" /></label>
+          <p><input type="checkbox" id="pac-mandatory" name="pac-mandatory"><label for="pac-mandatory">Do not allow fallback to direct connection in case PAC script fails</label></p>
@@ -253,7 +254,7 @@ diff --git a/chrome/browser/resources/proxy_config.js b/chrome/browser/resources
new file mode 100644
--- /dev/null
+++ b/chrome/browser/resources/proxy_config.js
@@ -0,0 +1,252 @@
@@ -0,0 +1,262 @@
+/*
+    This file is part of Bromite.
+
@@ -296,6 +297,7 @@ new file mode 100644
+  var kIdClearButton = 'clear';
+
+  var kIdModeEmpty = 'empty';
+  var kIdModeDirect = 'direct';
+  var kIdModeAutoDetect = 'auto-detect';
+  var kIdModeUsePacURL = 'use-pac-url';
+
@@ -381,7 +383,7 @@ new file mode 100644
+          "rules": {
+            "bypass_rules": "",
+            "reverse_bypass": false,
+            "type": "empty"
+            "type": "none"
+          }
+        };
+    },
@@ -394,7 +396,14 @@ new file mode 100644
+        return {
+          "auto_detect": false,
+          "rules": {
+            "type": "empty"
+            "type": "none"
+          }
+        };
+      } else if ($(kIdModeDirect).checked) {
+        return {
+          "auto_detect": false,
+          "rules": {
+            "type": "direct"
+          }
+        };
+      } else if ($(kIdModeAutoDetect).checked) {
@@ -438,15 +447,17 @@ new file mode 100644
+     * Updates the UI to display the current proxy configuration.
+     */
+    renderConfig_: function() {
+      if (this.currentConfig.auto_detect)
+      if (this.currentConfig.auto_detect) {
+        $(kIdModeAutoDetect).checked = true;
+      else if (this.currentConfig.hasOwnProperty('pac_url')) {
+      } else if (this.currentConfig.rules.type == "none") {
+        $(kIdModeEmpty).checked = true;
+      } else if (this.currentConfig.rules.type == "direct") {
+        $(kIdModeDirect).checked = true;
+      } else if (this.currentConfig.hasOwnProperty('pac_url')) {
+        $(kIdPacURL).value = this.currentConfig.pac_url;
+        $(kIdPacMandatory).checked = this.currentConfig.pac_mandatory;
+        $(kIdModeUsePacURL).checked = true;
+      } else if (this.currentConfig.rules.type == "empty")
+        $(kIdModeEmpty).checked = true;
+      else {
+      } else {
+        $(kIdBypassRules).value = this.currentConfig.rules.bypass_rules;
+        $(kIdReverseBypass).checked = this.currentConfig.rules.reverse_bypass;
+
@@ -542,7 +553,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webu
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/webui/proxy_config_ui.cc
@@ -0,0 +1,395 @@
@@ -0,0 +1,413 @@
+/*
+    This file is part of Bromite.
+
@@ -700,7 +711,7 @@ new file mode 100644
+      encodeConfig(config.value(), state);
+      break;
+    case net::ProxyConfigService::CONFIG_UNSET:
+      // nothing will be populated
+      state.SetPath({"config", "rules", "type"}, base::Value("none"));
+      break;
+    case net::ProxyConfigService::CONFIG_PENDING:
+      //NOTE: this can only happen when triggered manually first time
@@ -736,7 +747,7 @@ new file mode 100644
+  const char *type;
+  switch (rules.type) {
+    case net::ProxyConfig::ProxyRules::Type::EMPTY:
+      type = "empty";
+      type = "direct";
+      break;
+    case net::ProxyConfig::ProxyRules::Type::PROXY_LIST:
+      type = "list";
@@ -799,13 +810,25 @@ new file mode 100644
+
+  net::ProxyConfigWithAnnotation config;
+  auto availability = proxy_config_service_->GetLatestProxyConfig(&config);
+
+  const base::DictionaryValue* dict =
+      profile_->GetPrefs()->GetDictionary(proxy_config::prefs::kProxy);
+  ProxyConfigDictionary proxy_dict(dict->Clone());
+  ProxyPrefs::ProxyMode mode;
+  if (!proxy_dict.GetMode(&mode) || mode == ProxyPrefs::MODE_SYSTEM) {
+    availability = net::ProxyConfigService::CONFIG_UNSET;
+  }
+
+  OnProxyConfigChanged(config, availability);
+}
+
+void ProxyConfigMessageHandler::OnClear(const base::ListValue* list) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+  profile_->GetPrefs()->ClearPref(proxy_config::prefs::kProxy);
+  const base::Value cfg = ProxyConfigDictionary::CreateSystem();
+  profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+  profile_->GetPrefs()->CommitPendingWrite();
+  OnEnableNotifyUIWithState(nullptr);
+}
+
+void ProxyConfigMessageHandler::OnApply(const base::ListValue* list) {
@@ -883,8 +906,11 @@ new file mode 100644
+      proxyConfig.proxy_rules().proxies_for_ftp.SetFromPacString(ftp->GetString());
+      proxyConfig.proxy_rules().fallback_proxies.SetFromPacString(fallback->GetString());
+      readBypass = true;
+  } else if (t == "empty") {
+  } else if (t == "direct") {
+      proxyConfig.proxy_rules().type = net::ProxyConfig::ProxyRules::Type::EMPTY;
+  } else if (t == "none") {
+      OnClear(nullptr);
+      return;
+  } else {
+     // invalid type
+     LOG(WARNING) << "invalid proxy configuration type";
@@ -912,13 +938,13 @@ new file mode 100644
+  if (proxyConfig.auto_detect()) {
+    const base::Value cfg = ProxyConfigDictionary::CreateAutoDetect();
+    profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+    return;
+  } else if (proxyConfig.has_pac_url()) {
+    const base::Value cfg = ProxyConfigDictionary::CreatePacScript(proxyConfig.pac_url().spec(), proxyConfig.pac_mandatory());
+    profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+    return;
+  }
+
+  } else if (proxyConfig.proxy_rules().type == net::ProxyConfig::ProxyRules::Type::EMPTY) {
+    const base::Value cfg = ProxyConfigDictionary::CreateDirect();
+    profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+  } else {
+    auto proxyRulesAsString = proxyConfig.proxy_rules().ToString();
+    auto bypassRulesAsString = proxyConfig.proxy_rules().bypass_rules.ToString();
+
@@ -927,6 +953,9 @@ new file mode 100644
+                            bypassRulesAsString, proxyConfig.proxy_rules().reverse_bypass);
+    profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+  }
+  profile_->GetPrefs()->CommitPendingWrite();
+  OnEnableNotifyUIWithState(nullptr);
+}
+
+}  // namespace
+
@@ -1133,7 +1162,16 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_config.cc
--- a/net/proxy_resolution/proxy_config.cc
+++ b/net/proxy_resolution/proxy_config.cc
@@ -141,6 +141,51 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
@@ -110,7 +110,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
                                    &single_proxies,
                                    ProxyServer::SCHEME_HTTP);
         type = Type::PROXY_LIST;
-        return;
+        continue;
       }
 
       // Trim whitespace off the url scheme.
@@ -141,6 +141,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
   }
 }
 
@@ -1142,13 +1180,18 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
+    return "";
+  }
+
+  // special case: a single proxy server specified
+  // special case: a single proxy servers list specified
+  if (type == Type::PROXY_LIST) {
+    if (single_proxies.size() == 1) {
+      return single_proxies.Get().ToURI();
+    std::string proxy_list;
+    for (const ProxyServer& proxy_server :
+         single_proxies.GetAll()) {
+      proxy_list += proxy_server.ToURI() + ";";
+    }
+    // more than 1 proxies or 0 proxies is unexpected
+    return "";
+    // remove last semicolon
+    if (proxy_list.length() != 0 ) {
+      proxy_list.pop_back();
+    }
+    return proxy_list;
+  }
+
+  if (type != Type::PROXY_LIST_PER_SCHEME) {
+3 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ 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
@@ -51,6 +51,8 @@ public class PrivacySettings
@@ -50,6 +50,8 @@ public class PrivacySettings
 
     private ManagedPreferenceDelegate mManagedPreferenceDelegate;
 
@@ -71,7 +71,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
         PrivacyPreferencesManager privacyPrefManager = PrivacyPreferencesManager.getInstance();
@@ -91,6 +93,10 @@ public class PrivacySettings
@@ -90,6 +92,10 @@ public class PrivacySettings
                     Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
         } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
             PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((boolean) newValue);
@@ -82,7 +82,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
         } else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
             PrefServiceBridge.getInstance().setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
         }
@@ -126,6 +132,11 @@ public class PrivacySettings
@@ -125,6 +131,11 @@ public class PrivacySettings
                     prefServiceBridge.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
         }
 
+4 −4
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ new mode 100755
 /**
  * Fragment to keep track of the all the privacy related preferences.
  */
@@ -55,6 +57,7 @@ public class PrivacySettings
@@ -54,6 +56,7 @@ public class PrivacySettings
     private ManagedPreferenceDelegate mManagedPreferenceDelegate;
 
     public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
@@ -62,7 +62,7 @@ new mode 100755
 
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
@@ -85,6 +88,11 @@ public class PrivacySettings
@@ -84,6 +87,11 @@ public class PrivacySettings
         searchSuggestionsPref.setOnPreferenceChangeListener(this);
         searchSuggestionsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
 
@@ -74,7 +74,7 @@ new mode 100755
         updateSummaries();
     }
 
@@ -106,6 +114,9 @@ public class PrivacySettings
@@ -105,6 +113,9 @@ public class PrivacySettings
             SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
             sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
             sharedPreferencesEditor.apply();
@@ -84,7 +84,7 @@ new mode 100755
         }
 
         return true;
@@ -180,6 +191,13 @@ public class PrivacySettings
@@ -179,6 +190,13 @@ public class PrivacySettings
                 (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
         closeTabsOnExitPref.setOnPreferenceChangeListener(this);
         closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
Loading