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

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: ToT Created 6 years, 9 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 bd3795c41d2f16775a6cd9a71ff5780159b07c8d..43a1bdd5fa9802660c6d20874fac869ae9308333 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -115,8 +115,10 @@ void AutofillExternalDelegate::OnShowPasswordSuggestions(
const std::vector<base::string16>& suggestions,
const std::vector<base::string16>& realms,
const FormFieldData& field,
+ const PasswordForm& password_form,
const gfx::RectF& element_bounds) {
query_field_ = field;
+ query_password_form_ = password_form;
element_bounds_ = element_bounds;
if (suggestions.empty()) {
@@ -196,10 +198,17 @@ void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
void AutofillExternalDelegate::RemoveSuggestion(const base::string16& value,
int identifier) {
- if (identifier > 0)
+ if (identifier > 0) {
manager_->RemoveAutofillProfileOrCreditCard(identifier);
- else
- manager_->RemoveAutocompleteEntry(query_field_.name, value);
+ } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) {
+ query_password_form_.username_value = value;
+ bool success = password_manager_.RemovePasswordSuggestion(
+ query_field_, query_password_form_);
+ DCHECK(success);
+ } else {
+ manager_->RemoveAutocompleteEntry(query_field_.name,
+ value);
vabr (Chromium) 2014/04/01 16:56:08 wrong indent
rchtara 2014/04/03 08:44:50 Done.
+ }
}
void AutofillExternalDelegate::DidEndTextFieldEditing() {

Powered by Google App Engine
This is Rietveld 408576698