Index: components/password_manager/core/browser/login_database.cc |
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc |
index f2ab2e4bad5719c6d1a8ebb1f20fff4bb8511762..0596743f21efc581a18432839ef9ea14a7e0612a 100644 |
--- a/components/password_manager/core/browser/login_database.cc |
+++ b/components/password_manager/core/browser/login_database.cc |
@@ -324,8 +324,9 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username, |
bool custom_passphrase_sync_enabled) { |
sql::Statement s(db_.GetCachedStatement( |
SQL_FROM_HERE, |
- "SELECT signon_realm, blacklisted_by_user, COUNT(username_value) " |
- "FROM logins GROUP BY signon_realm, blacklisted_by_user")); |
+ "SELECT signon_realm, password_type, blacklisted_by_user," |
+ "COUNT(username_value) FROM logins GROUP BY " |
+ "signon_realm, password_type, blacklisted_by_user")); |
if (!s.is_valid()) |
return; |
@@ -335,23 +336,38 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username, |
custom_passphrase = "WithCustomPassphrase"; |
} |
- int total_accounts = 0; |
+ int total_user_created_accounts = 0; |
+ int total_generated_accounts = 0; |
int blacklisted_sites = 0; |
while (s.Step()) { |
- int blacklisted = s.ColumnInt(1); |
- int accounts_per_site = s.ColumnInt(2); |
+ PasswordForm::Type password_type = |
+ static_cast<PasswordForm::Type>(s.ColumnInt(1)); |
+ int blacklisted = s.ColumnInt(2); |
+ int accounts_per_site = s.ColumnInt(3); |
if (blacklisted) { |
++blacklisted_sites; |
+ } else if (password_type == PasswordForm::TYPE_GENERATED) { |
+ total_generated_accounts += accounts_per_site; |
+ LogAccountStat( |
+ base::StringPrintf("PasswordManager.AccountsPerSite.AutoGenerated.%s", |
+ custom_passphrase.c_str()), |
+ accounts_per_site); |
} else { |
total_accounts += accounts_per_site; |
Ilya Sherman
2014/11/18 22:37:10
You might want to update the variable name here an
Garrett Casto
2014/11/18 22:54:49
What I get for sending a response while compiling.
|
- LogAccountStat(base::StringPrintf("PasswordManager.AccountsPerSite.%s", |
- custom_passphrase.c_str()), |
- accounts_per_site); |
+ LogAccountStat( |
+ base::StringPrintf("PasswordManager.AccountsPerSite.UserCreated.%s", |
+ custom_passphrase.c_str()), |
+ accounts_per_site); |
} |
} |
- LogAccountStat(base::StringPrintf("PasswordManager.TotalAccounts.%s", |
- custom_passphrase.c_str()), |
- total_accounts); |
+ LogAccountStat( |
+ base::StringPrintf("PasswordManager.TotalAccounts.UserCreated.%s", |
+ custom_passphrase.c_str()), |
+ total_accounts); |
+ LogAccountStat( |
+ base::StringPrintf("PasswordManager.TotalAccounts.AutoGenerated.%s", |
+ custom_passphrase.c_str()), |
+ total_generated_accounts); |
LogAccountStat(base::StringPrintf("PasswordManager.BlacklistedSites.%s", |
custom_passphrase.c_str()), |
blacklisted_sites); |
@@ -368,13 +384,13 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username, |
usage_statement.ColumnInt(0)); |
if (type == PasswordForm::TYPE_GENERATED) { |
- LogTimesUsedStat( |
- base::StringPrintf("PasswordManager.TimesGeneratedPasswordUsed.%s", |
- custom_passphrase.c_str()), |
- usage_statement.ColumnInt(1)); |
+ LogTimesUsedStat(base::StringPrintf( |
+ "PasswordManager.TimesPasswordUsed.AutoGenerated.%s", |
+ custom_passphrase.c_str()), |
+ usage_statement.ColumnInt(1)); |
} else { |
LogTimesUsedStat( |
- base::StringPrintf("PasswordManager.TimesPasswordUsed.%s", |
+ base::StringPrintf("PasswordManager.TimesPasswordUsed.UserCreated.%s", |
custom_passphrase.c_str()), |
usage_statement.ColumnInt(1)); |
} |