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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 | 151 |
152 void ManagePasswordsUIController::OnAutomaticPasswordSave( | 152 void ManagePasswordsUIController::OnAutomaticPasswordSave( |
153 scoped_ptr<PasswordFormManager> form_manager) { | 153 scoped_ptr<PasswordFormManager> form_manager) { |
154 passwords_data_.OnAutomaticPasswordSave(form_manager.Pass()); | 154 passwords_data_.OnAutomaticPasswordSave(form_manager.Pass()); |
155 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); | 155 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); |
156 UpdateBubbleAndIconVisibility(); | 156 UpdateBubbleAndIconVisibility(); |
157 } | 157 } |
158 | 158 |
159 void ManagePasswordsUIController::OnPasswordAutofilled( | 159 void ManagePasswordsUIController::OnPasswordAutofilled( |
160 const PasswordFormMap& password_form_map) { | 160 const PasswordFormMap& password_form_map, |
| 161 const GURL& origin) { |
161 // If we fill a form while a dialog is open, then skip the state change; we | 162 // If we fill a form while a dialog is open, then skip the state change; we |
162 // have | 163 // have |
163 // the information we need, and the dialog will change its own state once the | 164 // the information we need, and the dialog will change its own state once the |
164 // interaction is complete. | 165 // interaction is complete. |
165 if (passwords_data_.state() != | 166 if (passwords_data_.state() != |
166 password_manager::ui::AUTO_SIGNIN_STATE && | 167 password_manager::ui::AUTO_SIGNIN_STATE && |
167 passwords_data_.state() != | 168 passwords_data_.state() != |
168 password_manager::ui::CREDENTIAL_REQUEST_STATE) { | 169 password_manager::ui::CREDENTIAL_REQUEST_STATE) { |
169 passwords_data_.OnPasswordAutofilled(password_form_map); | 170 passwords_data_.OnPasswordAutofilled(password_form_map, origin); |
170 UpdateBubbleAndIconVisibility(); | 171 UpdateBubbleAndIconVisibility(); |
171 } | 172 } |
172 } | 173 } |
173 | 174 |
174 void ManagePasswordsUIController::OnBlacklistBlockedAutofill( | 175 void ManagePasswordsUIController::OnBlacklistBlockedAutofill( |
175 const PasswordFormMap& password_form_map) { | 176 const PasswordFormMap& password_form_map) { |
176 passwords_data_.OnInactive(); | 177 passwords_data_.OnInactive(); |
177 UpdateBubbleAndIconVisibility(); | 178 UpdateBubbleAndIconVisibility(); |
178 } | 179 } |
179 | 180 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && | 411 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && |
411 GetCurrentForms().size() > 1 && !PasswordOverridden(); | 412 GetCurrentForms().size() > 1 && !PasswordOverridden(); |
412 } | 413 } |
413 | 414 |
414 void ManagePasswordsUIController::WebContentsDestroyed() { | 415 void ManagePasswordsUIController::WebContentsDestroyed() { |
415 password_manager::PasswordStore* password_store = | 416 password_manager::PasswordStore* password_store = |
416 GetPasswordStore(web_contents()); | 417 GetPasswordStore(web_contents()); |
417 if (password_store) | 418 if (password_store) |
418 password_store->RemoveObserver(this); | 419 password_store->RemoveObserver(this); |
419 } | 420 } |
OLD | NEW |