Index: chrome/renderer/autofill/autofill_agent.cc |
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc |
index 0fedba59f3a496103525fe1aed9303d273c918db..010dbab282444fd58f8971e42d135bf3bd206531 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, |
@@ -249,7 +249,7 @@ bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
} |
bool AutofillAgent::InputElementLostFocus() { |
- Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
+ HideHostPopups(); |
return false; |
} |
@@ -491,16 +491,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; |
- |
Dan Beam
2012/10/30 00:44:15
tell me if there's any problem with this ever-so-s
|
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); |
@@ -731,6 +731,8 @@ void AutofillAgent::HidePopups() { |
WebKit::WebView* web_view = render_view()->GetWebView(); |
if (web_view) |
web_view->hidePopups(); |
+ |
+ Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); |
} |
} // namespace autofill |