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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model.cc

Issue 2542093002: [Password Generation] Fixes sending votes about the usage of the password generation popup (Closed)
Patch Set: Changes addressed to reviewer comments Created 4 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/ui/passwords/manage_passwords_bubble_model.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
index 67eee851ec69cce2fd254999c2e19c30b2c11f66..44bf48c22631c54de6f0a04198a29d07f92007f0 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
@@ -80,8 +80,8 @@ class ManagePasswordsBubbleModel::InteractionKeeper {
~InteractionKeeper() = default;
- // Records UMA events and updates the interaction statistics when the bubble
- // is closed.
+ // Records UMA events, updates the interaction statistics and sends
+ // notifications to the delegate when the bubble is closed.
void ReportInteractions(const ManagePasswordsBubbleModel* model);
void set_dismissal_reason(
@@ -193,15 +193,22 @@ void ManagePasswordsBubbleModel::InteractionKeeper::ReportInteractions(
if (model->state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE ||
model->state() == password_manager::ui::PENDING_PASSWORD_STATE) {
+ // Send a notification if there was no interaction with the bubble.
+ bool no_interaction =
+ model->state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE
+ ? update_password_submission_event_ ==
+ metrics_util::NO_UPDATE_SUBMISSION
+ : dismissal_reason_ == metrics_util::NO_DIRECT_INTERACTION;
+ if (no_interaction && model->delegate_) {
+ model->delegate_->OnNoInteraction();
+ }
+
+ // Send UMA.
if (update_password_submission_event_ ==
metrics_util::NO_UPDATE_SUBMISSION) {
update_password_submission_event_ =
model->GetUpdateDismissalReason(NO_INTERACTION);
- if (model->delegate_ &&
- model->state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE)
- model->delegate_->OnNoInteractionOnUpdate();
}
-
if (update_password_submission_event_ != metrics_util::NO_UPDATE_SUBMISSION)
LogUpdatePasswordSubmissionEvent(update_password_submission_event_);
}

Powered by Google App Engine
This is Rietveld 408576698