Chromium Code Reviews| 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 class WebFormElement; | 13 class WebFormElement; |
| 14 class WebInputElement; | 14 class WebInputElement; |
| 15 class WebString; | 15 class WebString; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace autofill { | 18 namespace autofill { |
| 19 | 19 |
| 20 struct FormData; | |
| 21 struct FormFieldData; | |
| 20 struct PasswordForm; | 22 struct PasswordForm; |
| 21 | 23 |
| 22 // Create a PasswordForm from DOM form. Webkit doesn't allow storing | 24 // Create a PasswordForm from DOM form. Webkit doesn't allow storing |
| 23 // custom metadata to DOM nodes, so we have to do this every time an event | 25 // custom metadata to DOM nodes, so we have to do this every time an event |
| 24 // happens with a given form and compare against previously Create'd forms | 26 // happens with a given form and compare against previously Create'd forms |
| 25 // to identify..which sucks. | 27 // to identify..which sucks. |
| 26 // If an element of |form| has an entry in |nonscript_modified_values|, the | 28 // If an element of |form| has an entry in |nonscript_modified_values|, the |
| 27 // associated string is used instead of the element's value to create | 29 // associated string is used instead of the element's value to create |
| 28 // the PasswordForm. | 30 // the PasswordForm. |
| 31 // |form_predictions| is Autofill server response, if present it's used for | |
| 32 // overwriting default username element selection. | |
| 29 scoped_ptr<PasswordForm> CreatePasswordForm( | 33 scoped_ptr<PasswordForm> CreatePasswordForm( |
| 30 const blink::WebFormElement& form, | 34 const blink::WebFormElement& form, |
| 31 const std::map<const blink::WebInputElement, blink::WebString>* | 35 const std::map<const blink::WebInputElement, blink::WebString>* |
| 32 nonscript_modified_values); | 36 nonscript_modified_values, |
| 37 const std::map<autofill::FormData, autofill::FormFieldData>* | |
| 38 form_predictions); | |
|
Ilya Sherman
2015/03/26 00:30:04
Please pass this by const-reference.
vabr (Chromium)
2015/03/26 09:43:55
Ilya -- I believe the pointer was used to allow sp
| |
| 33 | 39 |
| 34 } // namespace autofill | 40 } // namespace autofill |
| 35 | 41 |
| 36 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H __ | 42 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H __ |
| OLD | NEW |