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

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: First Draft 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 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,
« 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