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

Unified Diff: ios/chrome/browser/payments/credit_card_edit_mediator.mm

Issue 2826593005: [Payment Request] Sever card summary section in the credit card edit form (Closed)
Patch Set: Addressed comments Created 3 years, 8 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
« no previous file with comments | « no previous file | ios/chrome/browser/payments/credit_card_edit_view_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/payments/credit_card_edit_mediator.mm
diff --git a/ios/chrome/browser/payments/credit_card_edit_mediator.mm b/ios/chrome/browser/payments/credit_card_edit_mediator.mm
index 3ae80f7579d1fe5db2cc3563b49c2d6be0348e62..9a9bdb994608ff2d80832f2dad44547d46de3eb3 100644
--- a/ios/chrome/browser/payments/credit_card_edit_mediator.mm
+++ b/ios/chrome/browser/payments/credit_card_edit_mediator.mm
@@ -12,6 +12,7 @@
#import "components/autofill/ios/browser/credit_card_util.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/application_context.h"
+#import "ios/chrome/browser/payments/cells/payment_method_item.h"
#include "ios/chrome/browser/payments/payment_request.h"
#import "ios/chrome/browser/payments/payment_request_editor_field.h"
#import "ios/chrome/browser/payments/payment_request_util.h"
@@ -64,6 +65,22 @@ const CGFloat kCardTypeIconDimension = 25.0;
return self;
}
+- (CollectionViewItem*)serverCardSummaryItem {
+ if (!_creditCard || autofill::IsCreditCardLocal(*_creditCard))
+ return nil;
+
+ PaymentMethodItem* cardSummaryItem = [[PaymentMethodItem alloc] init];
+ cardSummaryItem.methodID =
+ base::SysUTF16ToNSString(_creditCard->TypeAndLastFourDigits());
+ cardSummaryItem.methodDetail = base::SysUTF16ToNSString(
+ _creditCard->GetRawInfo(autofill::CREDIT_CARD_NAME_FULL));
+ const int cardTypeIconID =
+ autofill::data_util::GetPaymentRequestData(_creditCard->type())
+ .icon_resource_id;
+ cardSummaryItem.methodTypeIcon = NativeImage(cardTypeIconID);
+ return cardSummaryItem;
+}
+
- (NSString*)billingAddressLabelForProfileWithGUID:(NSString*)profileGUID {
DCHECK(profileGUID);
autofill::AutofillProfile* profile =
« no previous file with comments | « no previous file | ios/chrome/browser/payments/credit_card_edit_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698