Index: chrome/renderer/render_view.cc |
=================================================================== |
--- chrome/renderer/render_view.cc (revision 4621) |
+++ chrome/renderer/render_view.cc (working copy) |
@@ -142,7 +142,7 @@ |
/////////////////////////////////////////////////////////////////////////////// |
RenderView::RenderView() |
- : RenderWidget(RenderThread::current()), |
+ : RenderWidget(RenderThread::current(), true), |
is_loading_(false), |
page_id_(-1), |
last_page_id_sent_to_browser_(-1), |
@@ -161,7 +161,8 @@ |
has_unload_listener_(false), |
decrement_shared_popup_at_destruction_(false), |
greasemonkey_enabled_(false), |
- waiting_for_create_window_ack_(false) { |
+ waiting_for_create_window_ack_(false), |
+ form_field_autofill_request_id_(0) { |
resource_dispatcher_ = new ResourceDispatcher(this); |
#ifdef CHROME_PERSONALIZATION |
personalization_ = Personalization::CreateRendererPersonalization(); |
@@ -384,6 +385,8 @@ |
OnMessageFromExternalHost) |
IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, |
OnDisassociateFromPopupCount) |
+ IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions, |
+ OnReceivedAutofillSuggestions) |
// Have the super handle all other messages. |
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
IPC_END_MESSAGE_MAP() |
@@ -1664,6 +1667,29 @@ |
} |
} |
+void RenderView::QueryFormFieldAutofill(const std::wstring& field_name, |
+ const std::wstring& text, |
+ int64 node_id) { |
+ static int message_id_counter = 0; |
+ form_field_autofill_request_id_ = message_id_counter++; |
+ Send(new ViewHostMsg_QueryFormFieldAutofill(routing_id_, |
+ field_name, text, |
+ node_id, |
+ form_field_autofill_request_id_)); |
+} |
+ |
+void RenderView::OnReceivedAutofillSuggestions( |
+ int64 node_id, |
+ int request_id, |
+ const std::vector<std::wstring> suggestions, |
+ int default_suggestion_index) { |
+ if (!webview() || request_id != form_field_autofill_request_id_) |
+ return; |
+ |
+ webview()->AutofillSuggestionsForNode(node_id, suggestions, |
+ default_suggestion_index); |
+} |
+ |
void RenderView::ShowModalHTMLDialog(const GURL& url, int width, int height, |
const std::string& json_arguments, |
std::string* json_retval) { |
@@ -1762,9 +1788,11 @@ |
return view->webview(); |
} |
-WebWidget* RenderView::CreatePopupWidget(WebView* webview) { |
+WebWidget* RenderView::CreatePopupWidget(WebView* webview, |
+ bool focus_on_show) { |
RenderWidget* widget = RenderWidget::Create(routing_id_, |
- RenderThread::current()); |
+ RenderThread::current(), |
+ focus_on_show); |
return widget->webwidget(); |
} |