Commit 43e24988 authored by vabr@chromium.org's avatar vabr@chromium.org

Fuzzy password matching kill switch by Finch

This is the client side part, the server config is in CL 61376672.

BUG=338260,338289

Review URL: https://codereview.chromium.org/149503006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251038 0039d316-1c4b-4281-b951-d872f2087c98
parent ab649bbc
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment