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

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 buncha stuff 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 HasAllRequiredFields()) { 97 HasAllRequiredFields()) {
98 return false; 98 return false;
99 } 99 }
100 100
101 const ServerFieldType more_required_fields[] = { 101 const ServerFieldType more_required_fields[] = {
102 NAME_FULL, 102 NAME_FULL,
103 PHONE_HOME_WHOLE_NUMBER 103 PHONE_HOME_WHOLE_NUMBER
104 }; 104 };
105 105
106 for (size_t i = 0; i < arraysize(more_required_fields); ++i) { 106 for (size_t i = 0; i < arraysize(more_required_fields); ++i) {
107 if (profile.GetRawInfo(more_required_fields[i]).empty()) 107 if (profile.GetInfo(AutofillType(more_required_fields[i]),
108 app_locale).empty()) {
108 return false; 109 return false;
110 }
109 } 111 }
110 112
111 return true; 113 return true;
112 } 114 }
113 115
114 ServerFieldType TypeForField(AddressField address_field, 116 ServerFieldType TypeForField(AddressField address_field,
115 common::AddressType address_type) { 117 common::AddressType address_type) {
116 bool billing = address_type == common::ADDRESS_TYPE_BILLING; 118 bool billing = address_type == common::ADDRESS_TYPE_BILLING;
117 switch (address_field) { 119 switch (address_field) {
118 case ::i18n::addressinput::COUNTRY: 120 case ::i18n::addressinput::COUNTRY:
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (field) 193 if (field)
192 *field = ::i18n::addressinput::RECIPIENT; 194 *field = ::i18n::addressinput::RECIPIENT;
193 return true; 195 return true;
194 default: 196 default:
195 return false; 197 return false;
196 } 198 }
197 } 199 }
198 200
199 } // namespace i18ninput 201 } // namespace i18ninput
200 } // namespace autofill 202 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698