summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorgeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 23:53:53 +0000
committergeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 23:53:53 +0000
commit9f3214478d7e077ffdd4cd78998596b1c7484713 (patch)
tree8467fa5ef12c3d762120f5a297b5abaa82c514a7 /chrome/browser/views
parentd7f67f800d40a27ac14106522b61665767e6ad51 (diff)
downloadchromium_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/views')
-rw-r--r--chrome/browser/views/autofill_profiles_view_win.cc13
-rw-r--r--chrome/browser/views/autofill_profiles_view_win.h3
2 files changed, 1 insertions, 15 deletions
diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc
index 7315953..488ec72 100644
--- a/chrome/browser/views/autofill_profiles_view_win.cc
+++ b/chrome/browser/views/autofill_profiles_view_win.cc
@@ -258,15 +258,6 @@ void AutoFillProfilesView::UpdateWidgetState() {
autofill_enabled);
}
-void AutoFillProfilesView::UpdateProfileLabels() {
- std::vector<AutoFillProfile*> profiles;
- profiles.resize(profiles_set_.size());
- for (size_t i = 0; i < profiles_set_.size(); ++i) {
- profiles[i] = &(profiles_set_[i].address);
- }
- AutoFillProfile::AdjustInferredLabels(&profiles);
-}
-
void AutoFillProfilesView::ChildWindowOpened() {
child_dialog_opened_ = true;
UpdateWidgetState();
@@ -446,7 +437,6 @@ void AutoFillProfilesView::OnPersonalDataChanged() {
++address_it) {
profiles_set_.push_back(EditableSetInfo(*address_it));
}
- UpdateProfileLabels();
credit_card_set_.clear();
for (std::vector<CreditCard*>::const_iterator cc_it =
@@ -563,7 +553,6 @@ void AutoFillProfilesView::GetData() {
profiles_set_.push_back(EditableSetInfo(*address_it));
}
}
- UpdateProfileLabels();
if (!imported_data_present) {
credit_card_set_.reserve(personal_data_manager_->credit_cards().size());
@@ -1313,7 +1302,7 @@ std::wstring AutoFillProfilesView::ContentListTableModel::GetText(
int row, int column_id) {
DCHECK(row < static_cast<int>(profiles_->size() + credit_cards_->size()));
if (row < static_cast<int>(profiles_->size())) {
- return profiles_->at(row).address.PreviewSummary();
+ return profiles_->at(row).address.Label();
} else {
row -= profiles_->size();
return credit_cards_->at(row).credit_card.PreviewSummary();
diff --git a/chrome/browser/views/autofill_profiles_view_win.h b/chrome/browser/views/autofill_profiles_view_win.h
index e1a6c25..7ccfa63 100644
--- a/chrome/browser/views/autofill_profiles_view_win.h
+++ b/chrome/browser/views/autofill_profiles_view_win.h
@@ -89,9 +89,6 @@ class AutoFillProfilesView : public views::View,
// Updates state of the buttons.
void UpdateWidgetState();
- // Updates inferred labels.
- void UpdateProfileLabels();
-
// Following two functions are called from opened child dialog to
// disable/enable buttons.
void ChildWindowOpened();