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

Unified Diff: components/password_manager/sync/browser/sync_credentials_filter.cc

Issue 2220423002: Fix sync-credential-related metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 4 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/sync/browser/sync_credentials_filter.cc
diff --git a/components/password_manager/sync/browser/sync_credentials_filter.cc b/components/password_manager/sync/browser/sync_credentials_filter.cc
index 5632331d96303c081edb89b22c5a16e940328d9a..48bdf7d70c546c8cc6f49fda180289bbf829cb2b 100644
--- a/components/password_manager/sync/browser/sync_credentials_filter.cc
+++ b/components/password_manager/sync/browser/sync_credentials_filter.cc
@@ -10,6 +10,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
+#include "components/password_manager/core/browser/password_form_manager.h"
#include "components/password_manager/core/browser/password_manager_util.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/password_manager/sync/browser/password_sync_util.h"
@@ -79,10 +80,16 @@ bool SyncCredentialsFilter::ShouldSave(
signin_manager_factory_function_.Run());
}
-void SyncCredentialsFilter::ReportFormUsed(
- const autofill::PasswordForm& form) const {
- base::RecordAction(
- base::UserMetricsAction("PasswordManager_SyncCredentialUsed"));
+void SyncCredentialsFilter::ReportFormLoginSuccess(
+ const PasswordFormManager& form_manager) const {
+ if (!form_manager.IsNewLogin() &&
+ sync_util::IsSyncAccountCredential(
+ form_manager.pending_credentials(),
+ sync_service_factory_function_.Run(),
+ signin_manager_factory_function_.Run())) {
+ base::RecordAction(base::UserMetricsAction(
+ "PasswordManager_SyncCredentialFilledAndLoginSuccessfull"));
+ }
}
// static

Powered by Google App Engine
This is Rietveld 408576698