Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: components/autofill/content/renderer/password_generation_agent.cc

Issue 2048603002: [Password Generation] Handle DidFinishLoad event in PasswordGenerationAgent as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/autofill/content/renderer/password_generation_agent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (editing_popup_shown_) { 172 if (editing_popup_shown_) {
173 password_generation::LogPasswordGenerationEvent( 173 password_generation::LogPasswordGenerationEvent(
174 password_generation::EDITING_POPUP_SHOWN); 174 password_generation::EDITING_POPUP_SHOWN);
175 } 175 }
176 editing_popup_shown_ = false; 176 editing_popup_shown_ = false;
177 } 177 }
178 178
179 FindPossibleGenerationForm(); 179 FindPossibleGenerationForm();
180 } 180 }
181 181
182 void PasswordGenerationAgent::DidFinishLoad() {
183 // Since forms on some sites are available only at this event (but not at
184 // DidFinishDocumentLoad), again call FindPossibleGenerationForm to detect
185 // these forms (crbug.com/617893).
186 FindPossibleGenerationForm();
187 }
188
182 void PasswordGenerationAgent::OnDestruct() { 189 void PasswordGenerationAgent::OnDestruct() {
183 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); 190 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
184 } 191 }
185 192
186 void PasswordGenerationAgent::OnDynamicFormsSeen() { 193 void PasswordGenerationAgent::OnDynamicFormsSeen() {
187 FindPossibleGenerationForm(); 194 FindPossibleGenerationForm();
188 } 195 }
189 196
190 void PasswordGenerationAgent::FindPossibleGenerationForm() { 197 void PasswordGenerationAgent::FindPossibleGenerationForm() {
191 if (!enabled_ || !render_frame()) 198 if (!enabled_ || !render_frame())
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 GetAccountCreationPasswordFields(control_elements, &password_elements); 554 GetAccountCreationPasswordFields(control_elements, &password_elements);
548 password_elements = FindPasswordElementsForGeneration( 555 password_elements = FindPasswordElementsForGeneration(
549 password_elements, last_focused_password_element_.nameForAutofill()); 556 password_elements, last_focused_password_element_.nameForAutofill());
550 generation_form_data_.reset(new AccountCreationFormData( 557 generation_form_data_.reset(new AccountCreationFormData(
551 make_linked_ptr(password_form.release()), password_elements)); 558 make_linked_ptr(password_form.release()), password_elements));
552 is_manually_triggered_ = true; 559 is_manually_triggered_ = true;
553 ShowGenerationPopup(); 560 ShowGenerationPopup();
554 } 561 }
555 562
556 } // namespace autofill 563 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/password_generation_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698