diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 06:00:36 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 06:00:36 +0000 |
commit | 842936a15c38e85162eda5bd992f3d1758a1fe7f (patch) | |
tree | 9b13ced3c5ec2875cdb992b1b1fdb3e531bf78b9 /chrome/renderer | |
parent | 1f50182afc7635811a55a47bcd8218275e7acfae (diff) | |
download | chromium_src-842936a15c38e85162eda5bd992f3d1758a1fe7f.zip chromium_src-842936a15c38e85162eda5bd992f3d1758a1fe7f.tar.gz chromium_src-842936a15c38e85162eda5bd992f3d1758a1fe7f.tar.bz2 |
Make the acknowledgement message for querying form autofill data always
be sent.
I plan to make use of this to have the RenderView hold onto a WebNode
instead of a node_id in a future CL.
R=jcampan
BUG=24595
TEST=none
Review URL: http://codereview.chromium.org/270082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 19 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 7 |
2 files changed, 14 insertions, 12 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 816b19a..83e98a0 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -224,6 +224,7 @@ RenderView::RenderView(RenderThreadBase* render_thread, has_unload_listener_(false), decrement_shared_popup_at_destruction_(false), form_field_autofill_request_id_(0), + form_field_autofill_node_id_(0), popup_notification_visible_(false), spelling_panel_visible_(false), delay_seconds_for_form_state_sync_(kDefaultDelaySecondsForFormStateSync), @@ -465,8 +466,8 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { OnMessageFromExternalHost) IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, OnDisassociateFromPopupCount) - IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions, - OnReceivedAutofillSuggestions) + IPC_MESSAGE_HANDLER(ViewMsg_QueryFormFieldAutofill_ACK, + OnQueryFormFieldAutofillAck) IPC_MESSAGE_HANDLER(ViewMsg_PopupNotificationVisibilityChanged, OnPopupNotificationVisibilityChanged) IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) @@ -1237,10 +1238,9 @@ void RenderView::QueryFormFieldAutofill(const std::wstring& field_name, 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_)); + form_field_autofill_node_id_ = node_id; + Send(new ViewHostMsg_QueryFormFieldAutofill( + routing_id_, form_field_autofill_request_id_, field_name, text)); } void RenderView::RemoveStoredAutofillEntry(const std::wstring& name, @@ -1248,16 +1248,15 @@ void RenderView::RemoveStoredAutofillEntry(const std::wstring& name, Send(new ViewHostMsg_RemoveAutofillEntry(routing_id_, name, value)); } -void RenderView::OnReceivedAutofillSuggestions( - int64 node_id, +void RenderView::OnQueryFormFieldAutofillAck( 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); + webview()->AutofillSuggestionsForNode( + form_field_autofill_node_id_, suggestions, default_suggestion_index); } void RenderView::OnPopupNotificationVisibilityChanged(bool visible) { diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 8a5b2cc..43d1643 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -635,8 +635,7 @@ class RenderView : public RenderWidget, void OnThemeChanged(); // Notification that we have received autofill suggestion. - void OnReceivedAutofillSuggestions( - int64 node_id, + void OnQueryFormFieldAutofillAck( int request_id, const std::vector<std::wstring>& suggestions, int default_suggestions_index); @@ -874,6 +873,10 @@ class RenderView : public RenderWidget, // out of date responses. int form_field_autofill_request_id_; + // The id of the node corresponding to the last request sent for form field + // autofill. + int64 form_field_autofill_node_id_; + // We need to prevent windows from closing themselves with a window.close() // call while a blocked popup notification is being displayed. We cannot // synchronously query the Browser process. We cannot wait for the Browser |