| 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(); | |
| 194 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 193 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 195 } | 194 } |
| 196 | 195 |
| 197 void PasswordGenerationAgent::OnDynamicFormsSeen() { | 196 void PasswordGenerationAgent::OnDynamicFormsSeen() { |
| 198 FindPossibleGenerationForm(); | 197 FindPossibleGenerationForm(); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void PasswordGenerationAgent::OnAllowToRunFormClassifier() { | 200 void PasswordGenerationAgent::OnAllowToRunFormClassifier() { |
| 202 form_classifier_enabled_ = true; | 201 form_classifier_enabled_ = true; |
| 203 } | 202 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 GetAccountCreationPasswordFields(control_elements, &password_elements); | 576 GetAccountCreationPasswordFields(control_elements, &password_elements); |
| 578 password_elements = FindPasswordElementsForGeneration( | 577 password_elements = FindPasswordElementsForGeneration( |
| 579 password_elements, last_focused_password_element_.nameForAutofill()); | 578 password_elements, last_focused_password_element_.nameForAutofill()); |
| 580 generation_form_data_.reset(new AccountCreationFormData( | 579 generation_form_data_.reset(new AccountCreationFormData( |
| 581 make_linked_ptr(password_form.release()), password_elements)); | 580 make_linked_ptr(password_form.release()), password_elements)); |
| 582 is_manually_triggered_ = true; | 581 is_manually_triggered_ = true; |
| 583 ShowGenerationPopup(); | 582 ShowGenerationPopup(); |
| 584 } | 583 } |
| 585 | 584 |
| 586 } // namespace autofill | 585 } // namespace autofill |
| OLD | NEW |