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

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: Resolve with AutofillDialogController refactoring. 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
« no previous file with comments | « chrome/browser/autofill/form_structure.h ('k') | chrome/browser/autofill/form_structure_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..885224011c5c3cf77939611e308a7a24dadd86a2 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;
@@ -429,6 +431,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) {
@@ -1016,6 +1020,14 @@ void FormStructure::ParseFieldTypesFromAutocompleteAttributes(
}
}
+bool FormStructure::IsStartOfAutofillableFlow() const {
+ return current_page_number_ == 0 && total_pages_ > 0;
+}
+
+bool FormStructure::IsInAutofillableFlow() const {
+ return current_page_number_ >= 0 && current_page_number_ < total_pages_;
+}
+
void FormStructure::IdentifySections(bool has_author_specified_sections) {
if (fields_.empty())
return;
« no previous file with comments | « chrome/browser/autofill/form_structure.h ('k') | chrome/browser/autofill/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698