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

Side by Side Diff: components/autofill/core/common/autofill_messages.h

Issue 23742004: Move PasswordForm from //content to //autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_password_form_conversion_utils
Patch Set: Nits Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Multiply-included message file, hence no include guard. 5 // Multiply-included message file, hence no include guard.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "components/autofill/core/common/autofill_param_traits_macros.h"
10 #include "components/autofill/core/common/form_data.h" 11 #include "components/autofill/core/common/form_data.h"
11 #include "components/autofill/core/common/form_data_predictions.h" 12 #include "components/autofill/core/common/form_data_predictions.h"
12 #include "components/autofill/core/common/form_field_data.h" 13 #include "components/autofill/core/common/form_field_data.h"
13 #include "components/autofill/core/common/form_field_data_predictions.h" 14 #include "components/autofill/core/common/form_field_data_predictions.h"
14 #include "components/autofill/core/common/forms_seen_state.h" 15 #include "components/autofill/core/common/forms_seen_state.h"
16 #include "components/autofill/core/common/password_form.h"
15 #include "components/autofill/core/common/password_form_fill_data.h" 17 #include "components/autofill/core/common/password_form_fill_data.h"
16 #include "components/autofill/core/common/web_element_descriptor.h" 18 #include "components/autofill/core/common/web_element_descriptor.h"
17 #include "content/public/common/common_param_traits.h" 19 #include "content/public/common/common_param_traits.h"
18 #include "content/public/common/common_param_traits_macros.h" 20 #include "content/public/common/common_param_traits_macros.h"
19 #include "content/public/common/password_form.h"
20 #include "ipc/ipc_message_macros.h" 21 #include "ipc/ipc_message_macros.h"
21 #include "ipc/ipc_message_utils.h" 22 #include "ipc/ipc_message_utils.h"
22 #include "third_party/WebKit/public/web/WebFormElement.h" 23 #include "third_party/WebKit/public/web/WebFormElement.h"
23 #include "ui/gfx/rect.h" 24 #include "ui/gfx/rect.h"
24 #include "url/gurl.h" 25 #include "url/gurl.h"
25 26
26 #define IPC_MESSAGE_START AutofillMsgStart 27 #define IPC_MESSAGE_START AutofillMsgStart
27 28
28 IPC_ENUM_TRAITS_MAX_VALUE(autofill::FormsSeenState,
29 autofill::FORMS_SEEN_STATE_NUM_STATES - 1)
30 IPC_ENUM_TRAITS_MAX_VALUE(base::i18n::TextDirection,
31 base::i18n::TEXT_DIRECTION_NUM_DIRECTIONS - 1)
32
33 IPC_STRUCT_TRAITS_BEGIN(autofill::WebElementDescriptor)
34 IPC_STRUCT_TRAITS_MEMBER(descriptor)
35 IPC_STRUCT_TRAITS_MEMBER(retrieval_method)
36 IPC_STRUCT_TRAITS_END()
37
38 IPC_ENUM_TRAITS_MAX_VALUE(autofill::WebElementDescriptor::RetrievalMethod,
39 autofill::WebElementDescriptor::NONE)
40
41 IPC_STRUCT_TRAITS_BEGIN(autofill::FormFieldData)
42 IPC_STRUCT_TRAITS_MEMBER(label)
43 IPC_STRUCT_TRAITS_MEMBER(name)
44 IPC_STRUCT_TRAITS_MEMBER(value)
45 IPC_STRUCT_TRAITS_MEMBER(form_control_type)
46 IPC_STRUCT_TRAITS_MEMBER(autocomplete_attribute)
47 IPC_STRUCT_TRAITS_MEMBER(max_length)
48 IPC_STRUCT_TRAITS_MEMBER(is_autofilled)
49 IPC_STRUCT_TRAITS_MEMBER(is_checked)
50 IPC_STRUCT_TRAITS_MEMBER(is_checkable)
51 IPC_STRUCT_TRAITS_MEMBER(is_focusable)
52 IPC_STRUCT_TRAITS_MEMBER(should_autocomplete)
53 IPC_STRUCT_TRAITS_MEMBER(text_direction)
54 IPC_STRUCT_TRAITS_MEMBER(option_values)
55 IPC_STRUCT_TRAITS_MEMBER(option_contents)
56 IPC_STRUCT_TRAITS_END()
57
58 IPC_STRUCT_TRAITS_BEGIN(autofill::FormFieldDataPredictions)
59 IPC_STRUCT_TRAITS_MEMBER(field)
60 IPC_STRUCT_TRAITS_MEMBER(signature)
61 IPC_STRUCT_TRAITS_MEMBER(heuristic_type)
62 IPC_STRUCT_TRAITS_MEMBER(server_type)
63 IPC_STRUCT_TRAITS_MEMBER(overall_type)
64 IPC_STRUCT_TRAITS_END()
65
66 IPC_STRUCT_TRAITS_BEGIN(autofill::FormData)
67 IPC_STRUCT_TRAITS_MEMBER(name)
68 IPC_STRUCT_TRAITS_MEMBER(method)
69 IPC_STRUCT_TRAITS_MEMBER(origin)
70 IPC_STRUCT_TRAITS_MEMBER(action)
71 IPC_STRUCT_TRAITS_MEMBER(user_submitted)
72 IPC_STRUCT_TRAITS_MEMBER(fields)
73 IPC_STRUCT_TRAITS_END()
74
75 IPC_STRUCT_TRAITS_BEGIN(autofill::FormDataPredictions)
76 IPC_STRUCT_TRAITS_MEMBER(data)
77 IPC_STRUCT_TRAITS_MEMBER(signature)
78 IPC_STRUCT_TRAITS_MEMBER(experiment_id)
79 IPC_STRUCT_TRAITS_MEMBER(fields)
80 IPC_STRUCT_TRAITS_END()
81
82 IPC_STRUCT_TRAITS_BEGIN(autofill::UsernamesCollectionKey)
83 IPC_STRUCT_TRAITS_MEMBER(username)
84 IPC_STRUCT_TRAITS_MEMBER(password)
85 IPC_STRUCT_TRAITS_END()
86
87 IPC_STRUCT_TRAITS_BEGIN(autofill::PasswordFormFillData)
88 IPC_STRUCT_TRAITS_MEMBER(basic_data)
89 IPC_STRUCT_TRAITS_MEMBER(preferred_realm)
90 IPC_STRUCT_TRAITS_MEMBER(additional_logins)
91 IPC_STRUCT_TRAITS_MEMBER(other_possible_usernames)
92 IPC_STRUCT_TRAITS_MEMBER(wait_for_username)
93 IPC_STRUCT_TRAITS_END()
94
95 IPC_STRUCT_TRAITS_BEGIN(autofill::PasswordAndRealm)
96 IPC_STRUCT_TRAITS_MEMBER(password)
97 IPC_STRUCT_TRAITS_MEMBER(realm)
98 IPC_STRUCT_TRAITS_END()
99
100 IPC_ENUM_TRAITS_MAX_VALUE(
101 WebKit::WebFormElement::AutocompleteResult,
102 WebKit::WebFormElement::AutocompleteResultErrorInvalid)
103
104 // Autofill messages sent from the browser to the renderer. 29 // Autofill messages sent from the browser to the renderer.
105 30
106 // Reply to the AutofillHostMsg_FillAutofillFormData message with the 31 // Reply to the AutofillHostMsg_FillAutofillFormData message with the
107 // Autofill form data. 32 // Autofill form data.
108 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, 33 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled,
109 int /* id of the request message */, 34 int /* id of the request message */,
110 autofill::FormData /* form data */) 35 autofill::FormData /* form data */)
111 36
112 // Fill a password form and prepare field autocomplete for multiple 37 // Fill a password form and prepare field autocomplete for multiple
113 // matching logins. Lets the renderer know if it should disable the popup 38 // matching logins. Lets the renderer know if it should disable the popup
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 IPC_MESSAGE_ROUTED1(AutofillMsg_PasswordGenerationEnabled, 74 IPC_MESSAGE_ROUTED1(AutofillMsg_PasswordGenerationEnabled,
150 bool /* is_enabled */) 75 bool /* is_enabled */)
151 76
152 // Tells the renderer that the password field has accept the suggestion. 77 // Tells the renderer that the password field has accept the suggestion.
153 IPC_MESSAGE_ROUTED1(AutofillMsg_AcceptPasswordAutofillSuggestion, 78 IPC_MESSAGE_ROUTED1(AutofillMsg_AcceptPasswordAutofillSuggestion,
154 base::string16 /* username value*/) 79 base::string16 /* username value*/)
155 80
156 // Tells the renderer that this password form is not blacklisted. A form can 81 // Tells the renderer that this password form is not blacklisted. A form can
157 // be blacklisted if a user chooses "never save passwords for this site". 82 // be blacklisted if a user chooses "never save passwords for this site".
158 IPC_MESSAGE_ROUTED1(AutofillMsg_FormNotBlacklisted, 83 IPC_MESSAGE_ROUTED1(AutofillMsg_FormNotBlacklisted,
159 content::PasswordForm /* form checked */) 84 autofill::PasswordForm /* form checked */)
160 85
161 // Sent when requestAutocomplete() finishes (either succesfully or with an 86 // Sent when requestAutocomplete() finishes (either succesfully or with an
162 // error). If it was a success, the renderer fills the form that requested 87 // error). If it was a success, the renderer fills the form that requested
163 // autocomplete with the |form_data| values input by the user. 88 // autocomplete with the |form_data| values input by the user.
164 IPC_MESSAGE_ROUTED2(AutofillMsg_RequestAutocompleteResult, 89 IPC_MESSAGE_ROUTED2(AutofillMsg_RequestAutocompleteResult,
165 WebKit::WebFormElement::AutocompleteResult /* result */, 90 WebKit::WebFormElement::AutocompleteResult /* result */,
166 autofill::FormData /* form_data */) 91 autofill::FormData /* form_data */)
167 92
168 // Sent when the current page is actually displayed in the browser, possibly 93 // Sent when the current page is actually displayed in the browser, possibly
169 // after being preloaded. 94 // after being preloaded.
170 IPC_MESSAGE_ROUTED0(AutofillMsg_PageShown) 95 IPC_MESSAGE_ROUTED0(AutofillMsg_PageShown)
171 96
172 // Autofill messages sent from the renderer to the browser. 97 // Autofill messages sent from the renderer to the browser.
173 98
174 // TODO(creis): check in the browser that the renderer actually has permission 99 // TODO(creis): check in the browser that the renderer actually has permission
175 // for the URL to avoid compromised renderers talking to the browser. 100 // for the URL to avoid compromised renderers talking to the browser.
176 101
177 // Notification that forms have been seen that are candidates for 102 // Notification that forms have been seen that are candidates for
178 // filling/submitting by the AutofillManager. 103 // filling/submitting by the AutofillManager.
179 IPC_MESSAGE_ROUTED3(AutofillHostMsg_FormsSeen, 104 IPC_MESSAGE_ROUTED3(AutofillHostMsg_FormsSeen,
180 std::vector<autofill::FormData> /* forms */, 105 std::vector<autofill::FormData> /* forms */,
181 base::TimeTicks /* timestamp */, 106 base::TimeTicks /* timestamp */,
182 autofill::FormsSeenState /* state */) 107 autofill::FormsSeenState /* state */)
183 108
184 // Notification that password forms have been seen that are candidates for 109 // Notification that password forms have been seen that are candidates for
185 // filling/submitting by the password manager. 110 // filling/submitting by the password manager.
186 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsParsed, 111 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsParsed,
187 std::vector<content::PasswordForm> /* forms */) 112 std::vector<autofill::PasswordForm> /* forms */)
188 113
189 // Notification that initial layout has occurred and the following password 114 // Notification that initial layout has occurred and the following password
190 // forms are visible on the page (e.g. not set to display:none.) 115 // forms are visible on the page (e.g. not set to display:none.)
191 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsRendered, 116 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsRendered,
192 std::vector<content::PasswordForm> /* forms */) 117 std::vector<autofill::PasswordForm> /* forms */)
193 118
194 // Notification that this password form was submitted by the user. 119 // Notification that this password form was submitted by the user.
195 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormSubmitted, 120 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormSubmitted,
196 content::PasswordForm /* form */) 121 autofill::PasswordForm /* form */)
197 122
198 // Notification that a form has been submitted. The user hit the button. 123 // Notification that a form has been submitted. The user hit the button.
199 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, 124 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted,
200 autofill::FormData /* form */, 125 autofill::FormData /* form */,
201 base::TimeTicks /* timestamp */) 126 base::TimeTicks /* timestamp */)
202 127
203 // Notification that a form field's value has changed. 128 // Notification that a form field's value has changed.
204 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, 129 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange,
205 autofill::FormData /* the form */, 130 autofill::FormData /* the form */,
206 autofill::FormFieldData /* the form field */, 131 autofill::FormFieldData /* the form field */,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 167
243 // Instructs the browser to hide the Autofill UI. 168 // Instructs the browser to hide the Autofill UI.
244 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillUI) 169 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillUI)
245 170
246 // Instructs the browser to show the password generation bubble at the 171 // Instructs the browser to show the password generation bubble at the
247 // specified location. This location should be specified in the renderers 172 // specified location. This location should be specified in the renderers
248 // coordinate system. Form is the form associated with the password field. 173 // coordinate system. Form is the form associated with the password field.
249 IPC_MESSAGE_ROUTED3(AutofillHostMsg_ShowPasswordGenerationPopup, 174 IPC_MESSAGE_ROUTED3(AutofillHostMsg_ShowPasswordGenerationPopup,
250 gfx::Rect /* source location */, 175 gfx::Rect /* source location */,
251 int /* max length of the password */, 176 int /* max length of the password */,
252 content::PasswordForm) 177 autofill::PasswordForm)
253 178
254 // Instruct the browser that a password mapping has been found for a field. 179 // Instruct the browser that a password mapping has been found for a field.
255 IPC_MESSAGE_ROUTED2(AutofillHostMsg_AddPasswordFormMapping, 180 IPC_MESSAGE_ROUTED2(AutofillHostMsg_AddPasswordFormMapping,
256 autofill::FormFieldData, /* the user name field */ 181 autofill::FormFieldData, /* the user name field */
257 autofill::PasswordFormFillData /* password pairings */) 182 autofill::PasswordFormFillData /* password pairings */)
258 183
259 // Instruct the browser to show a popup with the following suggestions from the 184 // Instruct the browser to show a popup with the following suggestions from the
260 // password manager. 185 // password manager.
261 IPC_MESSAGE_ROUTED4(AutofillHostMsg_ShowPasswordSuggestions, 186 IPC_MESSAGE_ROUTED4(AutofillHostMsg_ShowPasswordSuggestions,
262 autofill::FormFieldData /* the form field */, 187 autofill::FormFieldData /* the form field */,
263 gfx::RectF /* input field bounds, window-relative */, 188 gfx::RectF /* input field bounds, window-relative */,
264 std::vector<base::string16> /* suggestions */, 189 std::vector<base::string16> /* suggestions */,
265 std::vector<base::string16> /* realms */) 190 std::vector<base::string16> /* realms */)
266 191
267 // Inform browser of data list values for the curent field. 192 // Inform browser of data list values for the curent field.
268 IPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList, 193 IPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList,
269 std::vector<base::string16> /* values */, 194 std::vector<base::string16> /* values */,
270 std::vector<base::string16> /* labels */) 195 std::vector<base::string16> /* labels */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698