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 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 suggested_shipping_.Reset(); | 1262 suggested_shipping_.Reset(); |
1263 | 1263 |
1264 if (IsPayingWithWallet()) { | 1264 if (IsPayingWithWallet()) { |
1265 if (wallet_items_.get()) { | 1265 if (wallet_items_.get()) { |
1266 // TODO(estade): seems we need to hardcode the email address. | 1266 // TODO(estade): seems we need to hardcode the email address. |
1267 | 1267 |
1268 const std::vector<wallet::Address*>& addresses = | 1268 const std::vector<wallet::Address*>& addresses = |
1269 wallet_items_->addresses(); | 1269 wallet_items_->addresses(); |
1270 for (size_t i = 0; i < addresses.size(); ++i) { | 1270 for (size_t i = 0; i < addresses.size(); ++i) { |
1271 // TODO(dbeam): respect wallet_items_->default_instrument_id(). | 1271 // TODO(dbeam): respect wallet_items_->default_instrument_id(). |
1272 suggested_shipping_.AddKeyedItem(base::IntToString(i), | 1272 suggested_shipping_.AddKeyedItemWithSublabel( |
1273 addresses[i]->DisplayName()); | 1273 base::IntToString(i), |
| 1274 addresses[i]->DisplayName(), |
| 1275 addresses[i]->DisplayNameDetail()); |
1274 } | 1276 } |
1275 | 1277 |
1276 const std::vector<wallet::WalletItems::MaskedInstrument*>& instruments = | 1278 const std::vector<wallet::WalletItems::MaskedInstrument*>& instruments = |
1277 wallet_items_->instruments(); | 1279 wallet_items_->instruments(); |
1278 for (size_t i = 0; i < instruments.size(); ++i) { | 1280 for (size_t i = 0; i < instruments.size(); ++i) { |
1279 // TODO(dbeam): respect wallet_items_->default_address_id(). | 1281 // TODO(dbeam): respect wallet_items_->default_address_id(). |
1280 suggested_cc_billing_.AddKeyedItemWithIcon( | 1282 suggested_cc_billing_.AddKeyedItemWithSublabelAndIcon( |
1281 base::IntToString(i), | 1283 base::IntToString(i), |
1282 instruments[i]->descriptive_name(), | 1284 instruments[i]->DisplayName(), |
| 1285 instruments[i]->DisplayNameDetail(), |
1283 instruments[i]->CardIcon()); | 1286 instruments[i]->CardIcon()); |
1284 } | 1287 } |
1285 } | 1288 } |
1286 | 1289 |
1287 suggested_cc_billing_.AddKeyedItem( | 1290 suggested_cc_billing_.AddKeyedItem( |
1288 std::string(), | 1291 std::string(), |
1289 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_BILLING_DETAILS)); | 1292 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADD_BILLING_DETAILS)); |
1290 } else { | 1293 } else { |
1291 PersonalDataManager* manager = GetManager(); | 1294 PersonalDataManager* manager = GetManager(); |
1292 const std::vector<CreditCard*>& cards = manager->credit_cards(); | 1295 const std::vector<CreditCard*>& cards = manager->credit_cards(); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 callback_.Run(&form_structure_); | 1659 callback_.Run(&form_structure_); |
1657 callback_ = base::Callback<void(const FormStructure*)>(); | 1660 callback_ = base::Callback<void(const FormStructure*)>(); |
1658 | 1661 |
1659 if (dialog_type_ == DIALOG_TYPE_REQUEST_AUTOCOMPLETE) { | 1662 if (dialog_type_ == DIALOG_TYPE_REQUEST_AUTOCOMPLETE) { |
1660 // This may delete us. | 1663 // This may delete us. |
1661 Hide(); | 1664 Hide(); |
1662 } | 1665 } |
1663 } | 1666 } |
1664 | 1667 |
1665 } // namespace autofill | 1668 } // namespace autofill |
OLD | NEW |