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

Side by Side Diff: components/autofill/core/browser/address_field.cc

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "components/autofill/core/browser/address_field.h" 5 #include "components/autofill/core/browser/address_field.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 address1_(NULL), 129 address1_(NULL),
130 address2_(NULL), 130 address2_(NULL),
131 city_(NULL), 131 city_(NULL),
132 state_(NULL), 132 state_(NULL),
133 zip_(NULL), 133 zip_(NULL),
134 zip4_(NULL), 134 zip4_(NULL),
135 country_(NULL), 135 country_(NULL),
136 type_(kGenericAddress) { 136 type_(kGenericAddress) {
137 } 137 }
138 138
139 bool AddressField::ClassifyField(FieldTypeMap* map) const { 139 bool AddressField::ClassifyField(ServerFieldTypeMap* map) const {
140 AutofillFieldType address_company; 140 ServerFieldType address_company;
141 AutofillFieldType address_line1; 141 ServerFieldType address_line1;
142 AutofillFieldType address_line2; 142 ServerFieldType address_line2;
143 AutofillFieldType address_city; 143 ServerFieldType address_city;
144 AutofillFieldType address_state; 144 ServerFieldType address_state;
145 AutofillFieldType address_zip; 145 ServerFieldType address_zip;
146 AutofillFieldType address_country; 146 ServerFieldType address_country;
147 147
148 switch (type_) { 148 switch (type_) {
149 case kShippingAddress: 149 case kShippingAddress:
150 // Fall through. Autofill does not support shipping addresses. 150 // Fall through. Autofill does not support shipping addresses.
151 case kGenericAddress: 151 case kGenericAddress:
152 address_company = COMPANY_NAME; 152 address_company = COMPANY_NAME;
153 address_line1 = ADDRESS_HOME_LINE1; 153 address_line1 = ADDRESS_HOME_LINE1;
154 address_line2 = ADDRESS_HOME_LINE2; 154 address_line2 = ADDRESS_HOME_LINE2;
155 address_city = ADDRESS_HOME_CITY; 155 address_city = ADDRESS_HOME_CITY;
156 address_state = ADDRESS_HOME_STATE; 156 address_state = ADDRESS_HOME_STATE;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 if (bill == base::string16::npos && ship != base::string16::npos) 332 if (bill == base::string16::npos && ship != base::string16::npos)
333 return kShippingAddress; 333 return kShippingAddress;
334 334
335 if (bill > ship) 335 if (bill > ship)
336 return kBillingAddress; 336 return kBillingAddress;
337 337
338 return kShippingAddress; 338 return kShippingAddress;
339 } 339 }
340 340
341 } // namespace autofill 341 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/address_field.h ('k') | components/autofill/core/browser/address_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698