Chromium Code Reviews| Index: chrome/renderer/autofill/autofill_agent.cc |
| diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc |
| index 878634e5db895d953dce4293c57034b1a72f6bbd..94485e0abf5da9b0edf2b8b3c102743dc3d6f155 100644 |
| --- a/chrome/renderer/autofill/autofill_agent.cc |
| +++ b/chrome/renderer/autofill/autofill_agent.cc |
| @@ -205,14 +205,14 @@ void AutofillAgent::ZoomLevelChanged() { |
| // Any time the zoom level changes, the page's content moves, so any Autofill |
| // popups should be hidden. This is only needed for the new Autofill UI |
| // because WebKit already knows to hide the old UI when this occurs. |
| - Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
| + HideHostPopups(); |
| } |
| void AutofillAgent::DidChangeScrollOffset(WebKit::WebFrame*) { |
| // Any time the scroll offset changes, the page's content moves, so Autofill |
| // popups should be hidden. This is only needed for the new Autofill UI |
| // because WebKit already knows to hide the old UI when this occurs. |
| - Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
| + HideHostPopups(); |
| } |
| void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame, |
| @@ -225,6 +225,7 @@ void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame, |
| // Any popup currently showing is obsolete. |
| HidePopups(); |
| + HideHostPopups(); |
| FormData form_data; |
| if (WebFormElementToFormData(form, |
| @@ -249,7 +250,7 @@ bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
| } |
| bool AutofillAgent::InputElementLostFocus() { |
| - Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
| + HideHostPopups(); |
| return false; |
| } |
| @@ -498,6 +499,7 @@ void AutofillAgent::CombineDataListEntriesAndShow( |
| if (v.empty()) { |
| // No suggestions, any popup currently showing is obsolete. |
| web_view->hidePopups(); |
| + HideHostPopups(); |
| return; |
| } |
| @@ -630,6 +632,7 @@ void AutofillAgent::ShowSuggestions(const WebInputElement& element, |
| element.selectionEnd() != static_cast<int>(value.length())))) { |
| // Any popup currently showing is obsolete. |
| HidePopups(); |
| + HideHostPopups(); |
| return; |
| } |
| @@ -735,4 +738,8 @@ void AutofillAgent::HidePopups() { |
| web_view->hidePopups(); |
| } |
|
Ilya Sherman
2012/10/29 23:14:19
nit: I think this should also call HideHostPopups(
Dan Beam
2012/10/30 00:44:15
Done.
|
| +void AutofillAgent::HideHostPopups() { |
| + Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
| +} |
| + |
| } // namespace autofill |