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

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

Issue 414013003: Password autofill should not override explicitly typed password (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unused #includes Created 6 years, 4 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 | Annotate | Revision Log
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 OTHER_POSSIBLE_USERNAMES_PRESENT, 81 OTHER_POSSIBLE_USERNAMES_PRESENT,
82 OTHER_POSSIBLE_USERNAME_SHOWN, 82 OTHER_POSSIBLE_USERNAME_SHOWN,
83 OTHER_POSSIBLE_USERNAME_SELECTED, 83 OTHER_POSSIBLE_USERNAME_SELECTED,
84 OTHER_POSSIBLE_USERNAMES_MAX 84 OTHER_POSSIBLE_USERNAMES_MAX
85 }; 85 };
86 86
87 struct PasswordInfo { 87 struct PasswordInfo {
88 blink::WebInputElement password_field; 88 blink::WebInputElement password_field;
89 PasswordFormFillData fill_data; 89 PasswordFormFillData fill_data;
90 bool backspace_pressed_last; 90 bool backspace_pressed_last;
91 PasswordInfo() : backspace_pressed_last(false) {} 91 bool user_changed_password_more_recently_than_username;
92 PasswordInfo();
92 }; 93 };
93 typedef std::map<blink::WebElement, PasswordInfo> LoginToPasswordInfoMap; 94 typedef std::map<blink::WebElement, PasswordInfo> LoginToPasswordInfoMap;
95 typedef std::map<blink::WebElement, blink::WebElement> PasswordToLoginMap;
94 typedef std::map<blink::WebFrame*, 96 typedef std::map<blink::WebFrame*,
95 linked_ptr<PasswordForm> > FrameToPasswordFormMap; 97 linked_ptr<PasswordForm> > FrameToPasswordFormMap;
96 98
97 // This class holds a vector of autofilled password input elements and makes 99 // This class holds a vector of autofilled password input elements and makes
98 // sure the autofilled password value is not accessible to JavaScript code 100 // sure the autofilled password value is not accessible to JavaScript code
99 // until the user interacts with the page. 101 // until the user interacts with the page.
100 class PasswordValueGatekeeper { 102 class PasswordValueGatekeeper {
101 public: 103 public:
102 PasswordValueGatekeeper(); 104 PasswordValueGatekeeper();
103 ~PasswordValueGatekeeper(); 105 ~PasswordValueGatekeeper();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 void ClearPreview(blink::WebInputElement* username, 193 void ClearPreview(blink::WebInputElement* username,
192 blink::WebInputElement* password); 194 blink::WebInputElement* password);
193 195
194 // If |provisionally_saved_forms_| contains a form for |current_frame| or its 196 // If |provisionally_saved_forms_| contains a form for |current_frame| or its
195 // children, return such frame. 197 // children, return such frame.
196 blink::WebFrame* CurrentOrChildFrameWithSavedForms( 198 blink::WebFrame* CurrentOrChildFrameWithSavedForms(
197 const blink::WebFrame* current_frame); 199 const blink::WebFrame* current_frame);
198 200
199 // The logins we have filled so far with their associated info. 201 // The logins we have filled so far with their associated info.
200 LoginToPasswordInfoMap login_to_password_info_; 202 LoginToPasswordInfoMap login_to_password_info_;
203 PasswordToLoginMap password_to_username_;
201 204
202 // Used for UMA stats. 205 // Used for UMA stats.
203 OtherPossibleUsernamesUsage usernames_usage_; 206 OtherPossibleUsernamesUsage usernames_usage_;
204 207
205 // Pointer to the WebView. Used to access page scale factor. 208 // Pointer to the WebView. Used to access page scale factor.
206 blink::WebView* web_view_; 209 blink::WebView* web_view_;
207 210
208 // Set if the user might be submitting a password form on the current page, 211 // Set if the user might be submitting a password form on the current page,
209 // but the submit may still fail (i.e. doesn't pass JavaScript validation). 212 // but the submit may still fail (i.e. doesn't pass JavaScript validation).
210 FrameToPasswordFormMap provisionally_saved_forms_; 213 FrameToPasswordFormMap provisionally_saved_forms_;
(...skipping 16 matching lines...) Expand all
227 bool did_stop_loading_; 230 bool did_stop_loading_;
228 231
229 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; 232 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
230 233
231 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); 234 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
232 }; 235 };
233 236
234 } // namespace autofill 237 } // namespace autofill
235 238
236 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 239 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698