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

Side by Side Diff: components/autofill/ios/browser/resources/autofill_controller.js

Issue 2242353002: [ios] Put autofill scripts into anonymous function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | components/autofill/ios/browser/resources/suggestion_controller.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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
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
OLDNEW
« no previous file with comments | « no previous file | components/autofill/ios/browser/resources/suggestion_controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698