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

Unified Diff: components/autofill/renderer/autofill_agent.cc

Issue 12457033: Implements SendAutocheckoutStatus API calls for stats tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit tests Created 7 years, 9 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
« no previous file with comments | « components/autofill/browser/wallet/wallet_client_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/renderer/autofill_agent.cc
diff --git a/components/autofill/renderer/autofill_agent.cc b/components/autofill/renderer/autofill_agent.cc
index 2c717832c1929d9ff7387596d5d395a9e27154b8..c85c265efae424a9a745c801536f06334b09580f 100644
--- a/components/autofill/renderer/autofill_agent.cc
+++ b/components/autofill/renderer/autofill_agent.cc
@@ -223,13 +223,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()) {
+ if (click_timer_.IsRunning()) {
click_timer_.Stop();
autocheckout_click_in_progress_ = true;
}
@@ -238,7 +232,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_) {
autocheckout_click_in_progress_ = false;
ClickFailed();
}
@@ -246,8 +240,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) {
@@ -755,6 +750,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
« no previous file with comments | « components/autofill/browser/wallet/wallet_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698