OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_item_list.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_item_list.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" |
8 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" | 8 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" |
9 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 9 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
10 #include "components/payments/content/payment_request_state.h" | 10 #include "components/payments/content/payment_request_state.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 std::unique_ptr<views::View> PaymentRequestItemList::Item::CreateExtraView() { | 68 std::unique_ptr<views::View> PaymentRequestItemList::Item::CreateExtraView() { |
69 return nullptr; | 69 return nullptr; |
70 } | 70 } |
71 | 71 |
72 std::unique_ptr<views::View> PaymentRequestItemList::Item::CreateItemView() { | 72 std::unique_ptr<views::View> PaymentRequestItemList::Item::CreateItemView() { |
73 std::unique_ptr<views::View> content = CreateContentView(); | 73 std::unique_ptr<views::View> content = CreateContentView(); |
74 | 74 |
75 std::unique_ptr<PaymentRequestRowView> row = | 75 std::unique_ptr<PaymentRequestRowView> row = |
76 base::MakeUnique<PaymentRequestRowView>(this); | 76 base::MakeUnique<PaymentRequestRowView>(this, /* clickable= */ true); |
77 views::GridLayout* layout = new views::GridLayout(row.get()); | 77 views::GridLayout* layout = new views::GridLayout(row.get()); |
78 row->SetLayoutManager(layout); | 78 row->SetLayoutManager(layout); |
79 | 79 |
80 layout->SetInsets( | 80 layout->SetInsets( |
81 kPaymentRequestRowVerticalInsets, kPaymentRequestRowHorizontalInsets, | 81 kPaymentRequestRowVerticalInsets, kPaymentRequestRowHorizontalInsets, |
82 kPaymentRequestRowVerticalInsets, | 82 kPaymentRequestRowVerticalInsets, |
83 kPaymentRequestRowHorizontalInsets + kPaymentRequestRowExtraRightInset); | 83 kPaymentRequestRowHorizontalInsets + kPaymentRequestRowExtraRightInset); |
84 | 84 |
85 // Add a column for the item's content view. | 85 // Add a column for the item's content view. |
86 views::ColumnSet* columns = layout->AddColumnSet(0); | 86 views::ColumnSet* columns = layout->AddColumnSet(0); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // It's possible that no item is currently selected, either during list | 164 // It's possible that no item is currently selected, either during list |
165 // creation or in the middle of the selection operation when the previously | 165 // creation or in the middle of the selection operation when the previously |
166 // selected item has been deselected but the new one isn't selected yet. | 166 // selected item has been deselected but the new one isn't selected yet. |
167 if (selected_item_) | 167 if (selected_item_) |
168 selected_item_->SetSelected(/*selected=*/false, /*notify=*/true); | 168 selected_item_->SetSelected(/*selected=*/false, /*notify=*/true); |
169 | 169 |
170 selected_item_ = nullptr; | 170 selected_item_ = nullptr; |
171 } | 171 } |
172 | 172 |
173 } // namespace payments | 173 } // namespace payments |
OLD | NEW |