Convert SSLCommonNameMismatchHandling finch trial to a feature
BUG=521830
Review-Url: https://codereview.chromium.org/2556703004
Cr-Commit-Position: refs/heads/master@{#437310}
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc
index b0f152e..8595750 100644
--- a/chrome/browser/ssl/ssl_error_handler.cc
+++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -10,7 +10,6 @@
#include "base/callback_helpers.h"
#include "base/feature_list.h"
#include "base/macros.h"
-#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "base/time/clock.h"
@@ -48,6 +47,9 @@
"CaptivePortalInterstitial", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
+const base::Feature kSSLCommonNameMismatchHandling{
+ "SSLCommonNameMismatchHandling", base::FEATURE_ENABLED_BY_DEFAULT};
+
// The delay in milliseconds before displaying the SSL interstitial.
// This can be changed in tests.
// - If there is a name mismatch and a suggested URL available result arrives
@@ -119,7 +121,7 @@
"Redirecting navigation %s -> %s because the server presented a "
"certificate valid for %s but not for %s. To disable such "
"redirects launch Chrome with the following flag: "
- "--force-fieldtrials=SSLCommonNameMismatchHandling/Disabled/",
+ "--disable-features=SSLCommonNameMismatchHandling",
request_url_hostname_.c_str(), suggested_url_hostname_.c_str(),
suggested_url_hostname_.c_str(), request_url_hostname_.c_str()));
web_contents_->RemoveUserData(UserDataKey());
@@ -148,8 +150,7 @@
#endif
bool IsSSLCommonNameMismatchHandlingEnabled() {
- return base::FieldTrialList::FindFullName("SSLCommonNameMismatchHandling") ==
- "Enabled";
+ return base::FeatureList::IsEnabled(kSSLCommonNameMismatchHandling);
}
} // namespace