| Index: chrome/browser/ui/passwords/password_manager_presenter.cc
|
| diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc
|
| index 52d2eb80ef518a453732bff1da87088fde0da24f..08e27a4a041d2b32f9c9b23c4c6a21ecb94dadca 100644
|
| --- a/chrome/browser/ui/passwords/password_manager_presenter.cc
|
| +++ b/chrome/browser/ui/passwords/password_manager_presenter.cc
|
| @@ -83,6 +83,28 @@ void PasswordManagerPresenter::UpdatePasswordLists() {
|
| exception_populater_.Populate();
|
| }
|
|
|
| +void PasswordManagerPresenter::UpdatePassword(
|
| + size_t index,
|
| + const base::string16& password_value) {
|
| +#if !defined(OS_ANDROID) // This is never called on Android.
|
| + if (index >= password_list_.size() || password_value.empty()) {
|
| + // |index| out of bounds might come from a compromised renderer, don't let
|
| + // it crash the browser. http://crbug.com/362054
|
| + // Similarly, empty |password_value| also might come from a compromised
|
| + // renderer, which is forbidden to be saved to the password store. So use
|
| + // the same logic.
|
| + NOTREACHED();
|
| + return;
|
| + }
|
| + PasswordStore* store = GetPasswordStore();
|
| + if (!store)
|
| + return;
|
| + autofill::PasswordForm form(*password_list_[index]);
|
| + form.password_value = password_value;
|
| + store->UpdateLogin(form);
|
| +#endif
|
| +}
|
| +
|
| void PasswordManagerPresenter::RemoveSavedPassword(size_t index) {
|
| if (index >= password_list_.size()) {
|
| // |index| out of bounds might come from a compromised renderer, don't let
|
|
|