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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 1381003004: Better distinguish didFinishLoad and didStopLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix WebFrameTest.CallbackOrdering race Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index 5f45a76b68313a67735b697c458970034cd20b9c..1b0ece59a1a609bc1086afa2c1eb0aad8a902330 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -628,7 +628,6 @@ PasswordAutofillAgent::PasswordAutofillAgent(content::RenderFrame* render_frame)
logging_state_active_(false),
was_username_autofilled_(false),
was_password_autofilled_(false),
- did_stop_loading_(false),
weak_ptr_factory_(this) {
Send(new AutofillHostMsg_PasswordAutofillAgentConstructed(routing_id()));
}
@@ -1041,9 +1040,16 @@ void PasswordAutofillAgent::SendPasswordForms(bool only_visible) {
}
if (only_visible) {
- Send(new AutofillHostMsg_PasswordFormsRendered(routing_id(),
- password_forms,
- did_stop_loading_));
+ bool is_last_load = true;
+ for (blink::WebFrame* frame = render_frame()->GetWebFrame()->top(); frame;
+ frame = frame->traverseNext(false)) {
+ if (frame != render_frame()->GetWebFrame() && frame->isLoading()) {
+ is_last_load = false;
+ break;
+ }
+ }
+ Send(new AutofillHostMsg_PasswordFormsRendered(routing_id(), password_forms,
+ is_last_load));
} else {
Send(new AutofillHostMsg_PasswordFormsParsed(routing_id(), password_forms));
}
@@ -1089,14 +1095,6 @@ void PasswordAutofillAgent::DidCommitProvisionalLoad(
}
}
-void PasswordAutofillAgent::DidStartLoading() {
- did_stop_loading_ = false;
-}
-
-void PasswordAutofillAgent::DidStopLoading() {
- did_stop_loading_ = true;
-}
-
void PasswordAutofillAgent::FrameDetached() {
// If a sub frame has been destroyed while the user was entering information
// into a password form, try to save the data. See https://crbug.com/450806
@@ -1505,14 +1503,6 @@ void PasswordAutofillAgent::LegacyPasswordAutofillAgent::OnDestruct() {
// No op. Do not delete |this|.
}
-void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStartLoading() {
- agent_->DidStartLoading();
-}
-
-void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() {
- agent_->DidStopLoading();
-}
-
void PasswordAutofillAgent::LegacyPasswordAutofillAgent::
DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) {
agent_->LegacyDidStartProvisionalLoad(navigated_frame);

Powered by Google App Engine
This is Rietveld 408576698