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

Side by Side Diff: chrome/browser/autofill/autofill_xml_parser.h

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: Updated string. Pop the UI only on first page of the flow. Created 8 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // 63 //
64 // Fields are returned in the same order they were sent to the server. 64 // Fields are returned in the same order they were sent to the server.
65 // autofilltype: The server's guess at what type of field this is. 0 is 65 // autofilltype: The server's guess at what type of field this is. 0 is
66 // unknown, other types are documented in chrome/browser/autofill/field_types.h. 66 // unknown, other types are documented in chrome/browser/autofill/field_types.h.
67 class AutofillQueryXmlParser : public AutofillXmlParser { 67 class AutofillQueryXmlParser : public AutofillXmlParser {
68 public: 68 public:
69 AutofillQueryXmlParser(std::vector<AutofillFieldType>* field_types, 69 AutofillQueryXmlParser(std::vector<AutofillFieldType>* field_types,
70 UploadRequired* upload_required, 70 UploadRequired* upload_required,
71 std::string* experiment_id); 71 std::string* experiment_id);
72 72
73 int GetPageNo() { return page_no_; }
Ilya Sherman 2012/12/13 02:29:23 nit: Please spell out "number". This method shoul
Raman Kakilate 2012/12/13 21:34:34 Done.
74
75 int GetTotalPages() { return total_pages_; }
Ilya Sherman 2012/12/13 02:29:23 nit: This method should be named total_pages()
Raman Kakilate 2012/12/13 21:34:34 Done.
76
73 private: 77 private:
74 // A callback for the beginning of a new <element>, called by Expat. 78 // A callback for the beginning of a new <element>, called by Expat.
75 // |context| is a parsing context used to resolve element/attribute names. 79 // |context| is a parsing context used to resolve element/attribute names.
76 // |name| is the name of the element. 80 // |name| is the name of the element.
77 // |attrs| is the list of attributes (names and values) for the element. 81 // |attrs| is the list of attributes (names and values) for the element.
78 virtual void StartElement(buzz::XmlParseContext* context, 82 virtual void StartElement(buzz::XmlParseContext* context,
79 const char* name, 83 const char* name,
80 const char** attrs) OVERRIDE; 84 const char** attrs) OVERRIDE;
81 85
82 // A helper function to retrieve integer values from strings. Raises an 86 // A helper function to retrieve integer values from strings. Raises an
83 // XML parse error if it fails. 87 // XML parse error if it fails.
84 // |context| is the current parsing context. 88 // |context| is the current parsing context.
85 // |value| is the string to convert. 89 // |value| is the string to convert.
86 int GetIntValue(buzz::XmlParseContext* context, const char* attribute); 90 int GetIntValue(buzz::XmlParseContext* context, const char* attribute);
87 91
88 // The parsed field types. 92 // The parsed field types.
89 std::vector<AutofillFieldType>* field_types_; 93 std::vector<AutofillFieldType>* field_types_;
90 94
91 // A flag indicating whether the client should upload Autofill data when this 95 // A flag indicating whether the client should upload Autofill data when this
92 // form is submitted. 96 // form is submitted.
93 UploadRequired* upload_required_; 97 UploadRequired* upload_required_;
94 98
99 // Page number of present page in multipage autofill flow.
Ilya Sherman 2012/12/13 02:29:23 Why is the XML server responsible for keeping trac
Raman Kakilate 2012/12/13 21:34:34 Idea is show autofill_dialog_controller UI on the
Ilya Sherman 2012/12/13 23:23:18 That all makes sense. What I don't understand is
Raman Kakilate 2013/01/10 00:54:40 Server sending down data for all the possible flow
100 int page_no_;
101
102 // Total number of pages in multipage autofill flow.
103 int total_pages_;
104
95 // The server experiment to which this query response belongs. 105 // The server experiment to which this query response belongs.
96 // For the default server implementation, this is empty. 106 // For the default server implementation, this is empty.
97 std::string* experiment_id_; 107 std::string* experiment_id_;
98 108
99 DISALLOW_COPY_AND_ASSIGN(AutofillQueryXmlParser); 109 DISALLOW_COPY_AND_ASSIGN(AutofillQueryXmlParser);
100 }; 110 };
101 111
102 // The XML parser for handling Autofill upload responses. Typical upload 112 // The XML parser for handling Autofill upload responses. Typical upload
103 // responses look like: 113 // responses look like:
104 // 114 //
(...skipping 28 matching lines...) Expand all
133 // True if parsing succeeded. 143 // True if parsing succeeded.
134 bool succeeded_; 144 bool succeeded_;
135 145
136 double* positive_upload_rate_; 146 double* positive_upload_rate_;
137 double* negative_upload_rate_; 147 double* negative_upload_rate_;
138 148
139 DISALLOW_COPY_AND_ASSIGN(AutofillUploadXmlParser); 149 DISALLOW_COPY_AND_ASSIGN(AutofillUploadXmlParser);
140 }; 150 };
141 151
142 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_ 152 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_XML_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698