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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper.cc

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Edits Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/data_model_wrapper.h" 5 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 185 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
186 return rb.GetImageNamed(CreditCard::IconResourceId(card_->type())); 186 return rb.GetImageNamed(CreditCard::IconResourceId(card_->type()));
187 } 187 }
188 188
189 bool AutofillCreditCardWrapper::GetDisplayText( 189 bool AutofillCreditCardWrapper::GetDisplayText(
190 base::string16* vertically_compact, 190 base::string16* vertically_compact,
191 base::string16* horizontally_compact) { 191 base::string16* horizontally_compact) {
192 if (!card_->IsValid()) 192 if (!card_->IsValid())
193 return false; 193 return false;
194 194
195 *vertically_compact = *horizontally_compact = card_->TypeAndLastFourDigits(); 195 *vertically_compact = *horizontally_compact =
196 card_->TypeAndLastFourDigitsForDisplay();
196 return true; 197 return true;
197 } 198 }
198 199
199 const std::string& AutofillCreditCardWrapper::GetLanguageCode() const { 200 const std::string& AutofillCreditCardWrapper::GetLanguageCode() const {
200 // Formatting a credit card for display does not depend on language code. 201 // Formatting a credit card for display does not depend on language code.
201 return base::EmptyString(); 202 return base::EmptyString();
202 } 203 }
203 204
204 // I18nAddressDataWrapper 205 // I18nAddressDataWrapper
205 206
(...skipping 17 matching lines...) Expand all
223 } 224 }
224 225
225 return base::UTF8ToUTF16(address_->GetFieldValue(field)); 226 return base::UTF8ToUTF16(address_->GetFieldValue(field));
226 } 227 }
227 228
228 const std::string& I18nAddressDataWrapper::GetLanguageCode() const { 229 const std::string& I18nAddressDataWrapper::GetLanguageCode() const {
229 return address_->language_code; 230 return address_->language_code;
230 } 231 }
231 232
232 } // namespace autofill 233 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698