Index: components/autofill/content/renderer/password_autofill_agent.h |
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h |
index 17ae4831fe58a5aec23fe2598aa329f18ea330f7..630f07bcdecac5324a494856ca2537a2166d39ca 100644 |
--- a/components/autofill/content/renderer/password_autofill_agent.h |
+++ b/components/autofill/content/renderer/password_autofill_agent.h |
@@ -38,9 +38,14 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
bool TextFieldHandlingKeyDown(const blink::WebInputElement& element, |
const blink::WebKeyboardEvent& event); |
+ // Preview the password associated with user name |username|. Returns true if |
+ // the username and password fields were previewed, false otherwise. |
+ bool DidSelectSuggestion(const blink::WebNode& node, |
+ const blink::WebString& username); |
+ |
// Fills the password associated with user name |username|. Returns true if |
// the username and password fields were filled, false otherwise. |
- bool DidAcceptAutofillSuggestion(const blink::WebNode& node, |
+ bool DidAcceptSuggestion(const blink::WebNode& node, |
const blink::WebString& username); |
// A no-op. Password forms are not previewed, so they do not need to be |
// cleared when the selection changes. However, this method returns |
@@ -49,6 +54,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
// Shows an Autofill popup with username suggestions for |element|. |
// Returns true if any suggestions were shown, false otherwise. |
bool ShowSuggestions(const blink::WebInputElement& element); |
+ // Return true if password was autofilled before previewing the form. |
+ bool WasPasswordAutofilled(); |
+ // Return true if password is previewed. |
+ bool IsPasswordPreviewed(); |
// Called when new form controls are inserted. |
void OnDynamicFormsSeen(blink::WebFrame* frame); |
@@ -146,7 +155,19 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
blink::WebInputElement username_element, |
blink::WebInputElement password_element); |
- bool FillUserNameAndPassword( |
+ void FindUserNameAndPassword(base::string16 current_username, |
+ base::string16* username, |
+ base::string16* password, |
+ const PasswordFormFillData& fill_data, |
+ bool exact_username_match); |
+ |
+ bool FillUserNameAndPassword(blink::WebInputElement* username_element, |
+ blink::WebInputElement* password_element, |
+ const PasswordFormFillData& fill_data, |
+ bool exact_username_match, |
+ bool set_selection); |
+ |
+ bool PreviewUserNameAndPassword( |
blink::WebInputElement* username_element, |
blink::WebInputElement* password_element, |
const PasswordFormFillData& fill_data, |
@@ -189,6 +210,9 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
PasswordValueGatekeeper gatekeeper_; |
+ bool was_password_autofilled_; |
+ bool is_password_previewed_; |
+ |
base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |