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

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

Issue 347183005: autofill names - dont parse when calling SetRawInfo(FULL_NAME) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android test expectation Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_i18n_input.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "components/autofill/core/browser/address_i18n.h" 10 #include "components/autofill/core/browser/address_i18n.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 HasAllRequiredFields()) { 92 HasAllRequiredFields()) {
93 return false; 93 return false;
94 } 94 }
95 95
96 const ServerFieldType more_required_fields[] = { 96 const ServerFieldType more_required_fields[] = {
97 NAME_FULL, 97 NAME_FULL,
98 PHONE_HOME_WHOLE_NUMBER 98 PHONE_HOME_WHOLE_NUMBER
99 }; 99 };
100 100
101 for (size_t i = 0; i < arraysize(more_required_fields); ++i) { 101 for (size_t i = 0; i < arraysize(more_required_fields); ++i) {
102 if (profile.GetRawInfo(more_required_fields[i]).empty()) 102 if (profile.GetInfo(AutofillType(more_required_fields[i]),
103 app_locale).empty()) {
103 return false; 104 return false;
105 }
104 } 106 }
105 107
106 return true; 108 return true;
107 } 109 }
108 110
109 ServerFieldType TypeForField(AddressField address_field, 111 ServerFieldType TypeForField(AddressField address_field,
110 common::AddressType address_type) { 112 common::AddressType address_type) {
111 bool billing = address_type == common::ADDRESS_TYPE_BILLING; 113 bool billing = address_type == common::ADDRESS_TYPE_BILLING;
112 switch (address_field) { 114 switch (address_field) {
113 case ::i18n::addressinput::COUNTRY: 115 case ::i18n::addressinput::COUNTRY:
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (field) 182 if (field)
181 *field = ::i18n::addressinput::RECIPIENT; 183 *field = ::i18n::addressinput::RECIPIENT;
182 return true; 184 return true;
183 default: 185 default:
184 return false; 186 return false;
185 } 187 }
186 } 188 }
187 189
188 } // namespace i18ninput 190 } // namespace i18ninput
189 } // namespace autofill 191 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698