| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/app/vector_icons/vector_icons.h" | |
| 13 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | 12 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" |
| 14 #include "components/autofill/core/browser/autofill_profile.h" | 13 #include "components/autofill/core/browser/autofill_profile.h" |
| 15 #include "components/autofill/core/browser/autofill_type.h" | 14 #include "components/autofill/core/browser/autofill_type.h" |
| 16 #include "components/autofill/core/browser/field_types.h" | 15 #include "components/autofill/core/browser/field_types.h" |
| 17 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
| 18 #include "ui/gfx/canvas.h" | 17 #include "ui/gfx/canvas.h" |
| 19 #include "ui/gfx/geometry/insets.h" | 18 #include "ui/gfx/geometry/insets.h" |
| 20 #include "ui/gfx/geometry/point_f.h" | 19 #include "ui/gfx/geometry/point_f.h" |
| 21 #include "ui/gfx/paint_vector_icon.h" | 20 #include "ui/gfx/paint_vector_icon.h" |
| 21 #include "ui/vector_icons/vector_icons.h" |
| 22 #include "ui/views/border.h" | 22 #include "ui/views/border.h" |
| 23 #include "ui/views/bubble/bubble_frame_view.h" | 23 #include "ui/views/bubble/bubble_frame_view.h" |
| 24 #include "ui/views/controls/button/button.h" | 24 #include "ui/views/controls/button/button.h" |
| 25 #include "ui/views/controls/button/vector_icon_button.h" | 25 #include "ui/views/controls/button/vector_icon_button.h" |
| 26 #include "ui/views/controls/label.h" | 26 #include "ui/views/controls/label.h" |
| 27 #include "ui/views/controls/styled_label.h" | 27 #include "ui/views/controls/styled_label.h" |
| 28 #include "ui/views/layout/grid_layout.h" | 28 #include "ui/views/layout/grid_layout.h" |
| 29 #include "ui/views/painter.h" | 29 #include "ui/views/painter.h" |
| 30 #include "ui/views/view.h" | 30 #include "ui/views/view.h" |
| 31 | 31 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 0, views::GridLayout::USE_PREF, 0, 0); | 93 0, views::GridLayout::USE_PREF, 0, 0); |
| 94 // A column for the title. | 94 // A column for the title. |
| 95 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | 95 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, |
| 96 1, views::GridLayout::USE_PREF, 0, 0); | 96 1, views::GridLayout::USE_PREF, 0, 0); |
| 97 | 97 |
| 98 layout->StartRow(0, 0); | 98 layout->StartRow(0, 0); |
| 99 if (!show_back_arrow) { | 99 if (!show_back_arrow) { |
| 100 layout->SkipColumns(1); | 100 layout->SkipColumns(1); |
| 101 } else { | 101 } else { |
| 102 views::VectorIconButton* back_arrow = new views::VectorIconButton(delegate); | 102 views::VectorIconButton* back_arrow = new views::VectorIconButton(delegate); |
| 103 back_arrow->SetIcon(kNavigateBackIcon); | 103 back_arrow->SetIcon(ui::kBackArrowIcon); |
| 104 back_arrow->SetSize(back_arrow->GetPreferredSize()); | 104 back_arrow->SetSize(back_arrow->GetPreferredSize()); |
| 105 back_arrow->set_tag(static_cast<int>( | 105 back_arrow->set_tag(static_cast<int>( |
| 106 PaymentRequestCommonTags::BACK_BUTTON_TAG)); | 106 PaymentRequestCommonTags::BACK_BUTTON_TAG)); |
| 107 layout->AddView(back_arrow); | 107 layout->AddView(back_arrow); |
| 108 } | 108 } |
| 109 | 109 |
| 110 views::Label* title_label = new views::Label(title); | 110 views::Label* title_label = new views::Label(title); |
| 111 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 111 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 112 layout->AddView(title_label); | 112 layout->AddView(title_label); |
| 113 | 113 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 // Creates a views::Border object that can paint the gray horizontal ruler used | 183 // Creates a views::Border object that can paint the gray horizontal ruler used |
| 184 // as a separator between items in the Payment Request dialog. | 184 // as a separator between items in the Payment Request dialog. |
| 185 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder() { | 185 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder() { |
| 186 return views::CreateBorderPainter( | 186 return views::CreateBorderPainter( |
| 187 base::MakeUnique<PaymentRequestRowBorderPainter>(), | 187 base::MakeUnique<PaymentRequestRowBorderPainter>(), |
| 188 gfx::Insets()); | 188 gfx::Insets()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace payments | 191 } // namespace payments |
| OLD | NEW |