Chromium Code Reviews| Index: components/autofill/renderer/autofill_agent.cc |
| diff --git a/components/autofill/renderer/autofill_agent.cc b/components/autofill/renderer/autofill_agent.cc |
| index 355b4bfb764f76331075f73082812f301a3be1e6..1e984025e090c3c27835f4ed39790c52b4a20d88 100644 |
| --- a/components/autofill/renderer/autofill_agent.cc |
| +++ b/components/autofill/renderer/autofill_agent.cc |
| @@ -219,13 +219,7 @@ void AutofillAgent::DidFinishDocumentLoad(WebFrame* frame) { |
| void AutofillAgent::DidStartProvisionalLoad(WebFrame* frame) { |
| if (!frame->parent()) { |
| topmost_frame_ = NULL; |
| - WebKit::WebURL provisional_url = |
| - frame->provisionalDataSource()->request().url(); |
| - WebKit::WebURL current_url = frame->dataSource()->request().url(); |
| - // If the URL of the topmost frame is changing and the current page is part |
| - // of an Autocheckout flow, the click was successful as long as the |
| - // provisional load is committed. |
| - if (provisional_url != current_url && click_timer_.IsRunning()) { |
|
Ilya Sherman
2013/03/27 22:27:21
Hmm, why is this check no longer relevant?
Ilya Sherman
2013/03/27 22:35:09
Per IM discussion, this is now handled on the brow
|
| + if (click_timer_.IsRunning()) { |
| click_timer_.Stop(); |
| autocheckout_click_in_progress_ = true; |
| } |
| @@ -234,7 +228,7 @@ void AutofillAgent::DidStartProvisionalLoad(WebFrame* frame) { |
| void AutofillAgent::DidFailProvisionalLoad(WebFrame* frame, |
| const WebKit::WebURLError& error) { |
| - if (autocheckout_click_in_progress_) { |
| + if (!frame->parent() && autocheckout_click_in_progress_) { |
|
Ilya Sherman
2013/03/27 22:27:21
How do you know that all clicks in Autocheckout wi
ahutter
2013/03/27 22:41:45
I guess I don't but so far they have. If/when we
|
| autocheckout_click_in_progress_ = false; |
| ClickFailed(); |
| } |
| @@ -242,8 +236,9 @@ void AutofillAgent::DidFailProvisionalLoad(WebFrame* frame, |
| void AutofillAgent::DidCommitProvisionalLoad(WebFrame* frame, |
| bool is_new_navigation) { |
| - autocheckout_click_in_progress_ = false; |
| in_flight_request_form_.reset(); |
| + if (!frame->parent()) |
| + autocheckout_click_in_progress_ = false; |
| } |
| void AutofillAgent::FrameDetached(WebFrame* frame) { |
| @@ -754,6 +749,10 @@ void AutofillAgent::OnFillFormsAndClick( |
| for (size_t i = 0; i < forms.size(); ++i) |
| FillFormIncludingNonFocusableElements(forms[i], form_elements_[i]); |
| + // Exit early if there is nothing to click. |
| + if (click_element_descriptor.retrieval_method == WebElementDescriptor::NONE) |
| + return; |
| + |
| // It's possible that clicking the element to proceed in an Autocheckout |
| // flow will not actually proceed to the next step in the flow, e.g. there |
| // is a new required field that Autocheckout does not know how to fill. In |