diff options
author | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 23:53:53 +0000 |
---|---|---|
committer | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 23:53:53 +0000 |
commit | 9f3214478d7e077ffdd4cd78998596b1c7484713 (patch) | |
tree | 8467fa5ef12c3d762120f5a297b5abaa82c514a7 /chrome/browser/autofill/autofill_profile.cc | |
parent | d7f67f800d40a27ac14106522b61665767e6ad51 (diff) | |
download | chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.zip chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.tar.gz chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.tar.bz2 |
Never allow empty preview entries. As some data is always present (we drop completely empty profiles),
display this data in preview if name and first line of address is not available.
TEST=in the bug + unit-test
BUG=50320
Review URL: http://codereview.chromium.org/3806008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_profile.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_profile.cc | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc index 7db628e..c26af93 100644 --- a/chrome/browser/autofill/autofill_profile.cc +++ b/chrome/browser/autofill/autofill_profile.cc @@ -175,50 +175,6 @@ const string16& AutoFillProfile::Label() const { return label_; } -string16 AutoFillProfile::PreviewSummary() const { - // Fetch the components of the summary string. Any or all of these - // may be an empty string. - string16 first_name = GetFieldText(AutoFillType(NAME_FIRST)); - string16 last_name = GetFieldText(AutoFillType(NAME_LAST)); - string16 address = GetFieldText(AutoFillType(ADDRESS_HOME_LINE1)); - - // String separators depend (below) on the existence of the various fields. - bool have_first_name = first_name.length() > 0; - bool have_last_name = last_name.length() > 0; - bool have_address = address.length() > 0; - - // Name separator defaults to "". Space if we have first and last name. - string16 name_separator; - - if (have_first_name && have_last_name) { - name_separator = l10n_util::GetStringUTF16( - IDS_AUTOFILL_DIALOG_ADDRESS_NAME_SEPARATOR); - } - - // E.g. "John Smith", or "John", or "Smith", or "". - string16 name_format = l10n_util::GetStringFUTF16( - IDS_AUTOFILL_DIALOG_ADDRESS_SUMMARY_NAME_FORMAT, - first_name, - name_separator, - last_name); - - // Summary separator defaults to "". ", " if we have name and address. - string16 summary_separator; - if ((have_first_name || have_last_name) && have_address) { - summary_separator = l10n_util::GetStringUTF16( - IDS_AUTOFILL_DIALOG_ADDRESS_SUMMARY_SEPARATOR); - } - - // E.g. "John Smith, 123 Main Street". - string16 summary_format = l10n_util::GetStringFUTF16( - IDS_AUTOFILL_DIALOG_ADDRESS_SUMMARY_FORMAT, - name_format, - summary_separator, - address); - - return summary_format; -} - // static bool AutoFillProfile::AdjustInferredLabels( std::vector<AutoFillProfile*>* profiles) { |