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

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

Issue 11867025: Download autocheckout whitelist and enable autocheckout for whitelisted sites only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert code change for manual testing/:wq. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_FORM_STRUCTURE_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
6 #define CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ 6 #define CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 26 matching lines...) Expand all
37 37
38 namespace buzz { 38 namespace buzz {
39 class XmlElement; 39 class XmlElement;
40 } 40 }
41 41
42 // FormStructure stores a single HTML form together with the values entered 42 // FormStructure stores a single HTML form together with the values entered
43 // in the fields along with additional information needed by Autofill. 43 // in the fields along with additional information needed by Autofill.
44 class FormStructure { 44 class FormStructure {
45 public: 45 public:
46 explicit FormStructure(const FormData& form); 46 explicit FormStructure(const FormData& form);
47 FormStructure(const FormData& form, bool autocheckout_enabled);
Ilya Sherman 2013/01/24 22:01:55 Please replace the previous constructor, rather th
benquan 2013/01/25 00:55:31 I was told we do not want default value for parame
Ilya Sherman 2013/01/25 01:22:40 Yes, that's correct: parameters should not have de
47 virtual ~FormStructure(); 48 virtual ~FormStructure();
48 49
49 // Runs several heuristics against the form fields to determine their possible 50 // Runs several heuristics against the form fields to determine their possible
50 // types. 51 // types.
51 void DetermineHeuristicTypes(const AutofillMetrics& metric_logger); 52 void DetermineHeuristicTypes(const AutofillMetrics& metric_logger);
52 53
53 // Encodes the XML upload request from this FormStructure. 54 // Encodes the XML upload request from this FormStructure.
54 bool EncodeUploadRequest(const FieldTypeSet& available_field_types, 55 bool EncodeUploadRequest(const FieldTypeSet& available_field_types,
55 bool form_was_autofilled, 56 bool form_was_autofilled,
56 std::string* encoded_xml) const; 57 std::string* encoded_xml) const;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Returns a FormData containing the data this form structure knows about. 158 // Returns a FormData containing the data this form structure knows about.
158 // |user_submitted| is currently always false. 159 // |user_submitted| is currently always false.
159 FormData ToFormData() const; 160 FormData ToFormData() const;
160 161
161 bool operator==(const FormData& form) const; 162 bool operator==(const FormData& form) const;
162 bool operator!=(const FormData& form) const; 163 bool operator!=(const FormData& form) const;
163 164
164 private: 165 private:
165 friend class FormStructureTest; 166 friend class FormStructureTest;
166 FRIEND_TEST_ALL_PREFIXES(AutofillDownloadTest, QueryAndUploadTest); 167 FRIEND_TEST_ALL_PREFIXES(AutofillDownloadTest, QueryAndUploadTest);
168
169 // Initialize FormStructure object, called by constructors.
170 void Init(const FormData& form);
171
167 // 64-bit hash of the string - used in FormSignature and unit-tests. 172 // 64-bit hash of the string - used in FormSignature and unit-tests.
168 static std::string Hash64Bit(const std::string& str); 173 static std::string Hash64Bit(const std::string& str);
169 174
170 enum EncodeRequestType { 175 enum EncodeRequestType {
171 QUERY, 176 QUERY,
172 UPLOAD, 177 UPLOAD,
173 }; 178 };
174 179
175 // Adds form info to |encompassing_xml_element|. |request_type| indicates if 180 // Adds form info to |encompassing_xml_element|. |request_type| indicates if
176 // it is a query or upload. 181 // it is a query or upload.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 int current_page_number_; 230 int current_page_number_;
226 231
227 // Total number of pages in the autofill flow. If this form doesn't belong 232 // Total number of pages in the autofill flow. If this form doesn't belong
228 // to any autofill flow, it is set to -1. 233 // to any autofill flow, it is set to -1.
229 int total_pages_; 234 int total_pages_;
230 235
231 // Whether the form includes any field types explicitly specified by the site 236 // Whether the form includes any field types explicitly specified by the site
232 // author, via the |autocompletetype| attribute. 237 // author, via the |autocompletetype| attribute.
233 bool has_author_specified_types_; 238 bool has_author_specified_types_;
234 239
235 // State of the kEnableExperimentalFormFilling flag. 240 // Whether the autocheckout feature is enabled for the site which contains
236 bool experimental_form_filling_enabled_; 241 // this form.
242 bool autocheckout_enabled_;
237 243
238 DISALLOW_COPY_AND_ASSIGN(FormStructure); 244 DISALLOW_COPY_AND_ASSIGN(FormStructure);
239 }; 245 };
240 246
241 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ 247 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698