| 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 #include "components/autofill/content/renderer/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" | 
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" | 
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" | 
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1023                               usernames_usage_, OTHER_POSSIBLE_USERNAMES_MAX); | 1023                               usernames_usage_, OTHER_POSSIBLE_USERNAMES_MAX); | 
| 1024     usernames_usage_ = NOTHING_TO_AUTOFILL; | 1024     usernames_usage_ = NOTHING_TO_AUTOFILL; | 
| 1025   } | 1025   } | 
| 1026 } | 1026 } | 
| 1027 | 1027 | 
| 1028 void PasswordAutofillAgent::DidStopLoading() { | 1028 void PasswordAutofillAgent::DidStopLoading() { | 
| 1029   did_stop_loading_ = true; | 1029   did_stop_loading_ = true; | 
| 1030 } | 1030 } | 
| 1031 | 1031 | 
| 1032 void PasswordAutofillAgent::FrameDetached() { | 1032 void PasswordAutofillAgent::FrameDetached() { | 
|  | 1033   // If a sub frame has been destroyed while the user was entering information | 
|  | 1034   // into a password form, try to save the data. See https://crbug.com/450806 | 
|  | 1035   // for examples of sites that perform login using this technique. | 
|  | 1036   if (render_frame()->GetWebFrame()->parent() && | 
|  | 1037       ProvisionallySavedPasswordIsValid()) { | 
|  | 1038     Send(new AutofillHostMsg_InPageNavigation(routing_id(), | 
|  | 1039                                               *provisionally_saved_form_)); | 
|  | 1040   } | 
| 1033   FrameClosing(); | 1041   FrameClosing(); | 
| 1034 } | 1042 } | 
| 1035 | 1043 | 
| 1036 void PasswordAutofillAgent::WillSendSubmitEvent( | 1044 void PasswordAutofillAgent::WillSendSubmitEvent( | 
| 1037     const blink::WebFormElement& form) { | 1045     const blink::WebFormElement& form) { | 
| 1038   // Forms submitted via XHR are not seen by WillSubmitForm if the default | 1046   // Forms submitted via XHR are not seen by WillSubmitForm if the default | 
| 1039   // onsubmit handler is overridden. Such submission first gets detected in | 1047   // onsubmit handler is overridden. Such submission first gets detected in | 
| 1040   // DidStartProvisionalLoad, which no longer knows about the particular form, | 1048   // DidStartProvisionalLoad, which no longer knows about the particular form, | 
| 1041   // and uses the candidate stored in |provisionally_saved_form_|. | 1049   // and uses the candidate stored in |provisionally_saved_form_|. | 
| 1042   // | 1050   // | 
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1425 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { | 1433 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { | 
| 1426   agent_->DidStopLoading(); | 1434   agent_->DidStopLoading(); | 
| 1427 } | 1435 } | 
| 1428 | 1436 | 
| 1429 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: | 1437 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: | 
| 1430     DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { | 1438     DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { | 
| 1431   agent_->LegacyDidStartProvisionalLoad(navigated_frame); | 1439   agent_->LegacyDidStartProvisionalLoad(navigated_frame); | 
| 1432 } | 1440 } | 
| 1433 | 1441 | 
| 1434 }  // namespace autofill | 1442 }  // namespace autofill | 
| OLD | NEW | 
|---|