| 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_FORM_AUTOFILL_UTIL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 // Helper function that strips any authentication data, as well as query and | 78 // Helper function that strips any authentication data, as well as query and |
| 79 // ref portions of URL | 79 // ref portions of URL |
| 80 GURL StripAuthAndParams(const GURL& gurl); | 80 GURL StripAuthAndParams(const GURL& gurl); |
| 81 | 81 |
| 82 // Extract FormData from the form element and return whether the operation was | 82 // Extract FormData from the form element and return whether the operation was |
| 83 // successful. | 83 // successful. |
| 84 bool ExtractFormData(const blink::WebFormElement& form_element, FormData* data); | 84 bool ExtractFormData(const blink::WebFormElement& form_element, FormData* data); |
| 85 | 85 |
| 86 // Helper function to check if there exist any form on |frame| where its action | 86 // Helper function to check if there exist any visible form on |frame| which |
| 87 // equals |form_element|. If |form_element| is null, checks if forms action |
| 87 // equals |action|. Returns true if so. For forms with empty or unspecified | 88 // equals |action|. Returns true if so. For forms with empty or unspecified |
| 88 // actions, all form data are used for comparison. Form data comparison is | 89 // actions, all form data are used for comparison. Form data comparison is |
| 89 // disabled on Mac and Android because the update prompt isn't implemented. | 90 // disabled on Mac and Android because the update prompt isn't implemented. It |
| 90 // It may cause many false password updates. | 91 // may cause many false password updates. |
| 91 // TODO(kolos) Turn on all data comparing when the update prompt will be | 92 // TODO(kolos) Turn on all data comparing when the update prompt will be |
| 92 // implemented on Mac and Android. | 93 // implemented on Mac and Android. |
| 93 bool IsFormVisible(blink::WebFrame* frame, | 94 bool IsFormVisible(blink::WebFrame* frame, |
| 95 const blink::WebFormElement& form_element, |
| 94 const GURL& action, | 96 const GURL& action, |
| 95 const GURL& origin, | 97 const GURL& origin, |
| 96 const FormData& form_data); | 98 const FormData& form_data); |
| 97 | 99 |
| 98 // Returns true if at least one element from |control_elements| is visible. | 100 // Returns true if at least one element from |control_elements| is visible. |
| 99 bool IsSomeControlElementVisible( | 101 bool IsSomeControlElementVisible( |
| 100 const blink::WebVector<blink::WebFormControlElement>& control_elements); | 102 const blink::WebVector<blink::WebFormControlElement>& control_elements); |
| 101 | 103 |
| 102 // Returns true if some control elements of |form| are visible. | 104 // Returns true if some control elements of |form| are visible. |
| 103 bool AreFormContentsVisible(const blink::WebFormElement& form); | 105 bool AreFormContentsVisible(const blink::WebFormElement& form); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // |input_element|. Note that |user_input| cannot be easily derived from | 274 // |input_element|. Note that |user_input| cannot be easily derived from |
| 273 // |input_element| by calling value(), because of http://crbug.com/507714. | 275 // |input_element| by calling value(), because of http://crbug.com/507714. |
| 274 void PreviewSuggestion(const base::string16& suggestion, | 276 void PreviewSuggestion(const base::string16& suggestion, |
| 275 const base::string16& user_input, | 277 const base::string16& user_input, |
| 276 blink::WebFormControlElement* input_element); | 278 blink::WebFormControlElement* input_element); |
| 277 | 279 |
| 278 } // namespace form_util | 280 } // namespace form_util |
| 279 } // namespace autofill | 281 } // namespace autofill |
| 280 | 282 |
| 281 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ | 283 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
| OLD | NEW |