| 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 /** |
| 6 // | 6 * @fileoverview Installs Autofill management functions on the __gCrWeb object. |
| 7 // It scans the DOM, extracting and storing forms and returns a JSON string | 7 * |
| 8 // representing an array of objects, each of which represents an Autofill form | 8 * It scans the DOM, extracting and storing forms and returns a JSON string |
| 9 // with information about a form to be filled and/or submitted and it can be | 9 * representing an array of objects, each of which represents an Autofill form |
| 10 // translated to struct FormData | 10 * with information about a form to be filled and/or submitted and it can be |
| 11 // (chromium/src/components/autofill/core/common/form_data.h) for further | 11 * translated to struct FormData |
| 12 // processing. | 12 * (chromium/src/components/autofill/core/common/form_data.h) for further |
| 13 * processing. |
| 14 |
| 15 * TODO(crbug.com/647084): Enable checkTypes error for this file. |
| 16 * @suppress {checkTypes} |
| 17 */ |
| 13 | 18 |
| 14 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ | 19 /** @typedef {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement} */ |
| 15 var FormControlElement; | 20 var FormControlElement; |
| 16 | 21 |
| 17 /** | 22 /** |
| 18 * @typedef {{ | 23 * @typedef {{ |
| 19 * name: string, | 24 * name: string, |
| 20 * value: string, | 25 * value: string, |
| 21 * form_control_type: string, | 26 * form_control_type: string, |
| 22 * autocomplete_attributes: string, | 27 * autocomplete_attributes: string, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 */ | 48 */ |
| 44 var AutofillFormData; | 49 var AutofillFormData; |
| 45 | 50 |
| 46 /* Beginning of anonymous object. */ | 51 /* Beginning of anonymous object. */ |
| 47 (function() { | 52 (function() { |
| 48 | 53 |
| 49 /** | 54 /** |
| 50 * Namespace for this file. It depends on |__gCrWeb| having already been | 55 * Namespace for this file. It depends on |__gCrWeb| having already been |
| 51 * injected. | 56 * injected. |
| 52 */ | 57 */ |
| 53 __gCrWeb['autofill'] = {}; | 58 __gCrWeb.autofill = {}; |
| 59 |
| 60 // Store autofill namespace object in a global __gCrWeb object referenced by a |
| 61 // string, so it does not get renamed by closure compiler during the |
| 62 // minification. |
| 63 __gCrWeb['autofill'] = __gCrWeb.autofill; |
| 54 | 64 |
| 55 /** | 65 /** |
| 56 * The maximum length allowed for form data. | 66 * The maximum length allowed for form data. |
| 57 * | 67 * |
| 58 * This variable is from AutofillTable::kMaxDataLength in | 68 * This variable is from AutofillTable::kMaxDataLength in |
| 59 * chromium/src/components/autofill/core/browser/webdata/autofill_table.h | 69 * chromium/src/components/autofill/core/browser/webdata/autofill_table.h |
| 60 * | 70 * |
| 61 * @const {number} | 71 * @const {number} |
| 62 */ | 72 */ |
| 63 __gCrWeb.autofill.MAX_DATA_LENGTH = 1024; | 73 __gCrWeb.autofill.MAX_DATA_LENGTH = 1024; |
| (...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2060 var elementName = __gCrWeb['common'].nameForAutofill(element); | 2070 var elementName = __gCrWeb['common'].nameForAutofill(element); |
| 2061 var value = formData[elementName]; | 2071 var value = formData[elementName]; |
| 2062 if (value) { | 2072 if (value) { |
| 2063 element.placeholder = value; | 2073 element.placeholder = value; |
| 2064 } | 2074 } |
| 2065 } | 2075 } |
| 2066 } | 2076 } |
| 2067 }; | 2077 }; |
| 2068 | 2078 |
| 2069 }()); // End of anonymous object | 2079 }()); // End of anonymous object |
| OLD | NEW |