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 "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 suggested_shipping_.Reset(); | 1236 suggested_shipping_.Reset(); |
1237 | 1237 |
1238 if (IsPayingWithWallet()) { | 1238 if (IsPayingWithWallet()) { |
1239 if (wallet_items_.get()) { | 1239 if (wallet_items_.get()) { |
1240 // TODO(estade): seems we need to hardcode the email address. | 1240 // TODO(estade): seems we need to hardcode the email address. |
1241 | 1241 |
1242 const std::vector<wallet::Address*>& addresses = | 1242 const std::vector<wallet::Address*>& addresses = |
1243 wallet_items_->addresses(); | 1243 wallet_items_->addresses(); |
1244 for (size_t i = 0; i < addresses.size(); ++i) { | 1244 for (size_t i = 0; i < addresses.size(); ++i) { |
1245 // TODO(dbeam): respect wallet_items_->default_instrument_id(). | 1245 // TODO(dbeam): respect wallet_items_->default_instrument_id(). |
1246 suggested_shipping_.AddKeyedItem(base::IntToString(i), | 1246 suggested_shipping_.AddKeyedItemWithSublabel( |
1247 addresses[i]->DisplayName()); | 1247 base::IntToString(i), |
| 1248 addresses[i]->DisplayName(), |
| 1249 addresses[i]->DisplayNameLine2()); |
1248 } | 1250 } |
1249 | 1251 |
1250 const std::vector<wallet::WalletItems::MaskedInstrument*>& instruments = | 1252 const std::vector<wallet::WalletItems::MaskedInstrument*>& instruments = |
1251 wallet_items_->instruments(); | 1253 wallet_items_->instruments(); |
1252 for (size_t i = 0; i < instruments.size(); ++i) { | 1254 for (size_t i = 0; i < instruments.size(); ++i) { |
1253 // TODO(dbeam): respect wallet_items_->default_address_id(). | 1255 // TODO(dbeam): respect wallet_items_->default_address_id(). |
1254 suggested_cc_billing_.AddKeyedItemWithIcon( | 1256 suggested_cc_billing_.AddKeyedItemWithSublabelAndIcon( |
1255 base::IntToString(i), | 1257 base::IntToString(i), |
1256 instruments[i]->descriptive_name(), | 1258 instruments[i]->DisplayName(), |
| 1259 instruments[i]->DisplayNameLine2(), |
1257 instruments[i]->CardIcon()); | 1260 instruments[i]->CardIcon()); |
1258 } | 1261 } |
1259 } | 1262 } |
1260 | 1263 |
1261 suggested_cc_billing_.AddKeyedItem( | 1264 suggested_cc_billing_.AddKeyedItem( |
1262 std::string(), | 1265 std::string(), |
1263 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_BILLING_DETAILS)); | 1266 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_BILLING_DETAILS)); |
1264 } else { | 1267 } else { |
1265 PersonalDataManager* manager = GetManager(); | 1268 PersonalDataManager* manager = GetManager(); |
1266 const std::vector<CreditCard*>& cards = manager->credit_cards(); | 1269 const std::vector<CreditCard*>& cards = manager->credit_cards(); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 callback_.Run(&form_structure_); | 1634 callback_.Run(&form_structure_); |
1632 callback_ = base::Callback<void(const FormStructure*)>(); | 1635 callback_ = base::Callback<void(const FormStructure*)>(); |
1633 | 1636 |
1634 if (dialog_type_ == DIALOG_TYPE_REQUEST_AUTOCOMPLETE) { | 1637 if (dialog_type_ == DIALOG_TYPE_REQUEST_AUTOCOMPLETE) { |
1635 // This may delete us. | 1638 // This may delete us. |
1636 Hide(); | 1639 Hide(); |
1637 } | 1640 } |
1638 } | 1641 } |
1639 | 1642 |
1640 } // namespace autofill | 1643 } // namespace autofill |
OLD | NEW |