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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 223133003: Allow deleting autofill password suggestions on Shift+Delete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed problems in previous patch Created 6 years, 8 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/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index 91fc888f970f1f9595201e92cb0a40d0b24a11a8..420484da6feb20106cbf49c8dfcc5906333c9fab 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -442,6 +442,7 @@ bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PasswordAutofillAgent, message)
IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordForm, OnFillPasswordForm)
+ IPC_MESSAGE_HANDLER(AutofillMsg_RemoveSavedPassword, OnRemoveSavedPassword)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -638,6 +639,14 @@ void PasswordAutofillAgent::OnFillPasswordForm(
form_data));
}
}
+void PasswordAutofillAgent::OnRemoveSavedPassword() {
+ scoped_ptr<PasswordForm> password_form = CreatePasswordForm(current_form_);
+ DCHECK(password_form);
+ login_to_password_info_.clear();
+
+ Send(new AutofillHostMsg_RemoveSavedPasswordAndUpdateManagers(
+ routing_id(), *password_form));
+}
////////////////////////////////////////////////////////////////////////////////
// PasswordAutofillAgent, private:
@@ -695,6 +704,8 @@ bool PasswordAutofillAgent::ShowSuggestionPopup(
FindFormAndFieldForFormControlElement(
user_input, &form, &field, REQUIRE_NONE);
+ current_form_ = user_input.form();
+
blink::WebInputElement selected_element = user_input;
gfx::Rect bounding_box(selected_element.boundsInViewportSpace());
« no previous file with comments | « components/autofill/content/renderer/password_autofill_agent.h ('k') | components/autofill/core/browser/autofill_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698