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, |