Commit f6e0c4ac authored by Bettina's avatar Bettina Committed by Commit Bot

Add UserMetricsAction for Password Protection.

Bug: 1056921
Change-Id: Ibcf6100818483ceeb40d82e65bb8f909ad466818
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248898Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: Bettina Dea <bdea@chromium.org>
Auto-Submit: Bettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779490}
parent 57d367b7
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -85,6 +87,8 @@ ...@@ -85,6 +87,8 @@
#include "chrome/browser/safe_browsing/android/password_reuse_controller_android.h" #include "chrome/browser/safe_browsing/android/password_reuse_controller_android.h"
#endif #endif
using base::RecordAction;
using base::UserMetricsAction;
using content::BrowserThread; using content::BrowserThread;
using sync_pb::GaiaPasswordReuse; using sync_pb::GaiaPasswordReuse;
using sync_pb::UserEventSpecifics; using sync_pb::UserEventSpecifics;
...@@ -891,16 +895,22 @@ void ChromePasswordProtectionService::HandleUserActionOnModalWarning( ...@@ -891,16 +895,22 @@ void ChromePasswordProtectionService::HandleUserActionOnModalWarning(
GetNavigationIDFromPrefsByOrigin(profile_->GetPrefs(), origin); GetNavigationIDFromPrefsByOrigin(profile_->GetPrefs(), origin);
if (action == WarningAction::CHANGE_PASSWORD) { if (action == WarningAction::CHANGE_PASSWORD) {
RecordAction(UserMetricsAction(
"PasswordProtection.ModalWarning.ChangePasswordButtonClicked"));
LogDialogMetricsOnChangePassword(web_contents, password_type, navigation_id, LogDialogMetricsOnChangePassword(web_contents, password_type, navigation_id,
outcome, verdict_type, verdict_token); outcome, verdict_type, verdict_token);
OpenChangePasswordUrl(web_contents, password_type); OpenChangePasswordUrl(web_contents, password_type);
} else if (action == WarningAction::IGNORE_WARNING && } else if (action == WarningAction::IGNORE_WARNING &&
password_type.is_account_syncing()) { password_type.is_account_syncing()) {
RecordAction(UserMetricsAction(
"PasswordProtection.ModalWarning.IgnoreButtonClicked"));
// No need to change state. // No need to change state.
MaybeLogPasswordReuseDialogInteraction( MaybeLogPasswordReuseDialogInteraction(
navigation_id, PasswordReuseDialogInteraction::WARNING_ACTION_IGNORED); navigation_id, PasswordReuseDialogInteraction::WARNING_ACTION_IGNORED);
} else if (action == WarningAction::CLOSE && } else if (action == WarningAction::CLOSE &&
password_type.is_account_syncing()) { password_type.is_account_syncing()) {
RecordAction(
UserMetricsAction("PasswordProtection.ModalWarning.CloseWarning"));
// No need to change state. // No need to change state.
MaybeLogPasswordReuseDialogInteraction( MaybeLogPasswordReuseDialogInteraction(
navigation_id, PasswordReuseDialogInteraction::WARNING_UI_IGNORED); navigation_id, PasswordReuseDialogInteraction::WARNING_UI_IGNORED);
...@@ -968,11 +978,15 @@ void ChromePasswordProtectionService::HandleUserActionOnPageInfo( ...@@ -968,11 +978,15 @@ void ChromePasswordProtectionService::HandleUserActionOnPageInfo(
const Origin origin = Origin::Create(url); const Origin origin = Origin::Create(url);
if (action == WarningAction::CHANGE_PASSWORD) { if (action == WarningAction::CHANGE_PASSWORD) {
RecordAction(UserMetricsAction(
"PasswordProtection.PageInfo.ChangePasswordButtonClicked"));
OpenChangePasswordUrl(web_contents, password_type); OpenChangePasswordUrl(web_contents, password_type);
return; return;
} }
if (action == WarningAction::MARK_AS_LEGITIMATE) { if (action == WarningAction::MARK_AS_LEGITIMATE) {
RecordAction(
UserMetricsAction("PasswordProtection.PageInfo.MarkSiteAsLegitimate"));
// TODO(vakh): There's no good enum to report this dialog interaction. // TODO(vakh): There's no good enum to report this dialog interaction.
// This needs to be investigated. // This needs to be investigated.
UpdateSecurityState(SB_THREAT_TYPE_SAFE, password_type, web_contents); UpdateSecurityState(SB_THREAT_TYPE_SAFE, password_type, web_contents);
...@@ -1006,6 +1020,8 @@ void ChromePasswordProtectionService::HandleUserActionOnPageInfo( ...@@ -1006,6 +1020,8 @@ void ChromePasswordProtectionService::HandleUserActionOnPageInfo(
void ChromePasswordProtectionService::HandleResetPasswordOnInterstitial( void ChromePasswordProtectionService::HandleResetPasswordOnInterstitial(
content::WebContents* web_contents, content::WebContents* web_contents,
WarningAction action) { WarningAction action) {
RecordAction(
UserMetricsAction("PasswordProtection.Interstitial.ResetPassword"));
// Opens enterprise change password page in current tab for user to change // Opens enterprise change password page in current tab for user to change
// password. // password.
OpenUrl(web_contents, GetEnterpriseChangePasswordURL(), OpenUrl(web_contents, GetEnterpriseChangePasswordURL(),
......
...@@ -18257,6 +18257,59 @@ should be able to be added at any place in this file. ...@@ -18257,6 +18257,59 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="PasswordProtection.Interstitial.ResetPassword">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user clicks on the reset password button on the
interstitial.
</description>
</action>
<action name="PasswordProtection.ModalWarning.ChangePasswordButtonClicked">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user clicked on the change password button on the password
protection modal warning.
</description>
</action>
<action name="PasswordProtection.ModalWarning.CloseWarning">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user closed the password protection modal warning.
</description>
</action>
<action name="PasswordProtection.ModalWarning.IgnoreButtonClicked">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user clicked on the ignore button on the password
protection modal warning.
</description>
</action>
<action name="PasswordProtection.PageInfo.ChangePasswordButtonClicked">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user clicks on the change password button on the page info
bubble.
</description>
</action>
<action name="PasswordProtection.PageInfo.MarkSiteAsLegitimate">
<owner>bdea@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<description>
Reported when the user clicks on the mark site as legitimate button on the
page info bubble.
</description>
</action>
<action name="Paste"> <action name="Paste">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment