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

Side by Side Diff: chrome/browser/payments/ui/payment_request_dialog.cc

Issue 2446093004: [Web Payments] Initial plumb of Payment Request dialog (Closed)
Patch Set: Minor responses Created 4 years, 1 month 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 "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/payments/ui/payment_request_dialog.h"
7 #include "ui/views/layout/fill_layout.h"
8
9 namespace payments {
10
11 PaymentRequestDialog::PaymentRequestDialog(
12 payments::mojom::PaymentRequestClientPtr client)
13 : client_(std::move(client)),
14 label_(new views::Label(base::ASCIIToUTF16("Payments dialog"))) {
Lei Zhang 2016/11/16 00:59:33 I assume the string will be internationalized late
Kevin Bailey 2016/11/16 14:13:47 It's just a placeholder. I vaguely recall that the
15 SetLayoutManager(new views::FillLayout());
16 AddChildView(label_.get());
17 }
18
19 PaymentRequestDialog::~PaymentRequestDialog() {}
20
21 ui::ModalType PaymentRequestDialog::GetModalType() const {
22 return ui::MODAL_TYPE_CHILD;
23 }
24
25 gfx::Size PaymentRequestDialog::GetPreferredSize() const {
26 gfx::Size ps = label_->GetPreferredSize();
27 ps.Enlarge(200, 200);
28 return ps;
29 }
30
31 bool PaymentRequestDialog::Cancel() {
32 client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL);
33 return true;
34 }
35
36 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698