| 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); | |
| 114 state_ = password_manager::ui::MANAGE_STATE; | 113 state_ = password_manager::ui::MANAGE_STATE; |
| 115 } | |
| 116 } else { | 114 } else { |
| 117 new_password_forms_.push_back(new autofill::PasswordForm(changed_form)); | 115 new_password_forms_.push_back(new autofill::PasswordForm(changed_form)); |
| 118 password_form_map_[changed_form.username_value] = | 116 password_form_map_[changed_form.username_value] = |
| 119 new_password_forms_.back(); | 117 new_password_forms_.back(); |
| 120 if (changed_form.blacklisted_by_user) | 118 if (changed_form.blacklisted_by_user) |
| 121 state_ = password_manager::ui::BLACKLIST_STATE; | 119 state_ = password_manager::ui::BLACKLIST_STATE; |
| 122 } | 120 } |
| 123 } | 121 } |
| 124 if (current_state != state_) | 122 if (current_state != state_) |
| 125 UpdateBubbleAndIconVisibility(); | 123 UpdateBubbleAndIconVisibility(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return; | 208 return; |
| 211 CommandUpdater* updater = browser->command_controller()->command_updater(); | 209 CommandUpdater* updater = browser->command_controller()->command_updater(); |
| 212 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 210 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
| 213 #endif | 211 #endif |
| 214 } | 212 } |
| 215 | 213 |
| 216 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 214 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
| 217 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || | 215 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || |
| 218 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; | 216 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; |
| 219 } | 217 } |
| OLD | NEW |