| 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 |
| 14 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ | 17 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ |
| 15 var FormControlElement; | 18 var FormControlElement; |
| 16 | 19 |
| 17 /** | 20 /** |
| 18 * @typedef {{ | 21 * @typedef {{ |
| 19 * name: string, | 22 * name: string, |
| 20 * value: string, | 23 * value: string, |
| 21 * form_control_type: string, | 24 * form_control_type: string, |
| 22 * autocomplete_attributes: string, | 25 * autocomplete_attributes: string, |
| 23 * max_length: number, | 26 * max_length: number, |
| (...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 continue; | 2058 continue; |
| 2056 } | 2059 } |
| 2057 var elementName = __gCrWeb['common'].nameForAutofill(element); | 2060 var elementName = __gCrWeb['common'].nameForAutofill(element); |
| 2058 var value = formData[elementName]; | 2061 var value = formData[elementName]; |
| 2059 if (value) { | 2062 if (value) { |
| 2060 element.placeholder = value; | 2063 element.placeholder = value; |
| 2061 } | 2064 } |
| 2062 } | 2065 } |
| 2063 } | 2066 } |
| 2064 }; | 2067 }; |
| 2068 |
| 2069 }()); // End of anonymous object |
| OLD | NEW |