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

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

Issue 2789093002: [Payments] Desktop: implement shipping address/option change (Closed)
Patch Set: compile fix 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/order_summary_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
index 1da6a0c68659722a481e7749159b21661cdd27a9..bf26264816d6fcfb168e111f407e5ae8f034bd50 100644
--- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc
+++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -16,7 +16,6 @@
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
#include "chrome/grit/generated_resources.h"
-#include "components/payments/content/payment_request_spec.h"
#include "components/payments/core/currency_formatter.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -88,13 +87,23 @@ OrderSummaryViewController::OrderSummaryViewController(
PaymentRequestState* state,
PaymentRequestDialogView* dialog)
: PaymentRequestSheetController(spec, state, dialog), pay_button_(nullptr) {
+ spec->AddObserver(this);
state->AddObserver(this);
}
OrderSummaryViewController::~OrderSummaryViewController() {
+ spec()->RemoveObserver(this);
state()->RemoveObserver(this);
}
+void OrderSummaryViewController::OnSpecUpdated() {
+ UpdateContentView();
+}
+
+void OrderSummaryViewController::OnSelectedInformationChanged() {
+ UpdatePayButtonState(state()->is_ready_to_pay());
+}
+
std::unique_ptr<views::Button>
OrderSummaryViewController::CreatePrimaryButton() {
std::unique_ptr<views::Button> button(
@@ -149,10 +158,6 @@ void OrderSummaryViewController::FillContentView(views::View* content_view) {
.release());
}
-void OrderSummaryViewController::OnSelectedInformationChanged() {
- UpdatePayButtonState(state()->is_ready_to_pay());
-}
-
void OrderSummaryViewController::UpdatePayButtonState(bool enabled) {
pay_button_->SetEnabled(enabled);
}

Powered by Google App Engine
This is Rietveld 408576698