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

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

Issue 892443002: Add UMA histograms for tracking empty usernames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 4c65080b080dab0fcbc0947e8b477e872fcd4349..c04a3e92ebccb895493dda1938b33766d64c5719 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -454,6 +454,14 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
UMA_HISTOGRAM_ENUMERATION("PasswordManager.SyncingAccountState",
2 * sync_username.empty() + syncing_account_saved,
4);
+
+ sql::Statement empty_usernames_statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT COUNT(*) FROM logins "
+ "WHERE blacklisted_by_user=0 AND username_value=''"));
+ if (empty_usernames_statement.Step()) {
+ int empty_forms = empty_usernames_statement.ColumnInt(0);
+ UMA_HISTOGRAM_COUNTS_100("PasswordManager.NumEmptyUsernames", empty_forms);
+ }
}
PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) {

Powered by Google App Engine
This is Rietveld 408576698