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

Unified Diff: components/autofill/core/browser/password_autofill_manager.cc

Issue 133893004: Allow deleting autofill password suggestions on Shift+Delete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow deleting autofill password suggestions on Shift+Delete Created 6 years, 11 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
Index: components/autofill/core/browser/password_autofill_manager.cc
diff --git a/components/autofill/core/browser/password_autofill_manager.cc b/components/autofill/core/browser/password_autofill_manager.cc
index 730c10e49d5d1b2282440dcf3dd406593cd3977b..b96aab5e2d1c9022fa5323ff144dd42571f7e57f 100644
--- a/components/autofill/core/browser/password_autofill_manager.cc
+++ b/components/autofill/core/browser/password_autofill_manager.cc
@@ -5,6 +5,7 @@
#include "base/logging.h"
#include "components/autofill/core/browser/autofill_driver.h"
#include "components/autofill/core/browser/password_autofill_manager.h"
+#include "components/autofill/core/common/autofill_messages.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace autofill {
@@ -41,6 +42,22 @@ void PasswordAutofillManager::AddPasswordFormMapping(
login_to_password_info_[username_element] = password;
}
+bool PasswordAutofillManager::RemovePasswordSuggestion(
+ const FormFieldData& field,
+ const PasswordForm& passwordform) {
+ LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field);
+ if (iter == login_to_password_info_.end())
+ return false;
+ login_to_password_info_.erase(iter);
+
+ scoped_ptr<PasswordForm> password_form = CreatePasswordForm(form);
+
+ Send(new AutofillHostMsg_RemovePasswordSuggestion(
+ routing_id(),
+ password_form.get()));
vabr (Chromium) 2014/01/13 14:46:29 *password_form (dereference instead of getting a p
riadh.chtara 2014/01/13 20:34:10 Done.
vabr (Chromium) 2014/01/14 14:11:02 Does not look done -- there is still .get() instea
+ return true;
+}
+
void PasswordAutofillManager::Reset() {
login_to_password_info_.clear();
}

Powered by Google App Engine
This is Rietveld 408576698