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

Unified Diff: chrome/browser/ui/views/payments/payment_request_dialog_view.cc

Issue 2817533006: [Web Payments] Add PopMany and Size functions to ViewStack (Closed)
Patch Set: Remove unused Observer that caused use-after-free in tests. 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: chrome/browser/ui/views/payments/payment_request_dialog_view.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
index eb88d2fea5b15b3b9ac5993e2952269ded2173d1..a43851a04120571ab6d3a6fb7f2f67e56f79a631 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
+++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -152,6 +152,16 @@ void PaymentRequestDialogView::GoBack() {
observer_for_testing_->OnBackNavigation();
}
+void PaymentRequestDialogView::GoBackToPaymentSheet() {
+ // This assumes that the Payment Sheet is the first view in the stack. Thus if
+ // there is only one view, we are already showing the payment sheet.
+ if (view_stack_->size() > 1)
+ view_stack_->PopMany(view_stack_->size() - 1);
+
+ if (observer_for_testing_)
+ observer_for_testing_->OnBackToPaymentSheetNavigation();
+}
+
void PaymentRequestDialogView::ShowContactProfileSheet() {
view_stack_->Push(
CreateViewAndInstallController(

Powered by Google App Engine
This is Rietveld 408576698