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

Side by Side Diff: chrome/browser/ui/views/payments/payment_method_view_controller.cc

Issue 2621153002: [WebPayments] Add the Payment Method section in the Payment Sheet (Closed)
Patch Set: Initial patch Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h"
6
7 #include <memory>
8 #include <utility>
9
10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h"
12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/ui/views/payments/payment_request_dialog.h"
14 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
15 #include "components/payments/payment_request.h"
16 #include "components/strings/grit/components_strings.h"
17 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/views/controls/label.h"
Mathieu 2017/01/12 21:27:10 need?
anthonyvd 2017/01/13 16:09:18 Nope, done.
19 #include "ui/views/layout/grid_layout.h"
20 #include "ui/views/view.h"
21
22 namespace payments {
23
24 PaymentMethodViewController::PaymentMethodViewController(
25 PaymentRequest* request, PaymentRequestDialog* dialog)
please use gerrit instead 2017/01/12 19:34:02 Parameter names should match in header and source.
anthonyvd 2017/01/13 16:09:18 Done.
26 : PaymentRequestSheetController(request, dialog) {}
27
28 PaymentMethodViewController::~PaymentMethodViewController() {}
29
30 std::unique_ptr<views::View> PaymentMethodViewController::CreateView() {
31 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
32
33 // TODO(anthonyvd): populate this view.
34
35 return payments::CreatePaymentView(
Mathieu 2017/01/12 21:27:10 do you need payments:: ?
anthonyvd 2017/01/13 16:09:18 Nope, done.
36 CreateSheetHeaderView(
37 true,
38 l10n_util::GetStringUTF16(
39 IDS_PAYMENT_REQUEST_PAYMENT_METHOD_SECTION_NAME),
40 this),
41 std::move(content_view));
42 }
43
44 void PaymentMethodViewController::ButtonPressed(
45 views::Button* sender, const ui::Event& event) {
46 switch (sender->tag()) {
47 case static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG):
48 dialog()->CloseDialog();
49 break;
50 case static_cast<int>(PaymentRequestCommonTags::BACK_BUTTON_TAG):
51 dialog()->GoBack();
52 break;
53 default:
54 NOTREACHED();
55 }
56 }
57
58 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698