Commit 74251a06 authored by Roger McFarlane's avatar Roger McFarlane Committed by Commit Bot

[autofill] Show initial heuristic predictions.

Only applies when --show-autofill-type-predictions is given.

After parsing forms, the autofill manager defers sending the
predicted types for queryable forms to the render until the
query has completed. If the server predictions don't arrive,
the heuristic precictions are never sent to the renderer.

This CL sends the predictions for the queryable forms after
initial parse (the non-queryable predictions are already
sent). If and when the query completes, the predictions are
updated as per the current flow.

BUG=752225, 715828

Change-Id: Idebcda81317dcb9fcaa3c914983218e449970b65
Reviewed-on: https://chromium-review.googlesource.com/601003Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491853}
parent a7043040
...@@ -2062,11 +2062,6 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) { ...@@ -2062,11 +2062,6 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) {
parse_form_start_time); parse_form_start_time);
} }
if (!queryable_forms.empty() && download_manager_) {
// Query the server if at least one of the forms was parsed.
download_manager_->StartQueryRequest(queryable_forms);
}
if (!queryable_forms.empty() || !non_queryable_forms.empty()) { if (!queryable_forms.empty() || !non_queryable_forms.empty()) {
AutofillMetrics::LogUserHappinessMetric(AutofillMetrics::FORMS_LOADED); AutofillMetrics::LogUserHappinessMetric(AutofillMetrics::FORMS_LOADED);
...@@ -2093,10 +2088,16 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) { ...@@ -2093,10 +2088,16 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) {
} }
#endif #endif
// For the |non_queryable_forms|, we have all the field type info we're ever // Send the current type predictions to the renderer. For non-queryable forms
// going to get about them. For the other forms, we'll wait until we get a // this is all the information about them that will ever be available. The
// response from the server. // queryable forms will be updated once the field type query is complete.
driver()->SendAutofillTypePredictionsToRenderer(non_queryable_forms); driver()->SendAutofillTypePredictionsToRenderer(non_queryable_forms);
driver()->SendAutofillTypePredictionsToRenderer(queryable_forms);
if (!queryable_forms.empty() && download_manager_) {
// Query the server if at least one of the forms was parsed.
download_manager_->StartQueryRequest(queryable_forms);
}
} }
bool AutofillManager::ParseForm(const FormData& form, bool AutofillManager::ParseForm(const FormData& form,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment