| 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" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 bool show_back_arrow, | 187 bool show_back_arrow, |
| 188 const base::string16& title, | 188 const base::string16& title, |
| 189 views::ButtonListener* listener) { | 189 views::ButtonListener* listener) { |
| 190 std::unique_ptr<views::View> container = base::MakeUnique<views::View>(); | 190 std::unique_ptr<views::View> container = base::MakeUnique<views::View>(); |
| 191 views::GridLayout* layout = new views::GridLayout(container.get()); | 191 views::GridLayout* layout = new views::GridLayout(container.get()); |
| 192 container->SetLayoutManager(layout); | 192 container->SetLayoutManager(layout); |
| 193 | 193 |
| 194 constexpr int kHeaderTopVerticalInset = 14; | 194 constexpr int kHeaderTopVerticalInset = 14; |
| 195 constexpr int kHeaderBottomVerticalInset = 8; | 195 constexpr int kHeaderBottomVerticalInset = 8; |
| 196 constexpr int kHeaderHorizontalInset = 16; | 196 constexpr int kHeaderHorizontalInset = 16; |
| 197 // Top, left, bottom, right. | 197 container->SetBorder(views::CreateEmptyBorder( |
| 198 layout->SetInsets(kHeaderTopVerticalInset, kHeaderHorizontalInset, | 198 kHeaderTopVerticalInset, kHeaderHorizontalInset, |
| 199 kHeaderBottomVerticalInset, kHeaderHorizontalInset); | 199 kHeaderBottomVerticalInset, kHeaderHorizontalInset)); |
| 200 | 200 |
| 201 views::ColumnSet* columns = layout->AddColumnSet(0); | 201 views::ColumnSet* columns = layout->AddColumnSet(0); |
| 202 // A column for the optional back arrow. | 202 // A column for the optional back arrow. |
| 203 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, | 203 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, |
| 204 0, views::GridLayout::USE_PREF, 0, 0); | 204 0, views::GridLayout::USE_PREF, 0, 0); |
| 205 | 205 |
| 206 constexpr int kPaddingBetweenArrowAndTitle = 16; | 206 constexpr int kPaddingBetweenArrowAndTitle = 16; |
| 207 if (show_back_arrow) | 207 if (show_back_arrow) |
| 208 columns->AddPaddingColumn(0, kPaddingBetweenArrowAndTitle); | 208 columns->AddPaddingColumn(0, kPaddingBetweenArrowAndTitle); |
| 209 | 209 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 383 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 384 amount_label->set_id( | 384 amount_label->set_id( |
| 385 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); | 385 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); |
| 386 container->AddChildView(amount_label.release()); | 386 container->AddChildView(amount_label.release()); |
| 387 } | 387 } |
| 388 | 388 |
| 389 return container; | 389 return container; |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace payments | 392 } // namespace payments |
| OLD | NEW |