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