Commit 9e012b0a authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Add property indicating if CWVCreditCard is from Google Pay.

Cards from Google Pay will require special handling.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ia05ff0f31518272a6aaafc6392e730123d805d4a
Reviewed-on: https://chromium-review.googlesource.com/1089581
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565327}
parent ab8ee841
......@@ -135,10 +135,12 @@ class WebViewPersonalDataManagerObserverBridge
}
- (void)updateCreditCard:(CWVCreditCard*)creditCard {
DCHECK(!creditCard.fromGooglePay);
_personalDataManager->UpdateCreditCard(*creditCard.internalCard);
}
- (void)deleteCreditCard:(CWVCreditCard*)creditCard {
DCHECK(!creditCard.fromGooglePay);
_personalDataManager->RemoveByGUID(creditCard.internalCard->guid());
}
......
......@@ -84,8 +84,8 @@
return base::SysUTF8ToNSString(_internalCard.bank_name());
}
- (BOOL)isSavedLocally {
return _internalCard.record_type() == autofill::CreditCard::LOCAL_CARD;
- (BOOL)isFromGooglePay {
return _internalCard.record_type() != autofill::CreditCard::LOCAL_CARD;
}
#pragma mark - Internal
......
......@@ -30,9 +30,9 @@ CWV_EXPORT
@property(nonatomic, copy, nullable) NSString* expirationYear;
// The issuing bank of this card. "Chase", "Bank of America".
@property(nonatomic, copy, nullable, readonly) NSString* bankName;
// Storage type for this card. |YES| if this card is purely local, or a local
// copy of a remote card.
@property(nonatomic, readonly, getter=isSavedLocally) BOOL savedLocally;
// If a card comes from Google Payments, it can only be edited or deleted by
// visiting https://payments.google.com.
@property(nonatomic, readonly, getter=isFromGooglePay) BOOL fromGooglePay;
- (instancetype)init NS_UNAVAILABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment