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

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

Issue 259153004: Password bubble: Give users the option of unblacklisting a site. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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: 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 4d863737b4143c335e4cd8324af407afc4f22faf..94358b982a605dfc993db22b5b6ae6232ce2927c 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
@@ -29,6 +29,8 @@ ManagePasswordsBubbleModel::ManagePasswordsBubbleModel(
manage_passwords_bubble_state_ = PASSWORD_TO_BE_SAVED;
pending_credentials_ =
manage_passwords_bubble_ui_controller->PendingCredentials();
+ } else if (manage_passwords_bubble_ui_controller->autofill_blocked()) {
+ manage_passwords_bubble_state_ = NEVER_SAVE_PASSWORDS;
} else {
manage_passwords_bubble_state_ = MANAGE_PASSWORDS;
}
@@ -45,19 +47,18 @@ ManagePasswordsBubbleModel::~ManagePasswordsBubbleModel() {}
void ManagePasswordsBubbleModel::OnBubbleShown(
ManagePasswordsBubble::DisplayReason reason) {
- DCHECK(WaitingToSavePassword() ||
- reason == ManagePasswordsBubble::USER_ACTION);
if (reason == ManagePasswordsBubble::USER_ACTION) {
if (WaitingToSavePassword()) {
display_disposition_ =
password_manager::metrics_util::MANUAL_WITH_PASSWORD_PENDING;
+ } else if (NeverSavingPasswords()) {
+ display_disposition_ = password_manager::metrics_util::MANUAL_BLACKLISTED;
} else {
- // TODO(mkwst): Deal with "Never save passwords" once we've decided how
- // that flow should work.
display_disposition_ =
password_manager::metrics_util::MANUAL_MANAGE_PASSWORDS;
}
} else {
+ DCHECK(WaitingToSavePassword());
display_disposition_ =
password_manager::metrics_util::AUTOMATIC_WITH_PASSWORD_PENDING;
}
@@ -94,6 +95,14 @@ void ManagePasswordsBubbleModel::OnNeverForThisSiteClicked() {
manage_passwords_bubble_state_ = NEVER_SAVE_PASSWORDS;
}
+void ManagePasswordsBubbleModel::OnUnblacklistClicked() {
+ dismissal_reason_ = password_manager::metrics_util::CLICKED_UNBLACKLIST;
+ ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller =
+ ManagePasswordsBubbleUIController::FromWebContents(web_contents_);
+ manage_passwords_bubble_ui_controller->UnblacklistSite();
+ manage_passwords_bubble_state_ = MANAGE_PASSWORDS;
+}
+
void ManagePasswordsBubbleModel::OnSaveClicked() {
dismissal_reason_ = password_manager::metrics_util::CLICKED_SAVE;
ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller =

Powered by Google App Engine
This is Rietveld 408576698