OLD | NEW |
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/autofill_profile.h" | 5 #include "components/autofill/core/browser/autofill_profile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 #include <ostream> | 10 #include <ostream> |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 | 301 |
302 bool AutofillProfile::SetInfo(const AutofillType& type, | 302 bool AutofillProfile::SetInfo(const AutofillType& type, |
303 const base::string16& value, | 303 const base::string16& value, |
304 const std::string& app_locale) { | 304 const std::string& app_locale) { |
305 FormGroup* form_group = MutableFormGroupForType(type); | 305 FormGroup* form_group = MutableFormGroupForType(type); |
306 if (!form_group) | 306 if (!form_group) |
307 return false; | 307 return false; |
308 | 308 |
309 base::string16 trimmed_value; | 309 base::string16 trimmed_value; |
310 TrimWhitespace(value, TRIM_ALL, &trimmed_value); | 310 base::TrimWhitespace(value, base::TRIM_ALL, &trimmed_value); |
311 return form_group->SetInfo(type, trimmed_value, app_locale); | 311 return form_group->SetInfo(type, trimmed_value, app_locale); |
312 } | 312 } |
313 | 313 |
314 base::string16 AutofillProfile::GetInfoForVariant( | 314 base::string16 AutofillProfile::GetInfoForVariant( |
315 const AutofillType& type, | 315 const AutofillType& type, |
316 size_t variant, | 316 size_t variant, |
317 const std::string& app_locale) const { | 317 const std::string& app_locale) const { |
318 std::vector<base::string16> values; | 318 std::vector<base::string16> values; |
319 GetMultiInfo(type, app_locale, &values); | 319 GetMultiInfo(type, app_locale, &values); |
320 | 320 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) | 841 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) |
842 << " " | 842 << " " |
843 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) | 843 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) |
844 << " " | 844 << " " |
845 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) | 845 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) |
846 << " " | 846 << " " |
847 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); | 847 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); |
848 } | 848 } |
849 | 849 |
850 } // namespace autofill | 850 } // namespace autofill |
OLD | NEW |