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

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

Issue 2804853002: Cancels payment request when Settings is tapped, and opens the Autofill settings page. (Closed)
Patch Set: 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
Index: ios/chrome/browser/payments/payment_request_manager.mm
diff --git a/ios/chrome/browser/payments/payment_request_manager.mm b/ios/chrome/browser/payments/payment_request_manager.mm
index 56fbab0920d246eafb29f94aee59d5d5677583bf..d7cf6e5620c77f68276f495f9593c9712eec73c6 100644
--- a/ios/chrome/browser/payments/payment_request_manager.mm
+++ b/ios/chrome/browser/payments/payment_request_manager.mm
@@ -8,6 +8,7 @@
#include "base/ios/ios_util.h"
#import "base/mac/bind_objc_block.h"
#include "base/mac/foundation_util.h"
+#include "base/mac/scoped_nsobject.h"
#include "base/memory/ptr_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/values.h"
@@ -21,6 +22,9 @@
#include "ios/chrome/browser/payments/payment_request.h"
#import "ios/chrome/browser/payments/payment_request_coordinator.h"
#include "ios/chrome/browser/procedural_block_types.h"
+#import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"
+#import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
+#import "ios/chrome/browser/ui/commands/ios_command_ids.h"
#include "ios/web/public/favicon_status.h"
#include "ios/web/public/navigation_item.h"
#include "ios/web/public/navigation_manager.h"
@@ -539,6 +543,18 @@ const NSTimeInterval kTimeoutInterval = 60.0;
callback:nil];
}
+- (void)paymentRequestCoordinatorDidSelectSettings:
+ (PaymentRequestCoordinator*)coordinator {
+ [self terminateRequestWithErrorMessage:@"The payment request was canceled."
Moe 2017/04/06 05:18:13 While you're at it, please refactor these messages
macourteau 2017/04/06 14:21:22 Done.
+ callback:nil];
Moe 2017/04/06 05:18:13 Could you do the following logic in a callback tha
macourteau 2017/04/06 14:21:22 Done.
+
+ UIWindow* main_window = [[UIApplication sharedApplication] keyWindow];
Moe 2017/04/06 05:18:13 nit: mainWindow
macourteau 2017/04/06 14:21:22 Done.
+ DCHECK(main_window);
+ base::scoped_nsobject<GenericChromeCommand> command(
Moe 2017/04/06 05:18:13 I believe you don't need a base::scoped_nsobject w
macourteau 2017/04/06 14:21:22 Done.
+ [[GenericChromeCommand alloc] initWithTag:IDC_SHOW_AUTOFILL_SETTINGS]);
+ [main_window chromeExecuteCommand:command];
+}
+
- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse {
[_paymentRequestJsManager

Powered by Google App Engine
This is Rietveld 408576698