OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/autofill/password_autofill_manager.h" | |
13 #include "webkit/forms/form_data.h" | 14 #include "webkit/forms/form_data.h" |
14 #include "webkit/forms/form_field.h" | 15 #include "webkit/forms/form_field.h" |
16 #include "webkit/forms/password_form_dom_manager.h" | |
15 | 17 |
16 class AutofillManager; | 18 class AutofillManager; |
17 class TabContentsWrapper; | 19 class TabContentsWrapper; |
18 | 20 |
19 namespace gfx { | 21 namespace gfx { |
20 class Rect; | 22 class Rect; |
21 } | 23 } |
22 | 24 |
23 // TODO(csharp): A lot of the logic in this class is copied from autofillagent. | 25 // TODO(csharp): A lot of the logic in this class is copied from autofillagent. |
24 // Once Autofill is moved out of WebKit this class should be the only home for | 26 // Once Autofill is moved out of WebKit this class should be the only home for |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 void DidAcceptAutofillSuggestions(const string16& value, | 67 void DidAcceptAutofillSuggestions(const string16& value, |
66 int unique_id, | 68 int unique_id, |
67 unsigned index); | 69 unsigned index); |
68 | 70 |
69 // Informs the delegate that the Autofill previewed form should be cleared. | 71 // Informs the delegate that the Autofill previewed form should be cleared. |
70 virtual void ClearPreviewedForm(); | 72 virtual void ClearPreviewedForm(); |
71 | 73 |
72 // Hide the Autofill poup. | 74 // Hide the Autofill poup. |
73 virtual void HideAutofillPopup(); | 75 virtual void HideAutofillPopup(); |
74 | 76 |
77 // Inform the Password Manager of a closing frame. | |
78 void FrameClosing(); | |
79 | |
80 // Inform the Password Manager of a filled form. | |
81 void PasswordFormMapping( | |
Ilya Sherman
2012/03/09 22:00:26
nit: Perhaps "AddPasswordFormMapping"?
csharp
2012/03/12 15:11:56
Done.
| |
82 const webkit::forms::FormField& form, | |
83 const webkit::forms::PasswordFormFillData& fill_data); | |
84 | |
75 // Platforms that wish to implement an external Autofill delegate | 85 // Platforms that wish to implement an external Autofill delegate |
76 // MUST implement this. The 1st arg is the tab contents that owns | 86 // MUST implement this. The 1st arg is the tab contents that owns |
77 // this delegate; the second is the Autofill manager owned by the | 87 // this delegate; the second is the Autofill manager owned by the |
78 // tab contents. | 88 // tab contents. |
79 static AutofillExternalDelegate* Create(TabContentsWrapper*, | 89 static AutofillExternalDelegate* Create(TabContentsWrapper*, |
80 AutofillManager*); | 90 AutofillManager*); |
81 protected: | 91 protected: |
82 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper, | 92 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper, |
83 AutofillManager* autofill_manager); | 93 AutofillManager* autofill_manager); |
84 | 94 |
(...skipping 19 matching lines...) Expand all Loading... | |
104 private: | 114 private: |
105 // Fills the form with the Autofill data corresponding to |unique_id|. | 115 // Fills the form with the Autofill data corresponding to |unique_id|. |
106 // If |is_preview| is true then this is just a preview to show the user what | 116 // If |is_preview| is true then this is just a preview to show the user what |
107 // would be selected and if |is_preview| is false then the user has selected | 117 // would be selected and if |is_preview| is false then the user has selected |
108 // this data. | 118 // this data. |
109 void FillAutofillFormData(int unique_id, bool is_preview); | 119 void FillAutofillFormData(int unique_id, bool is_preview); |
110 | 120 |
111 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. | 121 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. |
112 AutofillManager* autofill_manager_; // weak. | 122 AutofillManager* autofill_manager_; // weak. |
113 | 123 |
124 // Password Autofill manager, handles all password related Autofilling. | |
125 PasswordAutofillManager password_autofill_manager_; | |
126 | |
114 // The ID of the last request sent for form field Autofill. Used to ignore | 127 // The ID of the last request sent for form field Autofill. Used to ignore |
115 // out of date responses. | 128 // out of date responses. |
116 int autofill_query_id_; | 129 int autofill_query_id_; |
117 | 130 |
118 // The current form and field selected by Autofill. | 131 // The current form and field selected by Autofill. |
119 webkit::forms::FormData autofill_query_form_; | 132 webkit::forms::FormData autofill_query_form_; |
120 webkit::forms::FormField autofill_query_field_; | 133 webkit::forms::FormField autofill_query_field_; |
121 | 134 |
122 // Should we display a warning if Autofill is disabled? | 135 // Should we display a warning if Autofill is disabled? |
123 bool display_warning_if_disabled_; | 136 bool display_warning_if_disabled_; |
124 | 137 |
125 // Have we already shown Autofill suggestions for the field the user is | 138 // Have we already shown Autofill suggestions for the field the user is |
126 // currently editing? Used to keep track of state for metrics logging. | 139 // currently editing? Used to keep track of state for metrics logging. |
127 bool has_shown_autofill_popup_for_current_edit_; | 140 bool has_shown_autofill_popup_for_current_edit_; |
128 | 141 |
129 // The menu index of the "Clear" menu item. | 142 // The menu index of the "Clear" menu item. |
130 int suggestions_clear_index_; | 143 int suggestions_clear_index_; |
131 | 144 |
132 // The menu index of the "Autofill options..." menu item. | 145 // The menu index of the "Autofill options..." menu item. |
133 int suggestions_options_index_; | 146 int suggestions_options_index_; |
134 | 147 |
135 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | 148 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
136 }; | 149 }; |
137 | 150 |
138 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 151 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
OLD | NEW |