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

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

Issue 644053003: [Password Manager] Add UMA stats for custom passphrase users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 6 years, 2 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/password_manager.cc
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index fec61d2cffe4a6aed2d5eb6d4e98c7b0f9d51cc6..c9925e5da705f28bc6d44066b1d5d4d8cba265c4 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -45,7 +45,8 @@ typedef autofill::SavePasswordProgressLogger Logger;
// that this is only ever called from a single thread in order to
// avoid needing to lock (a static boolean flag is then sufficient to
// guarantee running only once).
-void ReportMetrics(bool password_manager_enabled) {
+void ReportMetrics(bool password_manager_enabled,
+ PasswordManagerClient* client) {
static base::PlatformThreadId initial_thread_id =
base::PlatformThread::CurrentId();
DCHECK(initial_thread_id == base::PlatformThread::CurrentId());
@@ -55,6 +56,14 @@ void ReportMetrics(bool password_manager_enabled) {
return;
ran_once = true;
+ PasswordStore* store = client->GetPasswordStore();
+ // May be NULL in tests.
+ if (store) {
+ store->ReportMetrics(
+ client->GetSyncUsername(),
+ client->IsPasswordSyncEnabled(
+ password_manager::ONLY_CUSTOM_PASSPHRASE));
+ }
UMA_HISTOGRAM_BOOLEAN("PasswordManager.Enabled", password_manager_enabled);
}
@@ -124,7 +133,7 @@ PasswordManager::PasswordManager(PasswordManagerClient* client)
saving_passwords_enabled_.Init(prefs::kPasswordManagerSavingEnabled,
client_->GetPrefs());
- ReportMetrics(*saving_passwords_enabled_);
+ ReportMetrics(*saving_passwords_enabled_, client_);
}
PasswordManager::~PasswordManager() {

Powered by Google App Engine
This is Rietveld 408576698