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

Unified Diff: chrome/browser/autofill/form_structure.cc

Issue 11539003: Pop up requestAutocomplete UI when autofill server hints chrome client that it is in a multipage au… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed Albert's comments Created 7 years, 11 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: chrome/browser/autofill/form_structure.cc
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index d1ca6d10bedf80cc2b56709590438e5c04e0025c..827a7515325890970fa4fed3a03971892121a3e9 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -229,6 +229,8 @@ FormStructure::FormStructure(const FormData& form)
autofill_count_(0),
upload_required_(USE_UPLOAD_RATES),
server_experiment_id_("no server response"),
+ current_page_number_(-1),
+ total_pages_(-1),
has_author_specified_types_(false) {
// Copy the form fields.
std::map<string16, size_t> unique_names;
@@ -264,6 +266,14 @@ FormStructure::FormStructure(const FormData& form)
FormStructure::~FormStructure() {}
+bool FormStructure::IsStartOfAutofillableFlow() const {
+ return current_page_number_ == 0;
+}
+
+bool FormStructure::IsInAutofillableFlow() const {
+ return current_page_number_ >= 0 && current_page_number_ < total_pages_;
+}
Ilya Sherman 2013/01/15 06:31:52 nit: Please place these methods in the same place
Raman Kakilate 2013/01/15 23:02:33 Moved it after ParseFieldsTypeFromAutocompleteAttr
+
void FormStructure::DetermineHeuristicTypes(
const AutofillMetrics& metric_logger) {
// First, try to detect field types based on each field's |autocomplete|
@@ -429,6 +439,8 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml,
FormStructure* form = *iter;
form->upload_required_ = upload_required;
form->server_experiment_id_ = experiment_id;
+ form->current_page_number_ = parse_handler.current_page_number();
+ form->total_pages_ = parse_handler.total_pages();
for (std::vector<AutofillField*>::iterator field = form->fields_.begin();
field != form->fields_.end(); ++field, ++current_type) {

Powered by Google App Engine
This is Rietveld 408576698