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

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

Issue 9235072: Adding Mouse Support for new GTK Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 months 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 573d8f2718b8d543c67dec3f7f1c6e6d328a6646..42ba32d24ad4cbe4785302af8f268b6a5cd0dbdc 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -75,6 +75,14 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
OnFieldTypePredictionsAvailable)
IPC_MESSAGE_HANDLER(AutofillMsg_SelectAutofillSuggestionAtIndex,
OnSelectAutofillSuggestionAtIndex)
+ IPC_MESSAGE_HANDLER(AutofillMsg_SetAutofillActionFill,
+ OnSetAutofillActionFill)
+ IPC_MESSAGE_HANDLER(AutofillMsg_SetAutofillActionPreview,
+ OnSetAutofillActionPreview)
+ IPC_MESSAGE_HANDLER(AutofillMsg_ClearForm,
+ OnClearForm)
+ IPC_MESSAGE_HANDLER(AutofillMsg_SetNodeText,
+ OnSetNodeText)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -366,6 +374,29 @@ void AutofillAgent::OnSelectAutofillSuggestionAtIndex(int listIndex) {
// render_view()->webview()->selectAutofillSuggestionAtIndex(listIndex);
}
+void AutofillAgent::OnSetAutofillActionFill() {
+ autofill_action_ = AUTOFILL_FILL;
+}
+
+void AutofillAgent::OnSetAutofillActionPreview() {
+ didClearAutofillSelection(autofill_query_element_);
+
+ autofill_action_ = AUTOFILL_PREVIEW;
+}
+
+void AutofillAgent::OnClearForm() {
+ // TODO add a check that we are clearing the correct element
+ form_cache_.ClearFormWithElement(autofill_query_element_);
+}
+
+void AutofillAgent::OnSetNodeText(string16 value) {
+ // TODO add a check that we are setting the correct element
+ string16 substring = value;
+ substring = substring.substr(0, autofill_query_element_.maxLength());
+
+ autofill_query_element_.setValue(value, true);
+}
+
void AutofillAgent::ShowSuggestions(const WebInputElement& element,
bool autofill_on_empty_values,
bool requires_caret_at_end,
« chrome/renderer/autofill/autofill_agent.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