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_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Previews the username and password fields of this form with the given | 47 // Previews the username and password fields of this form with the given |
48 // values. Returns true if the fields were previewed, false otherwise. | 48 // values. Returns true if the fields were previewed, false otherwise. |
49 bool PreviewSuggestion(const blink::WebNode& node, | 49 bool PreviewSuggestion(const blink::WebNode& node, |
50 const blink::WebString& username, | 50 const blink::WebString& username, |
51 const blink::WebString& password); | 51 const blink::WebString& password); |
52 | 52 |
53 // Clears the preview for the username and password fields, restoring both to | 53 // Clears the preview for the username and password fields, restoring both to |
54 // their previous filled state. Return false if no login information was | 54 // their previous filled state. Return false if no login information was |
55 // found for the form. | 55 // found for the form. |
56 bool DidClearAutofillSelection(const blink::WebNode& node); | 56 bool DidClearAutofillSelection(const blink::WebNode& node); |
57 // Shows an Autofill popup with username suggestions for |element|. | 57 // Shows an Autofill popup with username suggestions for |element|. If |
| 58 // |show_all| is |true|, will show all possible suggestions for that element, |
| 59 // otherwise shows suggestions based on current value of |element|. |
58 // Returns true if any suggestions were shown, false otherwise. | 60 // Returns true if any suggestions were shown, false otherwise. |
59 bool ShowSuggestions(const blink::WebInputElement& element); | 61 bool ShowSuggestions(const blink::WebInputElement& element, bool show_all); |
60 | 62 |
61 // Called when new form controls are inserted. | 63 // Called when new form controls are inserted. |
62 void OnDynamicFormsSeen(blink::WebFrame* frame); | 64 void OnDynamicFormsSeen(blink::WebFrame* frame); |
63 | 65 |
64 // Called when the user first interacts with the page after a load. This is a | 66 // Called when the user first interacts with the page after a load. This is a |
65 // signal to make autofilled values of password input elements accessible to | 67 // signal to make autofilled values of password input elements accessible to |
66 // JavaScript. | 68 // JavaScript. |
67 void FirstUserGestureObserved(); | 69 void FirstUserGestureObserved(); |
68 | 70 |
69 protected: | 71 protected: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 void OnFillPasswordForm(const PasswordFormFillData& form_data); | 141 void OnFillPasswordForm(const PasswordFormFillData& form_data); |
140 void OnSetLoggingState(bool active); | 142 void OnSetLoggingState(bool active); |
141 | 143 |
142 // Scans the given frame for password forms and sends them up to the browser. | 144 // Scans the given frame for password forms and sends them up to the browser. |
143 // If |only_visible| is true, only forms visible in the layout are sent. | 145 // If |only_visible| is true, only forms visible in the layout are sent. |
144 void SendPasswordForms(blink::WebFrame* frame, bool only_visible); | 146 void SendPasswordForms(blink::WebFrame* frame, bool only_visible); |
145 | 147 |
146 void GetSuggestions(const PasswordFormFillData& fill_data, | 148 void GetSuggestions(const PasswordFormFillData& fill_data, |
147 const base::string16& input, | 149 const base::string16& input, |
148 std::vector<base::string16>* suggestions, | 150 std::vector<base::string16>* suggestions, |
149 std::vector<base::string16>* realms); | 151 std::vector<base::string16>* realms, |
| 152 bool show_all); |
150 | 153 |
151 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, | 154 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, |
152 const blink::WebInputElement& user_input); | 155 const blink::WebInputElement& user_input, |
| 156 bool show_all); |
153 | 157 |
154 // Attempts to fill |username_element| and |password_element| with the | 158 // Attempts to fill |username_element| and |password_element| with the |
155 // |fill_data|. Will use the data corresponding to the preferred username, | 159 // |fill_data|. Will use the data corresponding to the preferred username, |
156 // unless the |username_element| already has a value set. In that case, | 160 // unless the |username_element| already has a value set. In that case, |
157 // attempts to fill the password matching the already filled username, if | 161 // attempts to fill the password matching the already filled username, if |
158 // such a password exists. | 162 // such a password exists. |
159 void FillFormOnPasswordRecieved(const PasswordFormFillData& fill_data, | 163 void FillFormOnPasswordRecieved(const PasswordFormFillData& fill_data, |
160 blink::WebInputElement username_element, | 164 blink::WebInputElement username_element, |
161 blink::WebInputElement password_element); | 165 blink::WebInputElement password_element); |
162 | 166 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 bool did_stop_loading_; | 227 bool did_stop_loading_; |
224 | 228 |
225 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; | 229 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
226 | 230 |
227 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); | 231 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
228 }; | 232 }; |
229 | 233 |
230 } // namespace autofill | 234 } // namespace autofill |
231 | 235 |
232 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 236 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
OLD | NEW |