Commit 7ed9e9c1 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Record PasswordManager.SaveUIDismissalReason.* for all users

PasswordManager.SaveUIDismissalReason has a base version (without
suffix), and also suffixed versions split by
PasswordAccountStorageUserState.
Before this CL, the split versions were only recorded if
features::kEnablePasswordsAccountStorage was enabled. That didn't
really make sense: Some of the UserStates don't exist without that
feature, but for the remaining states, the split histograms still make
sense.
So this CL adds recording of these histograms for users with that
feature disabled.

Bug: 1142797
Change-Id: I969bfe48f2337377deba6f102208e0c59ddf2309
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503519Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821710}
parent e19c5f70
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "components/password_manager/core/browser/password_bubble_experiment.h" #include "components/password_manager/core/browser/password_bubble_experiment.h"
#include "components/password_manager/core/browser/password_form_metrics_recorder.h" #include "components/password_manager/core/browser/password_form_metrics_recorder.h"
#include "components/password_manager/core/browser/password_manager_features_util.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_features.h"
...@@ -273,8 +274,16 @@ void SaveUpdateBubbleController::ReportInteractions() { ...@@ -273,8 +274,16 @@ void SaveUpdateBubbleController::ReportInteractions() {
if (state_ == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) { if (state_ == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) {
metrics_util::LogUpdateUIDismissalReason(dismissal_reason_); metrics_util::LogUpdateUIDismissalReason(dismissal_reason_);
} else if (state_ == password_manager::ui::PENDING_PASSWORD_STATE) { } else if (state_ == password_manager::ui::PENDING_PASSWORD_STATE) {
metrics_util::LogSaveUIDismissalReason(dismissal_reason_, base::Optional<metrics_util::PasswordAccountStorageUserState> user_state =
/*user_state=*/base::nullopt); base::nullopt;
Profile* profile = GetProfile();
if (profile) {
user_state = password_manager::features_util::
ComputePasswordAccountStorageUserState(
profile->GetPrefs(),
ProfileSyncServiceFactory::GetForProfile(profile));
}
metrics_util::LogSaveUIDismissalReason(dismissal_reason_, user_state);
} }
// Update the delegate so that it can send votes to the server. // Update the delegate so that it can send votes to the server.
......
...@@ -65,8 +65,6 @@ void LogSaveUIDismissalReason( ...@@ -65,8 +65,6 @@ void LogSaveUIDismissalReason(
NUM_UI_RESPONSES); NUM_UI_RESPONSES);
if (user_state.has_value()) { if (user_state.has_value()) {
DCHECK(base::FeatureList::IsEnabled(
password_manager::features::kEnablePasswordsAccountStorage));
std::string suffix = std::string suffix =
GetPasswordAccountStorageUserStateHistogramSuffix(user_state.value()); GetPasswordAccountStorageUserStateHistogramSuffix(user_state.value());
base::UmaHistogramEnumeration( base::UmaHistogramEnumeration(
......
...@@ -516,8 +516,7 @@ void LogGeneralUIDismissalReason(UIDismissalReason reason); ...@@ -516,8 +516,7 @@ void LogGeneralUIDismissalReason(UIDismissalReason reason);
// Log the |reason| a user dismissed the save password bubble. If // Log the |reason| a user dismissed the save password bubble. If
// |user_state| is set, the |reason| is also logged to a separate // |user_state| is set, the |reason| is also logged to a separate
// user-state-specific histogram. |user_state| must be non-null iff the feature // user-state-specific histogram.
// kEnablePasswordsAccountStorage is enabled.
void LogSaveUIDismissalReason( void LogSaveUIDismissalReason(
UIDismissalReason reason, UIDismissalReason reason,
base::Optional<PasswordAccountStorageUserState> user_state); base::Optional<PasswordAccountStorageUserState> user_state);
......
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