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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_common.cc

Issue 310463005: Fill in more name fields with requestAutocomplete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dumb test is dumb Created 6 years, 6 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 "chrome/browser/ui/autofill/autofill_dialog_common.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_common.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "components/autofill/core/browser/autofill_country.h" 9 #include "components/autofill/core/browser/autofill_country.h"
10 #include "components/autofill/core/browser/autofill_field.h" 10 #include "components/autofill/core/browser/autofill_field.h"
(...skipping 25 matching lines...) Expand all
36 return false; 36 return false;
37 37
38 // The page may ask for individual address lines; this roughly matches the 38 // The page may ask for individual address lines; this roughly matches the
39 // street address blob. 39 // street address blob.
40 if (server_type == ADDRESS_HOME_LINE1 || 40 if (server_type == ADDRESS_HOME_LINE1 ||
41 server_type == ADDRESS_HOME_LINE2 || 41 server_type == ADDRESS_HOME_LINE2 ||
42 server_type == ADDRESS_HOME_LINE3) { 42 server_type == ADDRESS_HOME_LINE3) {
43 return autofill_type.GetStorableType() == ADDRESS_HOME_STREET_ADDRESS; 43 return autofill_type.GetStorableType() == ADDRESS_HOME_STREET_ADDRESS;
44 } 44 }
45 45
46 // First, middle and last name are parsed from full name.
47 if (field_type.group() == NAME || field_type.group() == NAME_BILLING)
48 return autofill_type.GetStorableType() == NAME_FULL;
49
46 return autofill_type.GetStorableType() == server_type; 50 return autofill_type.GetStorableType() == server_type;
47 } 51 }
48 52
49 bool ServerTypeMatchesField(DialogSection section, 53 bool ServerTypeMatchesField(DialogSection section,
50 ServerFieldType type, 54 ServerFieldType type,
51 const AutofillField& field) { 55 const AutofillField& field) {
52 AutofillType field_type = field.Type(); 56 AutofillType field_type = field.Type();
53 57
54 // The credit card name is filled from the billing section's data. 58 // The credit card name is filled from the billing section's data.
55 if (field_type.GetStorableType() == CREDIT_CARD_NAME && 59 if (field_type.GetStorableType() == CREDIT_CARD_NAME &&
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs) { 120 std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs) {
117 std::vector<ServerFieldType> types; 121 std::vector<ServerFieldType> types;
118 for (size_t i = 0; i < inputs.size(); ++i) { 122 for (size_t i = 0; i < inputs.size(); ++i) {
119 types.push_back(inputs[i].type); 123 types.push_back(inputs[i].type);
120 } 124 }
121 return types; 125 return types;
122 } 126 }
123 127
124 } // namespace common 128 } // namespace common
125 } // namespace autofill 129 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698