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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 12755019: Add 2-lines summary to CC/Address for Wallet items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 56bdcdff61a28cc5f386c74a60a397833eff0b48..2d780b9dc558e6c93dd38607276146899c2c75a1 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -60,6 +60,10 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/skbitmap_operations.h"
+#if defined(OS_ANDROID)
+ #define ENABLE_TWO_LINE_SUGGESTIONS 1
+#endif // defined(OS_ANDROID)
+
namespace autofill {
namespace {
@@ -1179,17 +1183,33 @@ void AutofillDialogControllerImpl::GenerateSuggestionsModels() {
const std::vector<wallet::Address*>& addresses =
wallet_items_->addresses();
for (size_t i = 0; i < addresses.size(); ++i) {
+#if ENABLE_TWO_LINE_SUGGESTIONS
+ suggested_shipping_.AddKeyedItemWithSublabel(
+ base::IntToString(i),
+ addresses[i]->DisplaySummaryLine1(),
+ addresses[i]->DisplaySummaryLine2());
+#else
suggested_shipping_.AddKeyedItem(base::IntToString(i),
addresses[i]->DisplayName());
+#endif
}
const std::vector<wallet::WalletItems::MaskedInstrument*>& instruments =
wallet_items_->instruments();
for (size_t i = 0; i < instruments.size(); ++i) {
+#if ENABLE_TWO_LINE_SUGGESTIONS
+ // TODO(aruslan): improve this stub implementation.
+ suggested_cc_billing_.AddKeyedItemWithSublabelAndIcon(
+ base::IntToString(i),
+ instruments[i]->DisplaySummaryLine1(),
+ instruments[i]->DisplaySummaryLine2(),
+ instruments[i]->CardIcon());
+#else
suggested_cc_billing_.AddKeyedItemWithIcon(
base::IntToString(i),
instruments[i]->descriptive_name(),
instruments[i]->CardIcon());
+#endif
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_models.h » ('j') | components/autofill/browser/wallet/wallet_items.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698