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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 794133002: [Password Manager] Add UMA signals to understand how often the password form submit navigate… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/password_manager/chrome_password_manager_client.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index b98f9e7d496500ebd6343c48ccf5c09388142be0..f8181abba244152526fbdc71d97a1112d45cb0e0 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -43,6 +43,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_urls.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/base/url_util.h"
#include "third_party/re2/re2/re2.h"
@@ -61,6 +62,19 @@ void ReportOsPassword() {
password_manager_util::MAX_PASSWORD_STATUS);
}
+// Helper function to capture the UMA matriculations for instances where
+// submitting a password |login_form| navigates to the different domain/host or
+// not.
+void LogFormSubmitNavigateToDifferentDomain(
vabr (Chromium) 2014/12/11 12:31:33 nit: Log->Report (logging is usually used in the d
Pritam Nikam 2014/12/12 14:30:08 Done.
+ const autofill::PasswordForm& login_form) {
+ bool navigates_to_different_domain =
+ !net::registry_controlled_domains::SameDomainOrHost(
+ login_form.origin, login_form.action,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ UMA_HISTOGRAM_BOOLEAN("PasswordManager.SubmitNavigatesToDifferentDomain",
+ navigates_to_different_domain);
+}
+
} // namespace
using password_manager::ContentPasswordManagerDriverFactory;
@@ -210,6 +224,11 @@ bool ChromePasswordManagerClient::PromptUserToSavePassword(
return false;
}
+ // Capture the UMA stats to get to know the volume and frequency for
vabr (Chromium) 2014/12/11 12:31:33 I don't think this comment is necessary. We always
Pritam Nikam 2014/12/12 14:30:08 Done.
+ // occurences where submiting the password login form lands to different
+ // domain.
+ LogFormSubmitNavigateToDifferentDomain(form_to_save->observed_form());
+
if (IsTheHotNewBubbleUIEnabled()) {
ManagePasswordsUIController* manage_passwords_ui_controller =
ManagePasswordsUIController::FromWebContents(web_contents());

Powered by Google App Engine
This is Rietveld 408576698