| 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 <memory> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "components/autofill/content/renderer/password_form_conversion_utils.h" | 14 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
| 15 #include "components/autofill/core/common/form_data_predictions.h" | 15 #include "components/autofill/core/common/form_data_predictions.h" |
| 16 #include "components/autofill/core/common/password_form_field_prediction_map.h" | 16 #include "components/autofill/core/common/password_form_field_prediction_map.h" |
| 17 #include "components/autofill/core/common/password_form_fill_data.h" | 17 #include "components/autofill/core/common/password_form_fill_data.h" |
| 18 #include "content/public/renderer/render_frame_observer.h" | 18 #include "content/public/renderer/render_frame_observer.h" |
| 19 #include "content/public/renderer/render_view_observer.h" | 19 #include "content/public/renderer/render_view_observer.h" |
| 20 #include "third_party/WebKit/public/web/WebInputElement.h" | 20 #include "third_party/WebKit/public/web/WebInputElement.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 blink::WebInputElement* found_input, | 195 blink::WebInputElement* found_input, |
| 196 PasswordInfo** found_password); | 196 PasswordInfo** found_password); |
| 197 | 197 |
| 198 // Clears the preview for the username and password fields, restoring both to | 198 // Clears the preview for the username and password fields, restoring both to |
| 199 // their previous filled state. | 199 // their previous filled state. |
| 200 void ClearPreview(blink::WebInputElement* username, | 200 void ClearPreview(blink::WebInputElement* username, |
| 201 blink::WebInputElement* password); | 201 blink::WebInputElement* password); |
| 202 | 202 |
| 203 // Saves |password_form| in |provisionally_saved_form_|, as long as it | 203 // Saves |password_form| in |provisionally_saved_form_|, as long as it |
| 204 // satisfies |restriction|. | 204 // satisfies |restriction|. |
| 205 void ProvisionallySavePassword(scoped_ptr<PasswordForm> password_form, | 205 void ProvisionallySavePassword(std::unique_ptr<PasswordForm> password_form, |
| 206 ProvisionallySaveRestriction restriction); | 206 ProvisionallySaveRestriction restriction); |
| 207 | 207 |
| 208 // Returns true if |provisionally_saved_form_| has enough information that | 208 // Returns true if |provisionally_saved_form_| has enough information that |
| 209 // it is likely filled out. | 209 // it is likely filled out. |
| 210 bool ProvisionallySavedPasswordIsValid(); | 210 bool ProvisionallySavedPasswordIsValid(); |
| 211 | 211 |
| 212 // Helper function called when in-page navigation completed | 212 // Helper function called when in-page navigation completed |
| 213 void OnSamePageNavigationCompleted(); | 213 void OnSamePageNavigationCompleted(); |
| 214 | 214 |
| 215 // The logins we have filled so far with their associated info. | 215 // The logins we have filled so far with their associated info. |
| 216 WebInputToPasswordInfoMap web_input_to_password_info_; | 216 WebInputToPasswordInfoMap web_input_to_password_info_; |
| 217 // And the keys under which PasswordAutofillManager can find the same info. | 217 // And the keys under which PasswordAutofillManager can find the same info. |
| 218 WebElementToPasswordInfoKeyMap web_element_to_password_info_key_; | 218 WebElementToPasswordInfoKeyMap web_element_to_password_info_key_; |
| 219 // A (sort-of) reverse map to |login_to_password_info_|. | 219 // A (sort-of) reverse map to |login_to_password_info_|. |
| 220 PasswordToLoginMap password_to_username_; | 220 PasswordToLoginMap password_to_username_; |
| 221 | 221 |
| 222 // Set if the user might be submitting a password form on the current page, | 222 // Set if the user might be submitting a password form on the current page, |
| 223 // but the submit may still fail (i.e. doesn't pass JavaScript validation). | 223 // but the submit may still fail (i.e. doesn't pass JavaScript validation). |
| 224 scoped_ptr<PasswordForm> provisionally_saved_form_; | 224 std::unique_ptr<PasswordForm> provisionally_saved_form_; |
| 225 | 225 |
| 226 // Contains the most recent text that user typed or PasswordManager autofilled | 226 // Contains the most recent text that user typed or PasswordManager autofilled |
| 227 // in input elements. Used for storing username/password before JavaScript | 227 // in input elements. Used for storing username/password before JavaScript |
| 228 // changes them. | 228 // changes them. |
| 229 ModifiedValues nonscript_modified_values_; | 229 ModifiedValues nonscript_modified_values_; |
| 230 | 230 |
| 231 PasswordValueGatekeeper gatekeeper_; | 231 PasswordValueGatekeeper gatekeeper_; |
| 232 | 232 |
| 233 // True indicates that user debug information should be logged. | 233 // True indicates that user debug information should be logged. |
| 234 bool logging_state_active_; | 234 bool logging_state_active_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 246 FormsPredictionsMap form_predictions_; | 246 FormsPredictionsMap form_predictions_; |
| 247 | 247 |
| 248 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; | 248 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
| 249 | 249 |
| 250 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); | 250 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 } // namespace autofill | 253 } // namespace autofill |
| 254 | 254 |
| 255 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 255 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| OLD | NEW |