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

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

Issue 15697010: Autofill:requestAutocomplete: Enable prompting for complete address when instrument being used does… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to head instead of using lkgr Created 7 years, 7 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/data_model_wrapper.cc
diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc
index 418f4cb01f5721c4ad5dd27c0e41dc04809683b2..a0fafe856e7e79d77414066c81b4f2146a775a01 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper.cc
+++ b/chrome/browser/ui/autofill/data_model_wrapper.cc
@@ -162,6 +162,13 @@ string16 WalletAddressWrapper::GetInfo(AutofillFieldType type) {
return address_->GetInfo(type, g_browser_process->GetApplicationLocale());
}
+string16 WalletAddressWrapper::GetDisplayText() {
+ if (!address_->is_complete_address())
+ return string16();
+
+ return DataModelWrapper::GetDisplayText();
+}
+
// WalletInstrumentWrapper
WalletInstrumentWrapper::WalletInstrumentWrapper(
@@ -183,8 +190,10 @@ gfx::Image WalletInstrumentWrapper::GetIcon() {
string16 WalletInstrumentWrapper::GetDisplayText() {
// TODO(dbeam): handle other instrument statuses? http://crbug.com/233048
- if (instrument_->status() == wallet::WalletItems::MaskedInstrument::EXPIRED)
+ if (instrument_->status() == wallet::WalletItems::MaskedInstrument::EXPIRED ||
+ !instrument_->address().is_complete_address()) {
return string16();
+ }
// TODO(estade): descriptive_name() is user-provided. Should we use it or
// just type + last 4 digits?
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.h ('k') | components/autofill/browser/wallet/wallet_address.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698