OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/app/vector_icons/vector_icons.h" |
8 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | 9 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
10 #include "ui/gfx/vector_icons_public.h" | |
11 #include "ui/views/background.h" | 11 #include "ui/views/background.h" |
12 #include "ui/views/bubble/bubble_frame_view.h" | 12 #include "ui/views/bubble/bubble_frame_view.h" |
13 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
14 #include "ui/views/controls/button/vector_icon_button.h" | 14 #include "ui/views/controls/button/vector_icon_button.h" |
15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
16 #include "ui/views/layout/grid_layout.h" | 16 #include "ui/views/layout/grid_layout.h" |
17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
18 | 18 |
19 namespace payments { | 19 namespace payments { |
20 | 20 |
(...skipping 14 matching lines...) Expand all Loading... |
35 1, views::GridLayout::USE_PREF, 0, 0); | 35 1, views::GridLayout::USE_PREF, 0, 0); |
36 // A column for the close button. | 36 // A column for the close button. |
37 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 37 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, |
38 0, views::GridLayout::USE_PREF, 0, 0); | 38 0, views::GridLayout::USE_PREF, 0, 0); |
39 | 39 |
40 layout->StartRow(0, 0); | 40 layout->StartRow(0, 0); |
41 if (!show_back_arrow) { | 41 if (!show_back_arrow) { |
42 layout->SkipColumns(1); | 42 layout->SkipColumns(1); |
43 } else { | 43 } else { |
44 views::VectorIconButton* back_arrow = new views::VectorIconButton(delegate); | 44 views::VectorIconButton* back_arrow = new views::VectorIconButton(delegate); |
45 back_arrow->SetIcon(gfx::VectorIconId::NAVIGATE_BACK); | 45 back_arrow->SetIcon(kNavigateBackIcon); |
46 back_arrow->SetSize(back_arrow->GetPreferredSize()); | 46 back_arrow->SetSize(back_arrow->GetPreferredSize()); |
47 back_arrow->set_tag(static_cast<int>( | 47 back_arrow->set_tag(static_cast<int>( |
48 PaymentRequestCommonTags::BACK_BUTTON_TAG)); | 48 PaymentRequestCommonTags::BACK_BUTTON_TAG)); |
49 layout->AddView(back_arrow); | 49 layout->AddView(back_arrow); |
50 } | 50 } |
51 | 51 |
52 views::Label* title_label = new views::Label(title); | 52 views::Label* title_label = new views::Label(title); |
53 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 53 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
54 layout->AddView(title_label); | 54 layout->AddView(title_label); |
55 views::Button* close_button = | 55 views::Button* close_button = |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 layout->AddView(header_view.release()); | 89 layout->AddView(header_view.release()); |
90 | 90 |
91 layout->StartRow(0, 0); | 91 layout->StartRow(0, 0); |
92 // |content_view| will be deleted when |view| is. | 92 // |content_view| will be deleted when |view| is. |
93 layout->AddView(content_view.release()); | 93 layout->AddView(content_view.release()); |
94 | 94 |
95 return view; | 95 return view; |
96 } | 96 } |
97 | 97 |
98 } // namespace payments | 98 } // namespace payments |
OLD | NEW |