diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 21:35:03 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 21:35:03 +0000 |
commit | 0ebf38756f3a68b30fe0d8e9336dbfafda52b5d5 (patch) | |
tree | a9ce0236b330fab3f39124c52fa0c1f184eb3965 /chrome/renderer/render_view.cc | |
parent | 5e91242859811aef980a929253e6c33eb2cfec6e (diff) | |
download | chromium_src-0ebf38756f3a68b30fe0d8e9336dbfafda52b5d5.zip chromium_src-0ebf38756f3a68b30fe0d8e9336dbfafda52b5d5.tar.gz chromium_src-0ebf38756f3a68b30fe0d8e9336dbfafda52b5d5.tar.bz2 |
Landing this again as I cannot reproduce the perf regression locally.
Will investigate on the bot.
TBR=nsylvain
Review URL: http://codereview.chromium.org/9700
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 7cebc16..cbae9d0 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -142,7 +142,7 @@ class RenderViewExtraRequestData : public WebRequest::ExtraData { /////////////////////////////////////////////////////////////////////////////// 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 @@ RenderView::RenderView() 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 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { 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::OnUnloadListenerChanged(WebView* webview, WebFrame* webframe) { } } +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 @@ WebView* RenderView::CreateWebView(WebView* webview, bool user_gesture) { 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(); } |