[Lacros] Propagate proxy settings from Ash-Chrome
Proxy settings on different platforms are monitored using platform
specific implementations of ProxyConfigService
(i.e. ProxyConfigServiceMac, ProxyConfigServiceWin,
ProxyConfigServiceLinux etc.) which listens/polls proxy configs from
the OS.
This CL introduces the ProxyConfigServiceLacros which listens for
proxy settings coming from Ash-Chrome via the mojo crosapi. The proxy
configs are propagated to the browser's NetworkService only if the
pref kUseAshProxy is true. If kUseAshProxy is false, the proxy config
sent by Ash-Chrome is not used by the NetworkService.
To keep the existing order of precedence, if a proxy is configured via
an extension, it will have priority over the proxy config coming from
Ash-Chrome, regardless of the value of kUseAshProxy.
Not forcing secondary profiles to go through the system proxy is a
privacy improvement, especially in a commercial deployment. In a
follow-up CL we will add a UI checkbox to allow secondary profiles to
opt-in on using the system proxy. For now, kUseAshProxy is always true
for primary profiles and false for secondary profiles.
Bug: b/192914999
Test: unit tests, browser test
Change-Id: Icac55ce896caf0afe789b7a86c6b93093c1ed444
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3122991
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: Roland Bock <[email protected]>
Reviewed-by: Matt Menke <[email protected]>
Reviewed-by: Pavol Marko <[email protected]>
Commit-Queue: Andreea-Elena Costinas <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923876}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 4293ff1..a0e78ab 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -418,6 +418,7 @@
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/lacros/lacros_prefs.h"
+#include "chrome/browser/lacros/net/proxy_config_service_lacros.h"
#endif
#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -1356,6 +1357,7 @@
#if BUILDFLAG(IS_CHROMEOS_LACROS)
lacros_prefs::RegisterProfilePrefs(registry);
+ chromeos::ProxyConfigServiceLacros::RegisterProfilePrefs(registry);
#endif
#if defined(OS_WIN)