Index: chrome/renderer/autofill/autofill_agent.cc |
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc |
index 759886980fac2dd5df10c5440e2a570839d725a6..3c4d73dc753d409716d40a492a4194a61f42a5af 100644 |
--- a/chrome/renderer/autofill/autofill_agent.cc |
+++ b/chrome/renderer/autofill/autofill_agent.cc |
@@ -204,14 +204,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, |
@@ -247,7 +247,7 @@ bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
} |
bool AutofillAgent::InputElementLostFocus() { |
- Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
+ HideHostPopups(); |
return false; |
} |
@@ -489,16 +489,16 @@ void AutofillAgent::CombineDataListEntriesAndShow( |
i.insert(i.end(), icons.begin(), icons.end()); |
ids.insert(ids.end(), item_ids.begin(), item_ids.end()); |
- WebKit::WebView* web_view = render_view()->GetWebView(); |
- if (!web_view) |
- return; |
- |
if (v.empty()) { |
// No suggestions, any popup currently showing is obsolete. |
- web_view->hidePopups(); |
+ HidePopups(); |
return; |
} |
+ WebKit::WebView* web_view = render_view()->GetWebView(); |
+ if (!web_view) |
+ return; |
+ |
// Send to WebKit for display. |
web_view->applyAutofillSuggestions(element, v, l, i, ids); |
@@ -729,6 +729,12 @@ void AutofillAgent::HidePopups() { |
WebKit::WebView* web_view = render_view()->GetWebView(); |
if (web_view) |
web_view->hidePopups(); |
+ |
+ HideHostPopups(); |
+} |
+ |
+void AutofillAgent::HideHostPopups() { |
+ Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
} |
} // namespace autofill |