| 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_CACHE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 class WebDocument; | 15 class WebDocument; |
| 16 class WebFormControlElement; |
| 16 class WebFormElement; | 17 class WebFormElement; |
| 17 class WebFrame; | 18 class WebFrame; |
| 18 class WebInputElement; | 19 class WebInputElement; |
| 19 class WebSelectElement; | 20 class WebSelectElement; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace autofill { | 23 namespace autofill { |
| 23 | 24 |
| 24 struct FormData; | 25 struct FormData; |
| 25 struct FormDataPredictions; | 26 struct FormDataPredictions; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 const blink::WebFrame& frame, | 44 const blink::WebFrame& frame, |
| 44 size_t minimum_required_fields, | 45 size_t minimum_required_fields, |
| 45 std::vector<FormData>* forms, | 46 std::vector<FormData>* forms, |
| 46 std::vector<blink::WebFormElement>* web_form_elements); | 47 std::vector<blink::WebFormElement>* web_form_elements); |
| 47 | 48 |
| 48 // Resets the forms for the specified |frame|. | 49 // Resets the forms for the specified |frame|. |
| 49 void ResetFrame(const blink::WebFrame& frame); | 50 void ResetFrame(const blink::WebFrame& frame); |
| 50 | 51 |
| 51 // Clears the values of all input elements in the form that contains | 52 // Clears the values of all input elements in the form that contains |
| 52 // |element|. Returns false if the form is not found. | 53 // |element|. Returns false if the form is not found. |
| 53 bool ClearFormWithElement(const blink::WebInputElement& element); | 54 bool ClearFormWithElement(const blink::WebFormControlElement& element); |
| 54 | 55 |
| 55 // For each field in the |form|, sets the field's placeholder text to the | 56 // For each field in the |form|, sets the field's placeholder text to the |
| 56 // field's overall predicted type. Also sets the title to include the field's | 57 // field's overall predicted type. Also sets the title to include the field's |
| 57 // heuristic type, server type, and signature; as well as the form's signature | 58 // heuristic type, server type, and signature; as well as the form's signature |
| 58 // and the experiment id for the server predictions. | 59 // and the experiment id for the server predictions. |
| 59 bool ShowPredictions(const FormDataPredictions& form); | 60 bool ShowPredictions(const FormDataPredictions& form); |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 // The cached web frames. | 63 // The cached web frames. |
| 63 std::set<blink::WebDocument> web_documents_; | 64 std::set<blink::WebDocument> web_documents_; |
| 64 | 65 |
| 65 // The cached initial values for <select> elements. | 66 // The cached initial values for <select> elements. |
| 66 std::map<const blink::WebSelectElement, base::string16> | 67 std::map<const blink::WebSelectElement, base::string16> |
| 67 initial_select_values_; | 68 initial_select_values_; |
| 68 | 69 |
| 69 // The cached initial values for checkable <input> elements. | 70 // The cached initial values for checkable <input> elements. |
| 70 std::map<const blink::WebInputElement, bool> initial_checked_state_; | 71 std::map<const blink::WebInputElement, bool> initial_checked_state_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(FormCache); | 73 DISALLOW_COPY_AND_ASSIGN(FormCache); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace autofill | 76 } // namespace autofill |
| 76 | 77 |
| 77 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ | 78 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
| OLD | NEW |