Chromium Code Reviews| Index: chrome/browser/payments/ui/payment_request_dialog.cc |
| diff --git a/chrome/browser/payments/ui/payment_request_dialog.cc b/chrome/browser/payments/ui/payment_request_dialog.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9a268aa640564fc370e6c7e39d7a91af59bccc37 |
| --- /dev/null |
| +++ b/chrome/browser/payments/ui/payment_request_dialog.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/strings/utf_string_conversions.h" |
| +#include "chrome/browser/payments/ui/payment_request_dialog.h" |
| +#include "ui/views/layout/fill_layout.h" |
| + |
| +namespace payments { |
| + |
| +PaymentRequestDialog::PaymentRequestDialog( |
| + payments::mojom::PaymentRequestClientPtr client) |
| + : client_(std::move(client)), |
| + 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
|
| + SetLayoutManager(new views::FillLayout()); |
| + AddChildView(label_.get()); |
| +} |
| + |
| +PaymentRequestDialog::~PaymentRequestDialog() {} |
| + |
| +ui::ModalType PaymentRequestDialog::GetModalType() const { |
| + return ui::MODAL_TYPE_CHILD; |
| +} |
| + |
| +gfx::Size PaymentRequestDialog::GetPreferredSize() const { |
| + gfx::Size ps = label_->GetPreferredSize(); |
| + ps.Enlarge(200, 200); |
| + return ps; |
| +} |
| + |
| +bool PaymentRequestDialog::Cancel() { |
| + client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); |
| + return true; |
| +} |
| + |
| +} // namespace payments |