OLD | NEW |
---|---|
(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_request_views_util.h" | |
6 | |
7 #include "base/strings/utf_string_conversions.h" | |
please use gerrit instead
2016/12/15 19:11:15
Not used.
anthonyvd
2016/12/15 19:55:06
Done.
| |
8 #include "ui/views/background.h" | |
9 #include "ui/views/controls/button/md_text_button.h" | |
please use gerrit instead
2016/12/15 19:11:15
Not used.
anthonyvd
2016/12/15 19:55:06
Done.
| |
10 #include "ui/views/controls/label.h" | |
11 #include "ui/views/layout/fill_layout.h" | |
please use gerrit instead
2016/12/15 19:11:15
Not used.
anthonyvd
2016/12/15 19:55:06
Done.
| |
12 #include "ui/views/layout/grid_layout.h" | |
13 | |
14 namespace payments { | |
15 | |
16 std::unique_ptr<views::View> CreatePaymentView( | |
17 const base::string16& title, views::View* content_view) { | |
18 std::unique_ptr<views::View> view = base::MakeUnique<views::View>(); | |
please use gerrit instead
2016/12/15 19:11:15
#include "base/memory/ptr_util.h"
#inclued "ui/vie
anthonyvd
2016/12/15 19:55:06
Done.
| |
19 view->set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); | |
please use gerrit instead
2016/12/15 19:11:15
#inclued "third_party/skia/include/core/SkColor.h"
anthonyvd
2016/12/15 19:55:06
Done.
| |
20 | |
21 // Paint the sheets to layers, otherwise the MD buttons (which do paint to a | |
22 // layer) won't do proper clipping. | |
23 view->SetPaintToLayer(true); | |
24 | |
25 views::GridLayout* layout = new views::GridLayout(view.get()); | |
26 view->SetLayoutManager(layout); | |
27 views::ColumnSet* columns = layout->AddColumnSet(0); | |
28 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | |
29 1, views::GridLayout::USE_PREF, 0, 0); | |
30 | |
31 layout->StartRow(0, 0); | |
32 layout->AddView(new views::Label(title)); | |
33 | |
34 layout->StartRow(0, 0); | |
35 layout->AddView(content_view); | |
36 | |
37 return view; | |
38 } | |
39 | |
40 } // namespace payments | |
OLD | NEW |