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

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

Issue 2833193002: Trigger Password Protection ping on username/password field on focus (Closed)
Patch Set: nit Created 3 years, 7 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 <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool PreviewSuggestion(const blink::WebFormControlElement& node, 81 bool PreviewSuggestion(const blink::WebFormControlElement& node,
82 const blink::WebString& username, 82 const blink::WebString& username,
83 const blink::WebString& password); 83 const blink::WebString& password);
84 84
85 // Clears the preview for the username and password fields, restoring both to 85 // Clears the preview for the username and password fields, restoring both to
86 // their previous filled state. Return false if no login information was 86 // their previous filled state. Return false if no login information was
87 // found for the form. 87 // found for the form.
88 bool DidClearAutofillSelection( 88 bool DidClearAutofillSelection(
89 const blink::WebFormControlElement& control_element); 89 const blink::WebFormControlElement& control_element);
90 90
91 // If the form is non-secure, show the "Not Secure" warning on username and 91 // Returns whether a "Login not secure" warning should be shown on the input
92 // password input fields. 92 // field. This is true if the feature is enabled and if the form is
93 // non-secure.
93 bool ShouldShowNotSecureWarning(const blink::WebInputElement& element); 94 bool ShouldShowNotSecureWarning(const blink::WebInputElement& element);
94 95
96 // Returns whether the element is a username or password textfield.
97 bool IsUsernameOrPasswordField(const blink::WebInputElement& element);
98
95 // Shows an Autofill popup with username suggestions for |element|. If 99 // Shows an Autofill popup with username suggestions for |element|. If
96 // |show_all| is |true|, will show all possible suggestions for that element, 100 // |show_all| is |true|, will show all possible suggestions for that element,
97 // otherwise shows suggestions based on current value of |element|. 101 // otherwise shows suggestions based on current value of |element|.
98 // If |generation_popup_showing| is true, this function will return false 102 // If |generation_popup_showing| is true, this function will return false
99 // as both UIs should not be shown at the same time. This function should 103 // as both UIs should not be shown at the same time. This function should
100 // still be called in this situation so that UMA stats can be logged. 104 // still be called in this situation so that UMA stats can be logged.
101 // Returns true if any suggestions were shown, false otherwise. 105 // Returns true if any suggestions were shown, false otherwise.
102 bool ShowSuggestions(const blink::WebInputElement& element, 106 bool ShowSuggestions(const blink::WebInputElement& element,
103 bool show_all, 107 bool show_all,
104 bool generation_popup_showing); 108 bool generation_popup_showing);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool logging_state_active_; 283 bool logging_state_active_;
280 284
281 // True indicates that the username field was autofilled, false otherwise. 285 // True indicates that the username field was autofilled, false otherwise.
282 bool was_username_autofilled_; 286 bool was_username_autofilled_;
283 // True indicates that the password field was autofilled, false otherwise. 287 // True indicates that the password field was autofilled, false otherwise.
284 bool was_password_autofilled_; 288 bool was_password_autofilled_;
285 289
286 // True indicates that a request for credentials has been sent to the store. 290 // True indicates that a request for credentials has been sent to the store.
287 bool sent_request_to_store_; 291 bool sent_request_to_store_;
288 292
293 // True indicates that a safe browsing reputation check has been triggered.
294 bool checked_safe_browsing_reputation_;
295
289 // Records the username typed before suggestions preview. 296 // Records the username typed before suggestions preview.
290 base::string16 username_query_prefix_; 297 base::string16 username_query_prefix_;
291 298
292 // Contains server predictions for username, password and/or new password 299 // Contains server predictions for username, password and/or new password
293 // fields for individual forms. 300 // fields for individual forms.
294 FormsPredictionsMap form_predictions_; 301 FormsPredictionsMap form_predictions_;
295 302
296 AutofillAgent* autofill_agent_; // Weak reference. 303 AutofillAgent* autofill_agent_; // Weak reference.
297 304
298 mojom::PasswordManagerDriverPtr password_manager_driver_; 305 mojom::PasswordManagerDriverPtr password_manager_driver_;
299 306
300 mojo::Binding<mojom::PasswordAutofillAgent> binding_; 307 mojo::Binding<mojom::PasswordAutofillAgent> binding_;
301 308
302 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); 309 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
303 }; 310 };
304 311
305 } // namespace autofill 312 } // namespace autofill
306 313
307 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 314 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698