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

Unified Diff: components/autofill/core/browser/autofill_external_delegate.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/autofill_external_delegate.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc
index 7bbdeec287bd1a3ac4b0a06fa94f8cb1ea5895f1..ef2255fef168da1fa94cc95ba75fdef0508ebca8 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -35,10 +35,12 @@ AutofillExternalDelegate::~AutofillExternalDelegate() {}
void AutofillExternalDelegate::OnQuery(int query_id,
const FormData& form,
const FormFieldData& field,
+ const PasswordForm& passwordform,
vabr (Chromium) 2014/01/13 14:46:29 Why do you actually need the PasswordForm in OnQue
riadh.chtara 2014/01/13 20:56:08 I m not really but this the logic I followed: When
vabr (Chromium) 2014/01/14 14:11:02 We should not just blindly copy the lifetime of an
const gfx::RectF& element_bounds,
bool display_warning_if_disabled) {
autofill_query_form_ = form;
autofill_query_field_ = field;
+ autofill_query_password_form_ = passwordform;
display_warning_if_disabled_ = display_warning_if_disabled;
autofill_query_id_ = query_id;
element_bounds_ = element_bounds;
@@ -117,8 +119,10 @@ void AutofillExternalDelegate::OnShowPasswordSuggestions(
const std::vector<base::string16>& suggestions,
const std::vector<base::string16>& realms,
const FormFieldData& field,
+ const PasswordForm& passwordform,
const gfx::RectF& element_bounds) {
autofill_query_field_ = field;
+ autofill_query_password_form_ = passwordform;
element_bounds_ = element_bounds;
if (suggestions.empty()) {
@@ -200,6 +204,11 @@ void AutofillExternalDelegate::RemoveSuggestion(const base::string16& value,
int identifier) {
if (identifier > 0) {
autofill_manager_->RemoveAutofillProfileOrCreditCard(identifier);
+ } else if (identifier == WebAutofillClient::MenuItemIDPasswordEntry) {
+ bool success = password_autofill_manager_.RemovePasswordSuggestion(
+ autofill_query_field_,
+ autofill_query_password_form_);
+ DCHECK(success);
} else {
autofill_manager_->RemoveAutocompleteEntry(autofill_query_field_.name,
value);

Powered by Google App Engine
This is Rietveld 408576698