Index: chrome/renderer/autofill/autofill_agent.cc |
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc |
index 9130b105e71eaf0f2a001d4e6d92bdea6c459e2d..e2cdc93f28231b50ba6db1f7d789b42e6a712913 100644 |
--- a/chrome/renderer/autofill/autofill_agent.cc |
+++ b/chrome/renderer/autofill/autofill_agent.cc |
@@ -76,6 +76,16 @@ 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_ClearAutofillSelection, |
+ OnClearAutofillSelection) |
+ 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 +376,34 @@ void AutofillAgent::OnSelectAutofillSuggestionAtIndex(int listIndex) { |
// render_view()->webview()->selectAutofillSuggestionAtIndex(listIndex); |
} |
+void AutofillAgent::OnSetAutofillActionFill() { |
+ autofill_action_ = AUTOFILL_FILL; |
+ was_query_node_autofilled_ = autofill_query_element_.isAutofilled(); |
Ilya Sherman
2012/02/04 04:10:52
Hmm, can we move this into AutofillAgent::OnFormDa
csharp
2012/02/07 22:30:58
I don't think this can cause any trouble. The only
|
+} |
+ |
+void AutofillAgent::OnSetAutofillActionPreview() { |
+ didClearAutofillSelection(autofill_query_element_); |
Ilya Sherman
2012/02/04 04:10:52
Likewise, I think we could move this into the AUTO
csharp
2012/02/07 22:30:58
Seems like a good idea. Done.
|
+ |
+ autofill_action_ = AUTOFILL_PREVIEW; |
+ was_query_node_autofilled_ = autofill_query_element_.isAutofilled(); |
+} |
+ |
+void AutofillAgent::OnClearForm() { |
+ form_cache_.ClearFormWithElement(autofill_query_element_); |
+} |
+ |
+void AutofillAgent::OnClearAutofillSelection() { |
+ didClearAutofillSelection(autofill_query_element_); |
+} |
+ |
+void AutofillAgent::OnSetNodeText(string16 value) { |
+ // TODO add a check that we are setting the correct element |
Ilya Sherman
2012/02/04 04:10:52
nit: "TODO" -> "TODO(csharp):"
Ilya Sherman
2012/02/04 04:10:52
What sort of check are you thinking of?
csharp
2012/02/07 22:30:58
I had been thinking of making sure that autofill_q
|
+ 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, |