Chromium Code Reviews| 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..425fb1d6f06d8abf63c16eb2c5af5149331e2dcd 100644 |
| --- a/components/autofill/core/browser/autofill_external_delegate.cc |
| +++ b/components/autofill/core/browser/autofill_external_delegate.cc |
| @@ -10,6 +10,8 @@ |
| #include "components/autofill/core/browser/autofill_manager.h" |
| #include "grit/component_strings.h" |
| #include "third_party/WebKit/public/web/WebAutofillClient.h" |
| +#include "third_party/WebKit/public/web/WebFormControlElement.h" |
| +#include "third_party/WebKit/public/web/WebFormElement.h" |
| #include "ui/base/l10n/l10n_util.h" |
| using blink::WebAutofillClient; |
| @@ -35,10 +37,12 @@ AutofillExternalDelegate::~AutofillExternalDelegate() {} |
| void AutofillExternalDelegate::OnQuery(int query_id, |
| const FormData& form, |
| const FormFieldData& field, |
| + const blink::WebFormElement& element, |
| const gfx::RectF& element_bounds, |
| bool display_warning_if_disabled) { |
| autofill_query_form_ = form; |
| autofill_query_field_ = field; |
| + web_form_element_ = element; |
| display_warning_if_disabled_ = display_warning_if_disabled; |
| autofill_query_id_ = query_id; |
| element_bounds_ = element_bounds; |
| @@ -111,14 +115,16 @@ void AutofillExternalDelegate::OnSuggestionsReturned( |
| ids, |
| GetWeakPtr()); |
| } |
| -} |
| +}OnShowPasswordSuggestions |
|
vabr (Chromium)
2014/01/10 18:40:00
This looks misplaced. Please delete "OnShowPasswor
|
| void AutofillExternalDelegate::OnShowPasswordSuggestions( |
| const std::vector<base::string16>& suggestions, |
| const std::vector<base::string16>& realms, |
| const FormFieldData& field, |
| + const blink::WebFormElement& element, |
| const gfx::RectF& element_bounds) { |
| autofill_query_field_ = field; |
| + web_form_element_ = element; |
| element_bounds_ = element_bounds; |
| if (suggestions.empty()) { |
| @@ -200,6 +206,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_, |
| + web_form_element_); |
| + DCHECK(success); |
| } else { |
| autofill_manager_->RemoveAutocompleteEntry(autofill_query_field_.name, |
| value); |