Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5228)

Unified Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 8490017: Setting up external delegate calls to allow a future delegate to handle autofill (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removing unneeded IPC calls Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/autofill/autofill_agent.cc
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index f293635e2f12f19b1138d00a1f81ae2c817d37e4..3259cc3e653d4a16eab37a6a187c719c584b98af 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -19,6 +19,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
@@ -124,6 +125,8 @@ bool AutofillAgent::InputElementClicked(const WebInputElement& element,
}
bool AutofillAgent::InputElementLostFocus() {
+ Send(new AutofillHostMsg_HideAutofillPopup(routing_id()));
+
return false;
}
@@ -315,9 +318,9 @@ void AutofillAgent::OnSuggestionsReturned(int query_id,
separator_index = values.size();
}
- // Send to WebKit for display.
if (!v.empty() && !autofill_query_element_.isNull() &&
autofill_query_element_.isFocusable()) {
+ // Send to WebKit for display.
web_view->applyAutofillSuggestions(
autofill_query_element_, v, l, i, ids, separator_index);
}
@@ -414,8 +417,13 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
WebFormControlElementToFormField(element, EXTRACT_VALUE, &field);
}
+ // TODO(csharp): This value is currently returned as a page-relative value,
+ // which won't also convert easily to the correct viewport coordinates, so
+ // this should be changed to be a viewport-relative value.
+ gfx::Rect bounding_box(autofill_query_element_.absoluteBoundingBoxRect());
+
Send(new AutofillHostMsg_QueryFormFieldAutofill(
- routing_id(), autofill_query_id_, form, field));
+ routing_id(), autofill_query_id_, form, field, bounding_box));
}
void AutofillAgent::FillAutofillFormData(const WebNode& node,
« chrome/common/autofill_messages.h ('K') | « chrome/renderer/autofill/autofill_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698