| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ | 5 #ifndef CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ |
| 6 #define CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ | 6 #define CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 | 14 |
| 15 namespace webkit_glue { | 15 namespace webkit_glue { |
| 16 struct FormData; | 16 struct FormData; |
| 17 struct FormDataPredictions; | 17 struct FormDataPredictions; |
| 18 } // namespace webkit_glue | 18 } // namespace webkit_glue |
| 19 | 19 |
| 20 namespace WebKit { | 20 namespace WebKit { |
| 21 class WebDocument; |
| 21 class WebFormControlElement; | 22 class WebFormControlElement; |
| 22 class WebFrame; | 23 class WebFrame; |
| 23 class WebInputElement; | 24 class WebInputElement; |
| 24 class WebSelectElement; | 25 class WebSelectElement; |
| 25 } // namespace WebKit | 26 } // namespace WebKit |
| 26 | 27 |
| 27 namespace autofill { | 28 namespace autofill { |
| 28 | 29 |
| 29 // Manages the forms in a RenderView. | 30 // Manages the forms in a RenderView. |
| 30 class FormCache { | 31 class FormCache { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 bool ClearFormWithElement(const WebKit::WebInputElement& element); | 46 bool ClearFormWithElement(const WebKit::WebInputElement& element); |
| 46 | 47 |
| 47 // For each field in the |form|, sets the field's placeholder text to the | 48 // For each field in the |form|, sets the field's placeholder text to the |
| 48 // field's overall predicted type. Also sets the title to include the field's | 49 // field's overall predicted type. Also sets the title to include the field's |
| 49 // heuristic type, server type, and signature; as well as the form's signature | 50 // heuristic type, server type, and signature; as well as the form's signature |
| 50 // and the experiment id for the server predictions. | 51 // and the experiment id for the server predictions. |
| 51 bool ShowPredictions(const webkit_glue::FormDataPredictions& form); | 52 bool ShowPredictions(const webkit_glue::FormDataPredictions& form); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 // The cached web frames. | 55 // The cached web frames. |
| 55 std::set<const WebKit::WebFrame*> web_frames_; | 56 std::set<WebKit::WebDocument> web_documents_; |
| 56 | 57 |
| 57 // The cached initial values for <select> elements. | 58 // The cached initial values for <select> elements. |
| 58 std::map<const WebKit::WebSelectElement, string16> initial_select_values_; | 59 std::map<const WebKit::WebSelectElement, string16> initial_select_values_; |
| 59 | 60 |
| 60 DISALLOW_COPY_AND_ASSIGN(FormCache); | 61 DISALLOW_COPY_AND_ASSIGN(FormCache); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace autofill | 64 } // namespace autofill |
| 64 | 65 |
| 65 #endif // CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ | 66 #endif // CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ |
| OLD | NEW |