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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 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
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/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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 base::string16 AutofillProfile::GetInfo(const AutofillType& type, 321 base::string16 AutofillProfile::GetInfo(const AutofillType& type,
322 const std::string& app_locale) const { 322 const std::string& app_locale) const {
323 if (type.html_type() == HTML_TYPE_FULL_ADDRESS) { 323 if (type.html_type() == HTML_TYPE_FULL_ADDRESS) {
324 scoped_ptr<AddressData> address_data = 324 scoped_ptr<AddressData> address_data =
325 i18n::CreateAddressDataFromAutofillProfile(*this, app_locale); 325 i18n::CreateAddressDataFromAutofillProfile(*this, app_locale);
326 if (!addressinput::HasAllRequiredFields(*address_data)) 326 if (!addressinput::HasAllRequiredFields(*address_data))
327 return base::string16(); 327 return base::string16();
328 328
329 std::vector<std::string> lines; 329 std::vector<std::string> lines;
330 ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines); 330 ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines);
331 return base::UTF8ToUTF16(JoinString(lines, '\n')); 331 return base::UTF8ToUTF16(base::JoinString(lines, "\n"));
332 } 332 }
333 333
334 const FormGroup* form_group = FormGroupForType(type); 334 const FormGroup* form_group = FormGroupForType(type);
335 if (!form_group) 335 if (!form_group)
336 return base::string16(); 336 return base::string16();
337 337
338 return form_group->GetInfo(type, app_locale); 338 return form_group->GetInfo(type, app_locale);
339 } 339 }
340 340
341 bool AutofillProfile::SetInfo(const AutofillType& type, 341 bool AutofillProfile::SetInfo(const AutofillType& type,
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " 960 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " "
961 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " 961 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " "
962 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " 962 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " "
963 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " 963 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " "
964 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " 964 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " "
965 << profile.language_code() << " " 965 << profile.language_code() << " "
966 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); 966 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
967 } 967 }
968 968
969 } // namespace autofill 969 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/address.cc ('k') | components/autofill/core/browser/contact_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698