| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/password_manager/password_store_factory.h" | 10 #include "chrome/browser/password_manager/password_store_factory.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 for (password_manager::PasswordStoreChangeList::const_iterator it = | 102 for (password_manager::PasswordStoreChangeList::const_iterator it = |
| 103 changes.begin(); | 103 changes.begin(); |
| 104 it != changes.end(); | 104 it != changes.end(); |
| 105 it++) { | 105 it++) { |
| 106 const autofill::PasswordForm& changed_form = it->form(); | 106 const autofill::PasswordForm& changed_form = it->form(); |
| 107 if (changed_form.origin != origin_) | 107 if (changed_form.origin != origin_) |
| 108 continue; | 108 continue; |
| 109 | 109 |
| 110 if (it->type() == password_manager::PasswordStoreChange::REMOVE) { | 110 if (it->type() == password_manager::PasswordStoreChange::REMOVE) { |
| 111 password_form_map_.erase(changed_form.username_value); | 111 password_form_map_.erase(changed_form.username_value); |
| 112 if (changed_form.blacklisted_by_user) | 112 if (changed_form.blacklisted_by_user) { |
| 113 DCHECK(state_ == password_manager::ui::BLACKLIST_STATE); |
| 113 state_ = password_manager::ui::MANAGE_STATE; | 114 state_ = password_manager::ui::MANAGE_STATE; |
| 115 } |
| 114 } else { | 116 } else { |
| 115 new_password_forms_.push_back(new autofill::PasswordForm(changed_form)); | 117 new_password_forms_.push_back(new autofill::PasswordForm(changed_form)); |
| 116 password_form_map_[changed_form.username_value] = | 118 password_form_map_[changed_form.username_value] = |
| 117 new_password_forms_.back(); | 119 new_password_forms_.back(); |
| 118 if (changed_form.blacklisted_by_user) | 120 if (changed_form.blacklisted_by_user) |
| 119 state_ = password_manager::ui::BLACKLIST_STATE; | 121 state_ = password_manager::ui::BLACKLIST_STATE; |
| 120 } | 122 } |
| 121 } | 123 } |
| 122 if (current_state != state_) | 124 if (current_state != state_) |
| 123 UpdateBubbleAndIconVisibility(); | 125 UpdateBubbleAndIconVisibility(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return; | 210 return; |
| 209 CommandUpdater* updater = browser->command_controller()->command_updater(); | 211 CommandUpdater* updater = browser->command_controller()->command_updater(); |
| 210 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 212 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
| 211 #endif | 213 #endif |
| 212 } | 214 } |
| 213 | 215 |
| 214 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 216 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
| 215 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || | 217 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || |
| 216 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; | 218 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; |
| 217 } | 219 } |
| OLD | NEW |