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

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

Issue 276683003: 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
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbee54548916a80a6daa1a51672126547247c7b5..3b192d90df4b4bab64edcc73a5cf9453de80c024 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -91,6 +91,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();
@@ -101,12 +102,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;
+ if (changed_form.blacklisted_by_user)
+ state_ = password_manager::ui::BLACKLIST_STATE;
}
}
+ if (current_state != state_)
+ UpdateBubbleAndIconVisibility();
}
void ManagePasswordsUIController::
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698