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

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

Issue 2768133002: [Web Payments] Refactor sheet display to allow updating view content (Closed)
Patch Set: Add comments. 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_method_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
index 2660e0483a0b3eace801d06bb479a7fbe6ee620e..1bdb8dcdc563f8fc868726f4afedb82861ca0fcf 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -24,6 +24,7 @@
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/layout/box_layout.h"
+#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/vector_icons.h"
@@ -129,18 +130,18 @@ PaymentMethodViewController::PaymentMethodViewController(
PaymentMethodViewController::~PaymentMethodViewController() {}
-std::unique_ptr<views::View> PaymentMethodViewController::CreateView() {
+base::string16 PaymentMethodViewController::GetSheetTitle() {
+ return l10n_util::GetStringUTF16(
+ IDS_PAYMENT_REQUEST_PAYMENT_METHOD_SECTION_NAME);
+}
+
+void PaymentMethodViewController::FillContentView(views::View* content_view) {
+ content_view->SetLayoutManager(new views::FillLayout);
std::unique_ptr<views::View> list_view =
payment_method_list_.CreateListView();
list_view->set_id(
static_cast<int>(DialogViewID::PAYMENT_METHOD_SHEET_LIST_VIEW));
- return CreatePaymentView(
- CreateSheetHeaderView(
- true,
- l10n_util::GetStringUTF16(
- IDS_PAYMENT_REQUEST_PAYMENT_METHOD_SECTION_NAME),
- this),
- std::move(list_view));
+ content_view->AddChildView(list_view.release());
}
std::unique_ptr<views::View>

Powered by Google App Engine
This is Rietveld 408576698