1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Multiply-included message file, hence no include guard.
6
7#include <string>
8
9#include "content/common/webkit_param_traits.h"
10#include "ipc/ipc_message_macros.h"
11#include "webkit/glue/form_data.h"
12#include "webkit/glue/form_field.h"
13#include "webkit/glue/password_form.h"
14#include "webkit/glue/password_form_dom_manager.h"
15
16#define IPC_MESSAGE_START AutofillMsgStart
17
18IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormField)
19  IPC_STRUCT_TRAITS_MEMBER(label)
20  IPC_STRUCT_TRAITS_MEMBER(name)
21  IPC_STRUCT_TRAITS_MEMBER(value)
22  IPC_STRUCT_TRAITS_MEMBER(form_control_type)
23  IPC_STRUCT_TRAITS_MEMBER(max_length)
24  IPC_STRUCT_TRAITS_MEMBER(is_autofilled)
25  IPC_STRUCT_TRAITS_MEMBER(option_strings)
26IPC_STRUCT_TRAITS_END()
27
28IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormData)
29  IPC_STRUCT_TRAITS_MEMBER(name)
30  IPC_STRUCT_TRAITS_MEMBER(method)
31  IPC_STRUCT_TRAITS_MEMBER(origin)
32  IPC_STRUCT_TRAITS_MEMBER(action)
33  IPC_STRUCT_TRAITS_MEMBER(user_submitted)
34  IPC_STRUCT_TRAITS_MEMBER(fields)
35IPC_STRUCT_TRAITS_END()
36
37IPC_STRUCT_TRAITS_BEGIN(webkit_glue::PasswordFormFillData)
38  IPC_STRUCT_TRAITS_MEMBER(basic_data)
39  IPC_STRUCT_TRAITS_MEMBER(additional_logins)
40  IPC_STRUCT_TRAITS_MEMBER(wait_for_username)
41IPC_STRUCT_TRAITS_END()
42
43// Autofill messages sent from the browser to the renderer.
44
45// Reply to the AutofillHostMsg_QueryFormFieldAutofill message with the
46// Autofill suggestions.
47IPC_MESSAGE_ROUTED5(AutofillMsg_SuggestionsReturned,
48                    int /* id of the request message */,
49                    std::vector<string16> /* names */,
50                    std::vector<string16> /* labels */,
51                    std::vector<string16> /* icons */,
52                    std::vector<int> /* unique_ids */)
53
54// Reply to the AutofillHostMsg_FillAutofillFormData message with the
55// Autofill form data.
56IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled,
57                    int /* id of the request message */,
58                    webkit_glue::FormData /* form data */)
59
60// Fill a password form and prepare field autocomplete for multiple
61// matching logins.
62IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm,
63                    webkit_glue::PasswordFormFillData)
64
65
66// Autofill messages sent from the renderer to the browser.
67
68// Notification that forms have been seen that are candidates for
69// filling/submitting by the AutofillManager.
70IPC_MESSAGE_ROUTED1(AutofillHostMsg_FormsSeen,
71                    std::vector<webkit_glue::FormData> /* forms */)
72
73// Notification that password forms have been seen that are candidates for
74// filling/submitting by the password manager.
75IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsFound,
76                    std::vector<webkit_glue::PasswordForm> /* forms */)
77
78// Notification that initial layout has occurred and the following password
79// forms are visible on the page (e.g. not set to display:none.)
80IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsVisible,
81                    std::vector<webkit_glue::PasswordForm> /* forms */)
82
83// Notification that a form has been submitted.  The user hit the button.
84IPC_MESSAGE_ROUTED1(AutofillHostMsg_FormSubmitted,
85                    webkit_glue::FormData /* form */)
86
87// Queries the browser for Autofill suggestions for a form input field.
88IPC_MESSAGE_ROUTED3(AutofillHostMsg_QueryFormFieldAutofill,
89                    int /* id of this message */,
90                    webkit_glue::FormData /* the form */,
91                    webkit_glue::FormField /* the form field */)
92
93// Sent when the popup with Autofill suggestions for a form is shown.
94IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidShowAutofillSuggestions)
95
96// Instructs the browser to fill in the values for a form using Autofill
97// profile data.
98IPC_MESSAGE_ROUTED4(AutofillHostMsg_FillAutofillFormData,
99                    int /* id of this message */,
100                    webkit_glue::FormData /* the form  */,
101                    webkit_glue::FormField /* the form field  */,
102                    int /* profile unique ID */)
103
104// Sent when a form is previewed or filled with Autofill suggestions.
105IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidFillAutofillFormData)
106
107// Instructs the browser to remove the specified Autocomplete entry from the
108// database.
109IPC_MESSAGE_ROUTED2(AutofillHostMsg_RemoveAutocompleteEntry,
110                    string16 /* field name */,
111                    string16 /* value */)
112
113// Instructs the browser to show the Autofill dialog.
114IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog)
115
116
117