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

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

Issue 2701923003: [Payment Request] Error message screen (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_error_coordinator.mm
diff --git a/ios/chrome/browser/payments/payment_request_error_coordinator.mm b/ios/chrome/browser/payments/payment_request_error_coordinator.mm
new file mode 100644
index 0000000000000000000000000000000000000000..59cb206ed06bb5fca94f50180829f0937db48ef1
--- /dev/null
+++ b/ios/chrome/browser/payments/payment_request_error_coordinator.mm
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/payments/payment_request_error_coordinator.h"
+
+#include "components/strings/grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface PaymentRequestErrorCoordinator () {
+ PaymentRequestErrorViewController* _viewController;
+}
+
+@end
+
+@implementation PaymentRequestErrorCoordinator
+
+@synthesize callback = _callback;
+@synthesize delegate = _delegate;
+
+- (void)start {
+ _viewController = [[PaymentRequestErrorViewController alloc] init];
+ [_viewController
+ setErrorMessage:l10n_util::GetNSString(IDS_PAYMENTS_ERROR_MESSAGE)];
+ [_viewController setDelegate:self];
+ [_viewController loadModel];
+
+ [[self baseViewController] presentViewController:_viewController
+ animated:YES
+ completion:nil];
+}
+
+- (void)stop {
+ [[_viewController presentingViewController]
+ dismissViewControllerAnimated:YES
+ completion:nil];
+ _viewController = nil;
+}
+
+#pragma mark - PaymentRequestErrorViewControllerDelegate
+
+- (void)paymentRequestErrorViewControllerDidDismiss:
+ (PaymentRequestErrorViewController*)controller {
+ [_delegate paymentRequestErrorCoordinatorDidDismiss:self];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698