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

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

Issue 2710683012: [Payment Request] Payment request summary view pending state (Closed)
Patch Set: rebase Created 3 years, 10 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: ios/chrome/browser/payments/payment_request_view_controller.mm
diff --git a/ios/chrome/browser/payments/payment_request_view_controller.mm b/ios/chrome/browser/payments/payment_request_view_controller.mm
index 0e2ce217c067cd1f7cff7e1e88d15c1abdec566f..e698c6ab0eabee0d7be8a67ac69790ca62f090b9 100644
--- a/ios/chrome/browser/payments/payment_request_view_controller.mm
+++ b/ios/chrome/browser/payments/payment_request_view_controller.mm
@@ -20,6 +20,7 @@
#import "ios/chrome/browser/payments/cells/price_item.h"
#import "ios/chrome/browser/payments/cells/shipping_address_item.h"
#import "ios/chrome/browser/payments/payment_request_util.h"
+#import "ios/chrome/browser/ui/autofill/cells/status_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
@@ -61,6 +62,7 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) {
typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeSummaryPageInfo = kItemTypeEnumZero,
+ ItemTypeSpinner,
ItemTypeSummaryTotal,
ItemTypeShippingTitle,
ItemTypeShippingAddress,
@@ -102,6 +104,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
@synthesize pageFavicon = _pageFavicon;
@synthesize pageTitle = _pageTitle;
@synthesize pageHost = _pageHost;
+@synthesize pending = _pending;
@synthesize delegate = _delegate;
- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest {
@@ -191,6 +194,16 @@ typedef NS_ENUM(NSInteger, ItemType) {
pageInfo.pageHost = _pageHost;
[model setHeader:pageInfo forSectionWithIdentifier:SectionIdentifierSummary];
+ if (_pending) {
+ [_payButton setEnabled:NO];
+ [_cancelButton setEnabled:NO];
+
+ StatusItem* statusItem = [[StatusItem alloc] initWithType:ItemTypeSpinner];
+ statusItem.text = l10n_util::GetNSString(IDS_PAYMENTS_PROCESSING_MESSAGE);
+ [model addItem:statusItem toSectionWithIdentifier:SectionIdentifierSummary];
+ return;
+ }
+
_paymentSummaryItem = [[PriceItem alloc] initWithType:ItemTypeSummaryTotal];
[self fillPaymentSummaryItem:_paymentSummaryItem
withPaymentItem:_paymentRequest->payment_details().total
@@ -458,6 +471,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
CollectionViewItem* item =
[self.collectionViewModel itemAtIndexPath:indexPath];
switch (item.type) {
+ case ItemTypeSpinner:
case ItemTypeShippingAddress:
case ItemTypePaymentMethod:
return [MDCCollectionViewCell

Powered by Google App Engine
This is Rietveld 408576698