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

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

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync 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 "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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 continue; 700 continue;
701 701
702 if (!label.empty()) 702 if (!label.empty())
703 label.append(separator); 703 label.append(separator);
704 704
705 label.append(field); 705 label.append(field);
706 ++num_fields_used; 706 ++num_fields_used;
707 } 707 }
708 708
709 // Flatten the label if need be. 709 // Flatten the label if need be.
710 const base::char16 kNewline[] = { '\n', 0 }; 710 const base::string16& line_separator =
711 const base::string16 newline_separator =
712 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR); 711 l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR);
713 base::ReplaceChars(label, kNewline, newline_separator, &label); 712 base::ReplaceChars(label, base::ASCIIToUTF16("\n"), line_separator, &label);
714 713
715 return label; 714 return label;
716 } 715 }
717 716
718 // static 717 // static
719 void AutofillProfile::CreateInferredLabelsHelper( 718 void AutofillProfile::CreateInferredLabelsHelper(
720 const std::vector<AutofillProfile*>& profiles, 719 const std::vector<AutofillProfile*>& profiles,
721 const std::list<size_t>& indices, 720 const std::list<size_t>& indices,
722 const std::vector<ServerFieldType>& fields, 721 const std::vector<ServerFieldType>& fields,
723 size_t num_fields_to_include, 722 size_t num_fields_to_include,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) 867 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE))
869 << " " 868 << " "
870 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) 869 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY))
871 << " " 870 << " "
872 << profile.language_code() 871 << profile.language_code()
873 << " " 872 << " "
874 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); 873 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER));
875 } 874 }
876 875
877 } // namespace autofill 876 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_field.cc ('k') | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698