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

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

Issue 1774153002: [Autofill] Add the phone extension type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and adapt heuristic output Created 4 years, 9 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
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/form_structure.h" 5 #include "components/autofill/core/browser/form_structure.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 if (autocomplete_attribute_value == "tel-local") 268 if (autocomplete_attribute_value == "tel-local")
269 return HTML_TYPE_TEL_LOCAL; 269 return HTML_TYPE_TEL_LOCAL;
270 270
271 if (autocomplete_attribute_value == "tel-local-prefix") 271 if (autocomplete_attribute_value == "tel-local-prefix")
272 return HTML_TYPE_TEL_LOCAL_PREFIX; 272 return HTML_TYPE_TEL_LOCAL_PREFIX;
273 273
274 if (autocomplete_attribute_value == "tel-local-suffix") 274 if (autocomplete_attribute_value == "tel-local-suffix")
275 return HTML_TYPE_TEL_LOCAL_SUFFIX; 275 return HTML_TYPE_TEL_LOCAL_SUFFIX;
276 276
277 if (autocomplete_attribute_value == "tel-extension")
278 return HTML_TYPE_TEL_EXTENSION;
279
277 if (autocomplete_attribute_value == "email") 280 if (autocomplete_attribute_value == "email")
278 return HTML_TYPE_EMAIL; 281 return HTML_TYPE_EMAIL;
279 282
280 return HTML_TYPE_UNRECOGNIZED; 283 return HTML_TYPE_UNRECOGNIZED;
281 } 284 }
282 285
283 std::string StripDigitsIfRequired(const base::string16& input) { 286 std::string StripDigitsIfRequired(const base::string16& input) {
284 std::string return_string = base::UTF16ToUTF8(input); 287 std::string return_string = base::UTF16ToUTF8(input);
285 288
286 re2::RE2::GlobalReplace(&return_string, re2::RE2(kIgnorePatternInFieldName), 289 re2::RE2::GlobalReplace(&return_string, re2::RE2(kIgnorePatternInFieldName),
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 filtered_strings[0].at(prefix_len)) { 1330 filtered_strings[0].at(prefix_len)) {
1328 // Mismatch found. 1331 // Mismatch found.
1329 return filtered_strings[i].substr(0, prefix_len); 1332 return filtered_strings[i].substr(0, prefix_len);
1330 } 1333 }
1331 } 1334 }
1332 } 1335 }
1333 return filtered_strings[0]; 1336 return filtered_strings[0];
1334 } 1337 }
1335 1338
1336 } // namespace autofill 1339 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/field_types.h ('k') | components/autofill/core/browser/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698