mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-09 03:07:48 -03:00
add dns config flag
This commit is contained in:
parent
3666929ee7
commit
840ec41e77
2 changed files with 27 additions and 10 deletions
|
@ -29,10 +29,14 @@
|
|||
"Disable Thorium Top Bar Icons",
|
||||
"Disables the custom colored top bar icons in Thorium, and restores the default grey Chromium icon colors.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("disable-thorium-icons")},
|
||||
{"disable-thorium-dns-config",
|
||||
"Disable Thorium Custom DNS Config",
|
||||
"Disables the custom DNS configuration used by default in Thorium. Useful when this config breaks something, "
|
||||
"due to external apps or a non-standard system DNS config setting.",
|
||||
{"force-high-contrast",
|
||||
"Enable High Contrast Mode",
|
||||
"Enables high contrast mode for all Thorium instances.",
|
||||
kOsAll, SINGLE_VALUE_TYPE(switches::kForceHighContrast)},
|
||||
kOsDesktop, SINGLE_VALUE_TYPE(switches::kForceHighContrast)},
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
{"disable-aero",
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
|
@ -249,16 +250,28 @@ class DnsClientImpl : public DnsClient {
|
|||
private:
|
||||
std::optional<DnsConfig> BuildEffectiveConfig() const {
|
||||
DnsConfig config;
|
||||
// in Bromite it is sufficient to have secure DoH enabled to give the overrides priority
|
||||
if (config_overrides_.dns_over_https_config && config_overrides_.secure_dns_mode) {
|
||||
config = config_overrides_.ApplyOverrides(DnsConfig());
|
||||
} else {
|
||||
if (!system_config_) {
|
||||
LOG(WARNING) << "BuildEffectiveConfig(): no system configuration";
|
||||
return std::nullopt;
|
||||
}
|
||||
if (!base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-dns-config")) {
|
||||
// in Bromite it is sufficient to have secure DoH enabled to give the overrides priority
|
||||
if (config_overrides_.dns_over_https_config && config_overrides_.secure_dns_mode) {
|
||||
config = config_overrides_.ApplyOverrides(DnsConfig());
|
||||
} else {
|
||||
if (!system_config_) {
|
||||
LOG(WARNING) << "BuildEffectiveConfig(): no system configuration";
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
config = config_overrides_.ApplyOverrides(system_config_.value());
|
||||
config = config_overrides_.ApplyOverrides(system_config_.value());
|
||||
}
|
||||
} else {
|
||||
if (config_overrides_.OverridesEverything()) {
|
||||
config = config_overrides_.ApplyOverrides(DnsConfig());
|
||||
} else {
|
||||
if (!system_config_)
|
||||
LOG(WARNING) << "BuildEffectiveConfig(): system configuration not set";
|
||||
return std::nullopt;
|
||||
|
||||
config = config_overrides_.ApplyOverrides(system_config_.value());
|
||||
}
|
||||
}
|
||||
|
||||
UpdateConfigForDohUpgrade(&config);
|
||||
|
|
Loading…
Reference in a new issue