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

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

Issue 2678113002: Record UMA histogram when Form-Not-Secure warning is shown (Closed)
Patch Set: Created 3 years, 10 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_autofill_manager.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager.cc b/components/password_manager/core/browser/password_autofill_manager.cc
index 6b7cbfbd435381f9694a2c452f92916902ffcd36..903350306b6ed3c29d0000a63564b7cad5d5675b 100644
--- a/components/password_manager/core/browser/password_autofill_manager.cc
+++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -233,6 +233,11 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
suggestions.front().frontend_id = autofill::POPUP_ITEM_ID_SEPARATOR;
#endif
suggestions.insert(suggestions.begin(), http_warning_suggestion);
+
+ if (!did_show_form_not_secure_warning_) {
+ did_show_form_not_secure_warning_ = true;
+ metrics_util::LogShowedFormNotSecureWarningOnCurrentNavigation();
+ }
}
autofill_client_->ShowAutofillPopup(bounds,
@@ -254,10 +259,16 @@ void PasswordAutofillManager::OnShowNotSecureWarning(
autofill_client_->ShowAutofillPopup(bounds, text_direction, suggestions,
weak_ptr_factory_.GetWeakPtr());
+
+ if (did_show_form_not_secure_warning_)
+ return;
+ did_show_form_not_secure_warning_ = true;
+ metrics_util::LogShowedFormNotSecureWarningOnCurrentNavigation();
}
void PasswordAutofillManager::DidNavigateMainFrame() {
login_to_password_info_.clear();
+ did_show_form_not_secure_warning_ = false;
}
bool PasswordAutofillManager::FillSuggestionForTest(

Powered by Google App Engine
This is Rietveld 408576698