Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.h

Issue 1002653002: [Password Manager] Use XHR completion as a possible signal for form submission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // Shows an Autofill popup with username suggestions for |element|. If 58 // Shows an Autofill popup with username suggestions for |element|. If
59 // |show_all| is |true|, will show all possible suggestions for that element, 59 // |show_all| is |true|, will show all possible suggestions for that element,
60 // otherwise shows suggestions based on current value of |element|. 60 // otherwise shows suggestions based on current value of |element|.
61 // Returns true if any suggestions were shown, false otherwise. 61 // Returns true if any suggestions were shown, false otherwise.
62 bool ShowSuggestions(const blink::WebInputElement& element, bool show_all); 62 bool ShowSuggestions(const blink::WebInputElement& element, bool show_all);
63 63
64 // Called when new form controls are inserted. 64 // Called when new form controls are inserted.
65 void OnDynamicFormsSeen(); 65 void OnDynamicFormsSeen();
66 66
67 void OnFormElementsRemoved(const blink::WebVector<blink::WebNode>& nodes);
68
67 // Called when the user first interacts with the page after a load. This is a 69 // Called when the user first interacts with the page after a load. This is a
68 // signal to make autofilled values of password input elements accessible to 70 // signal to make autofilled values of password input elements accessible to
69 // JavaScript. 71 // JavaScript.
70 void FirstUserGestureObserved(); 72 void FirstUserGestureObserved();
71 73
74 void XHRSucceeded();
75
72 protected: 76 protected:
73 virtual bool OriginCanAccessPasswordManager( 77 virtual bool OriginCanAccessPasswordManager(
74 const blink::WebSecurityOrigin& origin); 78 const blink::WebSecurityOrigin& origin);
75 79
76 private: 80 private:
77 enum OtherPossibleUsernamesUsage { 81 enum OtherPossibleUsernamesUsage {
78 NOTHING_TO_AUTOFILL, 82 NOTHING_TO_AUTOFILL,
79 OTHER_POSSIBLE_USERNAMES_ABSENT, 83 OTHER_POSSIBLE_USERNAMES_ABSENT,
80 OTHER_POSSIBLE_USERNAMES_PRESENT, 84 OTHER_POSSIBLE_USERNAMES_PRESENT,
81 OTHER_POSSIBLE_USERNAME_SHOWN, 85 OTHER_POSSIBLE_USERNAME_SHOWN,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // Clears the preview for the username and password fields, restoring both to 223 // Clears the preview for the username and password fields, restoring both to
220 // their previous filled state. 224 // their previous filled state.
221 void ClearPreview(blink::WebInputElement* username, 225 void ClearPreview(blink::WebInputElement* username,
222 blink::WebInputElement* password); 226 blink::WebInputElement* password);
223 227
224 // Extracts a PasswordForm from |form| and saves it as 228 // Extracts a PasswordForm from |form| and saves it as
225 // |provisionally_saved_form_|, as long as it satisfies |restriction|. 229 // |provisionally_saved_form_|, as long as it satisfies |restriction|.
226 void ProvisionallySavePassword(const blink::WebFormElement& form, 230 void ProvisionallySavePassword(const blink::WebFormElement& form,
227 ProvisionallySaveRestriction restriction); 231 ProvisionallySaveRestriction restriction);
228 232
233 // Returns true if
234 bool ProvisionallySavedPasswordIsValid();
235
229 // Passes through |RenderViewObserver| method to |this|. 236 // Passes through |RenderViewObserver| method to |this|.
230 LegacyPasswordAutofillAgent legacy_; 237 LegacyPasswordAutofillAgent legacy_;
231 238
232 // The logins we have filled so far with their associated info. 239 // The logins we have filled so far with their associated info.
233 LoginToPasswordInfoMap login_to_password_info_; 240 LoginToPasswordInfoMap login_to_password_info_;
234 // And the keys under which PasswordAutofillManager can find the same info. 241 // And the keys under which PasswordAutofillManager can find the same info.
235 LoginToPasswordInfoKeyMap login_to_password_info_key_; 242 LoginToPasswordInfoKeyMap login_to_password_info_key_;
236 // A (sort-of) reverse map to |login_to_password_info_|. 243 // A (sort-of) reverse map to |login_to_password_info_|.
237 PasswordToLoginMap password_to_username_; 244 PasswordToLoginMap password_to_username_;
238 245
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 bool save_password_on_in_page_navigation_; 277 bool save_password_on_in_page_navigation_;
271 278
272 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; 279 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
273 280
274 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); 281 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
275 }; 282 };
276 283
277 } // namespace autofill 284 } // namespace autofill
278 285
279 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 286 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698