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

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

Issue 276583003: Password bubble: Deal correctly with blacklist state changes. (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_ui_controller.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index 82258405c55862623f44ac8efaa8af5bdba78268..cdf9b42c6115f4159f42fb1307896e3510c61865 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -90,6 +90,7 @@ void ManagePasswordsUIController::WebContentsDestroyed() {
void ManagePasswordsUIController::OnLoginsChanged(
const password_manager::PasswordStoreChangeList& changes) {
+ password_manager::ui::State current_state = state_;
for (password_manager::PasswordStoreChangeList::const_iterator it =
changes.begin();
it != changes.end();
@@ -100,12 +101,20 @@ void ManagePasswordsUIController::OnLoginsChanged(
if (it->type() == password_manager::PasswordStoreChange::REMOVE) {
password_form_map_.erase(changed_form.username_value);
+ if (changed_form.blacklisted_by_user) {
+ DCHECK(state_ == password_manager::ui::BLACKLIST_STATE);
+ state_ = password_manager::ui::MANAGE_STATE;
+ }
} else {
- autofill::PasswordForm* new_form =
- new autofill::PasswordForm(changed_form);
- password_form_map_[changed_form.username_value] = new_form;
+ new_password_forms_.push_back(new autofill::PasswordForm(changed_form));
+ password_form_map_[changed_form.username_value] =
+ new_password_forms_.back();
+ if (changed_form.blacklisted_by_user)
+ state_ = password_manager::ui::BLACKLIST_STATE;
}
}
+ if (current_state != state_)
+ UpdateBubbleAndIconVisibility();
}
void ManagePasswordsUIController::

Powered by Google App Engine
This is Rietveld 408576698