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

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

Issue 2768093006: [Payments] Desktop: Error message in the dialog. (Closed)
Patch Set: Test Created 3 years, 9 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 f5660203f2403f7c8798ba4605d285f6bd3a7318..a9933f44b882c56edc2533163ba0a8aaa3b49c59 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
+++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h"
+#include "chrome/browser/ui/views/payments/error_message_view_controller.h"
#include "chrome/browser/ui/views/payments/order_summary_view_controller.h"
#include "chrome/browser/ui/views/payments/payment_method_view_controller.h"
#include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
@@ -95,6 +96,26 @@ int PaymentRequestDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_NONE;
}
+void PaymentRequestDialogView::ShowDialog() {
+ constrained_window::ShowWebModalDialogViews(this, request_->web_contents());
+}
+
+void PaymentRequestDialogView::CloseDialog() {
+ // This calls PaymentRequestDialogView::Cancel() before closing.
+ // ViewHierarchyChanged() also gets called after Cancel().
+ GetWidget()->Close();
+}
+
+void PaymentRequestDialogView::ShowErrorMessage() {
+ view_stack_.Push(CreateViewAndInstallController(
+ base::MakeUnique<ErrorMessageViewController>(
+ request_->spec(), request_->state(), this),
+ &controller_map_),
+ /* animate = */ false);
+ if (observer_for_testing_)
+ observer_for_testing_->OnErrorMessageShown();
+}
+
void PaymentRequestDialogView::Pay() {
request_->Pay();
}
@@ -181,16 +202,6 @@ void PaymentRequestDialogView::EditorViewUpdated() {
observer_for_testing_->OnEditorViewUpdated();
}
-void PaymentRequestDialogView::ShowDialog() {
- constrained_window::ShowWebModalDialogViews(this, request_->web_contents());
-}
-
-void PaymentRequestDialogView::CloseDialog() {
- // This calls PaymentRequestDialogView::Cancel() before closing.
- // ViewHierarchyChanged() also gets called after Cancel().
- GetWidget()->Close();
-}
-
void PaymentRequestDialogView::ShowInitialPaymentSheet() {
view_stack_.Push(CreateViewAndInstallController(
base::MakeUnique<PaymentSheetViewController>(

Powered by Google App Engine
This is Rietveld 408576698