| 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 30 matching lines...) Expand all Loading... |
| 41 const blink::WebKeyboardEvent& event); | 41 const blink::WebKeyboardEvent& event); |
| 42 | 42 |
| 43 // Fills the password associated with user name |username|. Returns true if | 43 // Fills the password associated with user name |username|. Returns true if |
| 44 // the username and password fields were filled, false otherwise. | 44 // the username and password fields were filled, false otherwise. |
| 45 bool DidAcceptAutofillSuggestion(const blink::WebNode& node, | 45 bool DidAcceptAutofillSuggestion(const blink::WebNode& node, |
| 46 const blink::WebString& username); | 46 const blink::WebString& username); |
| 47 // A no-op. Password forms are not previewed, so they do not need to be | 47 // A no-op. Password forms are not previewed, so they do not need to be |
| 48 // cleared when the selection changes. However, this method returns | 48 // cleared when the selection changes. However, this method returns |
| 49 // true when |node| is fillable by password Autofill. | 49 // true when |node| is fillable by password Autofill. |
| 50 bool DidClearAutofillSelection(const blink::WebNode& node); | 50 bool DidClearAutofillSelection(const blink::WebNode& node); |
| 51 // Shows an Autofill popup with username suggestions for |element|. | 51 // Shows an Autofill popup with username suggestions for |element|. If |
| 52 // |show_all| is |true|, will show all possible suggestions for that element, |
| 53 // otherwise shows suggestions based on current value of |element|. |
| 52 // Returns true if any suggestions were shown, false otherwise. | 54 // Returns true if any suggestions were shown, false otherwise. |
| 53 bool ShowSuggestions(const blink::WebInputElement& element); | 55 bool ShowSuggestions(const blink::WebInputElement& element, bool show_all); |
| 54 | 56 |
| 55 // Called when new form controls are inserted. | 57 // Called when new form controls are inserted. |
| 56 void OnDynamicFormsSeen(blink::WebFrame* frame); | 58 void OnDynamicFormsSeen(blink::WebFrame* frame); |
| 57 | 59 |
| 58 protected: | 60 protected: |
| 59 virtual bool OriginCanAccessPasswordManager( | 61 virtual bool OriginCanAccessPasswordManager( |
| 60 const blink::WebSecurityOrigin& origin); | 62 const blink::WebSecurityOrigin& origin); |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 friend class PasswordAutofillAgentTest; | 65 friend class PasswordAutofillAgentTest; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // RenderView IPC handlers: | 119 // RenderView IPC handlers: |
| 118 void OnFillPasswordForm(const PasswordFormFillData& form_data); | 120 void OnFillPasswordForm(const PasswordFormFillData& form_data); |
| 119 | 121 |
| 120 // Scans the given frame for password forms and sends them up to the browser. | 122 // Scans the given frame for password forms and sends them up to the browser. |
| 121 // If |only_visible| is true, only forms visible in the layout are sent. | 123 // If |only_visible| is true, only forms visible in the layout are sent. |
| 122 void SendPasswordForms(blink::WebFrame* frame, bool only_visible); | 124 void SendPasswordForms(blink::WebFrame* frame, bool only_visible); |
| 123 | 125 |
| 124 void GetSuggestions(const PasswordFormFillData& fill_data, | 126 void GetSuggestions(const PasswordFormFillData& fill_data, |
| 125 const base::string16& input, | 127 const base::string16& input, |
| 126 std::vector<base::string16>* suggestions, | 128 std::vector<base::string16>* suggestions, |
| 127 std::vector<base::string16>* realms); | 129 std::vector<base::string16>* realms, |
| 130 bool show_all); |
| 128 | 131 |
| 129 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, | 132 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, |
| 130 const blink::WebInputElement& user_input); | 133 const blink::WebInputElement& user_input, |
| 134 bool show_all); |
| 131 | 135 |
| 132 // Attempts to fill |username_element| and |password_element| with the | 136 // Attempts to fill |username_element| and |password_element| with the |
| 133 // |fill_data|. Will use the data corresponding to the preferred username, | 137 // |fill_data|. Will use the data corresponding to the preferred username, |
| 134 // unless the |username_element| already has a value set. In that case, | 138 // unless the |username_element| already has a value set. In that case, |
| 135 // attempts to fill the password matching the already filled username, if | 139 // attempts to fill the password matching the already filled username, if |
| 136 // such a password exists. | 140 // such a password exists. |
| 137 void FillFormOnPasswordRecieved(const PasswordFormFillData& fill_data, | 141 void FillFormOnPasswordRecieved(const PasswordFormFillData& fill_data, |
| 138 blink::WebInputElement username_element, | 142 blink::WebInputElement username_element, |
| 139 blink::WebInputElement password_element); | 143 blink::WebInputElement password_element); |
| 140 | 144 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 bool user_gesture_occurred_; | 192 bool user_gesture_occurred_; |
| 189 | 193 |
| 190 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; | 194 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
| 191 | 195 |
| 192 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); | 196 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
| 193 }; | 197 }; |
| 194 | 198 |
| 195 } // namespace autofill | 199 } // namespace autofill |
| 196 | 200 |
| 197 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 201 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| OLD | NEW |