| 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 #include <memory> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "components/autofill/core/common/password_form_field_prediction_map.h" | 12 #include "components/autofill/core/common/password_form_field_prediction_map.h" |
| 13 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 class WebDocument; | 17 class WebDocument; |
| 18 class WebFormElement; | 18 class WebFormElement; |
| 19 class WebFormControlElement; | 19 class WebFormControlElement; |
| 20 class WebFrame; | 20 class WebFrame; |
| 21 class WebInputElement; | 21 class WebInputElement; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // Create a PasswordForm from DOM form. Webkit doesn't allow storing | 41 // Create a PasswordForm from DOM form. Webkit doesn't allow storing |
| 42 // custom metadata to DOM nodes, so we have to do this every time an event | 42 // custom metadata to DOM nodes, so we have to do this every time an event |
| 43 // happens with a given form and compare against previously Create'd forms | 43 // happens with a given form and compare against previously Create'd forms |
| 44 // to identify..which sucks. | 44 // to identify..which sucks. |
| 45 // If an element of |form| has an entry in |nonscript_modified_values|, the | 45 // If an element of |form| has an entry in |nonscript_modified_values|, the |
| 46 // associated string is used instead of the element's value to create | 46 // associated string is used instead of the element's value to create |
| 47 // the PasswordForm. | 47 // the PasswordForm. |
| 48 // |form_predictions| is Autofill server response, if present it's used for | 48 // |form_predictions| is Autofill server response, if present it's used for |
| 49 // overwriting default username element selection. | 49 // overwriting default username element selection. |
| 50 scoped_ptr<PasswordForm> CreatePasswordFormFromWebForm( | 50 std::unique_ptr<PasswordForm> CreatePasswordFormFromWebForm( |
| 51 const blink::WebFormElement& form, | 51 const blink::WebFormElement& form, |
| 52 const ModifiedValues* nonscript_modified_values, | 52 const ModifiedValues* nonscript_modified_values, |
| 53 const FormsPredictionsMap* form_predictions); | 53 const FormsPredictionsMap* form_predictions); |
| 54 | 54 |
| 55 // Same as CreatePasswordFormFromWebForm() but for input elements that are not | 55 // Same as CreatePasswordFormFromWebForm() but for input elements that are not |
| 56 // enclosed in <form> element. | 56 // enclosed in <form> element. |
| 57 scoped_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements( | 57 std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements( |
| 58 const blink::WebFrame& frame, | 58 const blink::WebFrame& frame, |
| 59 const ModifiedValues* nonscript_modified_values, | 59 const ModifiedValues* nonscript_modified_values, |
| 60 const FormsPredictionsMap* form_predictions); | 60 const FormsPredictionsMap* form_predictions); |
| 61 | 61 |
| 62 // Checks in a case-insensitive way if the autocomplete attribute for the given | 62 // Checks in a case-insensitive way if the autocomplete attribute for the given |
| 63 // |element| is present and has the specified |value_in_lowercase|. | 63 // |element| is present and has the specified |value_in_lowercase|. |
| 64 bool HasAutocompleteAttributeValue(const blink::WebInputElement& element, | 64 bool HasAutocompleteAttributeValue(const blink::WebInputElement& element, |
| 65 const char* value_in_lowercase); | 65 const char* value_in_lowercase); |
| 66 | 66 |
| 67 } // namespace autofill | 67 } // namespace autofill |
| 68 | 68 |
| 69 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H
__ | 69 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H
__ |
| OLD | NEW |