| 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_generation_agent.h" | 5 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 void PasswordGenerationAgent::DidFinishLoad() { | 185 void PasswordGenerationAgent::DidFinishLoad() { |
| 186 // Since forms on some sites are available only at this event (but not at | 186 // Since forms on some sites are available only at this event (but not at |
| 187 // DidFinishDocumentLoad), again call FindPossibleGenerationForm to detect | 187 // DidFinishDocumentLoad), again call FindPossibleGenerationForm to detect |
| 188 // these forms (crbug.com/617893). | 188 // these forms (crbug.com/617893). |
| 189 FindPossibleGenerationForm(); | 189 FindPossibleGenerationForm(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void PasswordGenerationAgent::OnDestruct() { | 192 void PasswordGenerationAgent::OnDestruct() { |
| 193 binding_.Close(); |
| 193 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 194 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void PasswordGenerationAgent::OnDynamicFormsSeen() { | 197 void PasswordGenerationAgent::OnDynamicFormsSeen() { |
| 197 FindPossibleGenerationForm(); | 198 FindPossibleGenerationForm(); |
| 198 } | 199 } |
| 199 | 200 |
| 200 void PasswordGenerationAgent::OnAllowToRunFormClassifier() { | 201 void PasswordGenerationAgent::OnAllowToRunFormClassifier() { |
| 201 form_classifier_enabled_ = true; | 202 form_classifier_enabled_ = true; |
| 202 } | 203 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 GetAccountCreationPasswordFields(control_elements, &password_elements); | 577 GetAccountCreationPasswordFields(control_elements, &password_elements); |
| 577 password_elements = FindPasswordElementsForGeneration( | 578 password_elements = FindPasswordElementsForGeneration( |
| 578 password_elements, last_focused_password_element_.nameForAutofill()); | 579 password_elements, last_focused_password_element_.nameForAutofill()); |
| 579 generation_form_data_.reset(new AccountCreationFormData( | 580 generation_form_data_.reset(new AccountCreationFormData( |
| 580 make_linked_ptr(password_form.release()), password_elements)); | 581 make_linked_ptr(password_form.release()), password_elements)); |
| 581 is_manually_triggered_ = true; | 582 is_manually_triggered_ = true; |
| 582 ShowGenerationPopup(); | 583 ShowGenerationPopup(); |
| 583 } | 584 } |
| 584 | 585 |
| 585 } // namespace autofill | 586 } // namespace autofill |
| OLD | NEW |