Commit e3b9df2a authored by Bettina's avatar Bettina Committed by Commit Bot

Add experiment to creation of compromised credentials table

Depend on an saved password with domain experiment flag
for initializing the compromised credentials table.

Bug: 1026006
Change-Id: I56b45d911a21ef675a9af1b0bc618123f86919ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943231
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720329}
parent bb1bd779
...@@ -299,7 +299,10 @@ jumbo_static_library("browser") { ...@@ -299,7 +299,10 @@ jumbo_static_library("browser") {
"http_credentials_cleaner.cc", "http_credentials_cleaner.cc",
"http_credentials_cleaner.h", "http_credentials_cleaner.h",
] ]
deps += [ "//components/safe_browsing/common:safe_browsing_prefs" ] deps += [
"//components/safe_browsing:features",
"//components/safe_browsing/common:safe_browsing_prefs",
]
} }
if ((is_posix && !is_mac && !is_ios) || is_fuchsia) { if ((is_posix && !is_mac && !is_ios) || is_fuchsia) {
......
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
#include "url/origin.h" #include "url/origin.h"
#include "url/url_constants.h" #include "url/url_constants.h"
#if !defined(OS_IOS)
#include "components/safe_browsing/features.h"
#endif
using autofill::PasswordForm; using autofill::PasswordForm;
namespace password_manager { namespace password_manager {
...@@ -825,9 +829,14 @@ bool LoginDatabase::Init() { ...@@ -825,9 +829,14 @@ bool LoginDatabase::Init() {
} }
} }
// TODO(bdea): Create a more generic experiment for creation of compromise bool password_protection_show_domains_for_saved_password_is_on = true;
// credentials because the current experiment is leak detection specific. #if !defined(OS_IOS)
if (base::FeatureList::IsEnabled(password_manager::features::kLeakHistory)) { password_protection_show_domains_for_saved_password_is_on =
base::FeatureList::IsEnabled(
safe_browsing::kPasswordProtectionShowDomainsForSavedPasswords);
#endif
if (base::FeatureList::IsEnabled(password_manager::features::kLeakHistory) ||
password_protection_show_domains_for_saved_password_is_on) {
if (!compromised_credentials_table_.CreateTableIfNecessary()) { if (!compromised_credentials_table_.CreateTableIfNecessary()) {
LogDatabaseInitError(INIT_COMPROMISED_CREDENTIALS_ERROR); LogDatabaseInitError(INIT_COMPROMISED_CREDENTIALS_ERROR);
LOG(ERROR) << "Unable to create the compromised credentials table."; LOG(ERROR) << "Unable to create the compromised credentials table.";
......
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