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

Unified Diff: chrome/browser/safe_browsing/chrome_password_protection_service.cc

Issue 2869253002: Add UMA metrics to phishguard pings (Closed)
Patch Set: resolve comments on histograms.xml Created 3 years, 7 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: chrome/browser/safe_browsing/chrome_password_protection_service.cc
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
index 053284d9f30eaa5fa8aede94686bb119db9ef067..087bcd06b7032add87d4a542bbfa5e2a88b1df34 100644
--- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc
+++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
@@ -23,9 +23,11 @@ using content::BrowserThread;
namespace safe_browsing {
namespace {
+
// The number of user gestures we trace back for login event attribution.
const int kPasswordEventAttributionUserGestureLimit = 2;
-}
+
+} // namespace
ChromePasswordProtectionService::ChromePasswordProtectionService(
SafeBrowsingService* sb_service,
@@ -78,15 +80,21 @@ bool ChromePasswordProtectionService::IsIncognito() {
}
bool ChromePasswordProtectionService::IsPingingEnabled(
- const base::Feature& feature) {
+ const base::Feature& feature,
+ RequestOutcome* reason) {
+ DCHECK(feature.name == kProtectedPasswordEntryPinging.name ||
+ feature.name == kPasswordFieldOnFocusPinging.name);
if (!base::FeatureList::IsEnabled(feature)) {
+ *reason = DISABLED_DUE_TO_FEATURE_DISABLED;
return false;
}
bool allowed_incognito =
base::GetFieldTrialParamByFeatureAsBool(feature, "incognito", false);
- if (IsIncognito() && !allowed_incognito)
+ if (IsIncognito() && !allowed_incognito) {
+ *reason = DISABLED_DUE_TO_INCOGNITO;
return false;
+ }
bool allowed_all_population =
base::GetFieldTrialParamByFeatureAsBool(feature, "all_population", false);
@@ -101,6 +109,8 @@ bool ChromePasswordProtectionService::IsPingingEnabled(
base::GetFieldTrialParamByFeatureAsBool(feature, "history_sync", false);
if (IsHistorySyncEnabled() && allowed_history_sync)
return true;
+
+ *reason = DISABLED_DUE_TO_USER_POPULATION;
}
return allowed_all_population;

Powered by Google App Engine
This is Rietveld 408576698