Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: components/password_manager/core/browser/psl_matching_helper.cc

Issue 149503006: Fuzzy password matching kill switch by Finch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unused variables on mobile Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/psl_matching_helper.cc
diff --git a/components/password_manager/core/browser/psl_matching_helper.cc b/components/password_manager/core/browser/psl_matching_helper.cc
index 8230ef030579487ee39eb776bace55128e59af5c..d34abebd411eac7077b8ef11ff1ed1c4b2f5fe92 100644
--- a/components/password_manager/core/browser/psl_matching_helper.cc
+++ b/components/password_manager/core/browser/psl_matching_helper.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/metrics/field_trial.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/common/password_manager_switches.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -14,6 +15,15 @@
using autofill::PasswordForm;
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+namespace {
+
+const char kPSLMatchingDesktopFieldTrialName[] = "PSLMatchingDesktop";
+const char kPSLMatchingDesktopFieldTrialDisabledGroupName[] = "Disabled";
+
+} // namespace
+#endif
+
bool PSLMatchingHelper::psl_enabled_override_ = false;
PSLMatchingHelper::PSLMatchingHelper() : psl_enabled_(DeterminePSLEnabled()) {}
@@ -58,6 +68,12 @@ bool PSLMatchingHelper::DeterminePSLEnabled() {
// Default choice is "enabled", so we do not need to check for
// kEnablePasswordAutofillPublicSuffixDomainMatching.
bool enabled = true;
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ if (base::FieldTrialList::FindFullName(kPSLMatchingDesktopFieldTrialName) ==
+ kPSLMatchingDesktopFieldTrialDisabledGroupName) {
+ enabled = false;
+ }
+#endif
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePasswordAutofillPublicSuffixDomainMatching)) {
enabled = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698