OLD | NEW |
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 // Installs Autofill management functions on the |__gCrWeb| object. | 5 // Installs Autofill management functions on the |__gCrWeb| object. |
6 // | 6 // |
7 // It scans the DOM, extracting and storing forms and returns a JSON string | 7 // It scans the DOM, extracting and storing forms and returns a JSON string |
8 // representing an array of objects, each of which represents an Autofill form | 8 // representing an array of objects, each of which represents an Autofill form |
9 // with information about a form to be filled and/or submitted and it can be | 9 // with information about a form to be filled and/or submitted and it can be |
10 // translated to struct FormData | 10 // translated to struct FormData |
11 // (chromium/src/components/autofill/core/common/form_data.h) for further | 11 // (chromium/src/components/autofill/core/common/form_data.h) for further |
12 // processing. | 12 // processing. |
13 | 13 |
14 /* Beginning of anonymous object. */ | |
15 (function() { | |
16 | |
17 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ | 14 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ |
18 var FormControlElement; | 15 var FormControlElement; |
19 | 16 |
20 /** | 17 /** |
21 * @typedef {{ | 18 * @typedef {{ |
22 * name: string, | 19 * name: string, |
23 * value: string, | 20 * value: string, |
24 * form_control_type: string, | 21 * form_control_type: string, |
25 * autocomplete_attributes: string, | 22 * autocomplete_attributes: string, |
26 * max_length: number, | 23 * max_length: number, |
(...skipping 12 matching lines...) Expand all Loading... |
39 * @typedef {{ | 36 * @typedef {{ |
40 * name: string, | 37 * name: string, |
41 * method: string, | 38 * method: string, |
42 * origin: string, | 39 * origin: string, |
43 * action: string, | 40 * action: string, |
44 * fields: Array<AutofillFormFieldData> | 41 * fields: Array<AutofillFormFieldData> |
45 * }} | 42 * }} |
46 */ | 43 */ |
47 var AutofillFormData; | 44 var AutofillFormData; |
48 | 45 |
| 46 /* Beginning of anonymous object. */ |
| 47 (function() { |
| 48 |
49 /** | 49 /** |
50 * Namespace for this file. It depends on |__gCrWeb| having already been | 50 * Namespace for this file. It depends on |__gCrWeb| having already been |
51 * injected. | 51 * injected. |
52 */ | 52 */ |
53 __gCrWeb['autofill'] = {}; | 53 __gCrWeb['autofill'] = {}; |
54 | 54 |
55 /** | 55 /** |
56 * The maximum length allowed for form data. | 56 * The maximum length allowed for form data. |
57 * | 57 * |
58 * This variable is from AutofillTable::kMaxDataLength in | 58 * This variable is from AutofillTable::kMaxDataLength in |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 var elementName = __gCrWeb['common'].nameForAutofill(element); | 2060 var elementName = __gCrWeb['common'].nameForAutofill(element); |
2061 var value = formData[elementName]; | 2061 var value = formData[elementName]; |
2062 if (value) { | 2062 if (value) { |
2063 element.placeholder = value; | 2063 element.placeholder = value; |
2064 } | 2064 } |
2065 } | 2065 } |
2066 } | 2066 } |
2067 }; | 2067 }; |
2068 | 2068 |
2069 }()); // End of anonymous object | 2069 }()); // End of anonymous object |
OLD | NEW |