| Index: chrome/renderer/autofill/autofill_agent.cc
|
| diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
|
| index 4440f0dc81387f38cda75304694b554eb6831941..9b55fcc8aab6b27f37f315cdeeac960b69a72246 100644
|
| --- a/chrome/renderer/autofill/autofill_agent.cc
|
| +++ b/chrome/renderer/autofill/autofill_agent.cc
|
| @@ -141,10 +141,6 @@ void AutofillAgent::didAcceptAutofillSuggestion(const WebNode& node,
|
| string16 substring = value;
|
| substring = substring.substr(0, element.maxLength());
|
| element.setValue(substring, true);
|
| -
|
| - WebFrame* webframe = node.document().frame();
|
| - if (webframe)
|
| - webframe->notifiyPasswordListenerOfAutocomplete(element);
|
| } else {
|
| // Fill the values for the whole form.
|
| FillAutofillFormData(node, unique_id, AUTOFILL_FILL);
|
| @@ -183,6 +179,7 @@ void AutofillAgent::removeAutocompleteSuggestion(const WebString& name,
|
|
|
| void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) {
|
| password_autofill_manager_->TextFieldDidEndEditing(element);
|
| + has_shown_autofill_popup_for_current_edit_ = false;
|
| }
|
|
|
| void AutofillAgent::textFieldDidChange(const WebInputElement& element) {
|
| @@ -201,6 +198,11 @@ void AutofillAgent::TextFieldDidChangeImpl(const WebInputElement& element) {
|
| return;
|
|
|
| ShowSuggestions(element, false, true, false);
|
| +
|
| + webkit_glue::FormData form;
|
| + webkit_glue::FormField field;
|
| + if (FindFormAndFieldForNode(element, &form, &field))
|
| + Send(new AutofillHostMsg_TextFieldDidChange(routing_id(), form, field));
|
| }
|
|
|
| void AutofillAgent::textFieldDidReceiveKeyDown(const WebInputElement& element,
|
| @@ -234,6 +236,7 @@ void AutofillAgent::OnSuggestionsReturned(int query_id,
|
| std::vector<int> ids(unique_ids);
|
| int separator_index = -1;
|
|
|
| + DCHECK_GT(ids.size(), 0U);
|
| if (!autofill_query_element_.isNull() &&
|
| !autofill_query_element_.autoComplete()) {
|
| // If autofill is disabled and we had suggestions, show a warning instead.
|
| @@ -294,7 +297,10 @@ void AutofillAgent::OnSuggestionsReturned(int query_id,
|
| autofill_query_element_, v, l, i, ids, separator_index);
|
| }
|
|
|
| - Send(new AutofillHostMsg_DidShowAutofillSuggestions(routing_id()));
|
| + Send(new AutofillHostMsg_DidShowAutofillSuggestions(
|
| + routing_id(),
|
| + has_autofill_item && !has_shown_autofill_popup_for_current_edit_));
|
| + has_shown_autofill_popup_for_current_edit_ |= has_autofill_item;
|
| }
|
|
|
| void AutofillAgent::OnFormDataFilled(int query_id,
|
| @@ -305,15 +311,16 @@ void AutofillAgent::OnFormDataFilled(int query_id,
|
| switch (autofill_action_) {
|
| case AUTOFILL_FILL:
|
| form_manager_.FillForm(form, autofill_query_element_);
|
| + Send(new AutofillHostMsg_DidFillAutofillFormData(routing_id()));
|
| break;
|
| case AUTOFILL_PREVIEW:
|
| form_manager_.PreviewForm(form, autofill_query_element_);
|
| + Send(new AutofillHostMsg_DidPreviewAutofillFormData(routing_id()));
|
| break;
|
| default:
|
| NOTREACHED();
|
| }
|
| autofill_action_ = AUTOFILL_NONE;
|
| - Send(new AutofillHostMsg_DidFillAutofillFormData(routing_id()));
|
| }
|
|
|
| void AutofillAgent::OnFieldTypePredictionsAvailable(
|
|
|