Commit a634d446 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Record PasswordStore metrics also for the account store

LoginDatabase::ReportMetrics was recently updated to properly support
the account-scoped password store (in addition to the profile-scoped
one). However, StoreMetricsReporter was only calling
PasswordStore::ReportMetrics (which after a few indirections ends up in
LoginDatabase) for the profile store.
This CL adds a ReportMetrics call for the account store as well.

Bug: 1063852
Change-Id: I6afaac99f5525accd542182614e29934dc8f6dfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2207239Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770033}
parent 8986f2ee
......@@ -18,14 +18,18 @@ StoreMetricsReporter::StoreMetricsReporter(
const syncer::SyncService* sync_service,
const signin::IdentityManager* identity_manager,
PrefService* prefs) {
// May be null in tests.
if (PasswordStore* store = client->GetProfilePasswordStore()) {
store->ReportMetrics(
password_manager::sync_util::GetSyncUsernameIfSyncingPasswords(
sync_service, identity_manager),
client->GetPasswordSyncState() ==
password_manager::SYNCING_WITH_CUSTOM_PASSPHRASE,
client->IsUnderAdvancedProtection());
for (PasswordStore* store :
{client->GetProfilePasswordStore(), client->GetAccountPasswordStore()}) {
// May be null in tests. The account store is also null if the
// kEnablePasswordsAccountStorage feature is disabled.
if (store) {
store->ReportMetrics(
password_manager::sync_util::GetSyncUsernameIfSyncingPasswords(
sync_service, identity_manager),
client->GetPasswordSyncState() ==
password_manager::SYNCING_WITH_CUSTOM_PASSPHRASE,
client->IsUnderAdvancedProtection());
}
}
base::UmaHistogramBoolean(
"PasswordManager.Enabled",
......
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