| 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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 PaymentRequestItemList* list, | 38 PaymentRequestItemList* list, |
| 39 bool selected); | 39 bool selected); |
| 40 ~Item() override; | 40 ~Item() override; |
| 41 | 41 |
| 42 // Gets the view associated with this item. It's owned by this object so | 42 // Gets the view associated with this item. It's owned by this object so |
| 43 // that it can listen to any changes to the underlying model and update the | 43 // that it can listen to any changes to the underlying model and update the |
| 44 // view. | 44 // view. |
| 45 views::View* GetItemView(); | 45 views::View* GetItemView(); |
| 46 | 46 |
| 47 bool selected() const { return selected_; } | 47 bool selected() const { return selected_; } |
| 48 // Changes the selected state of this item to |selected| and calls | 48 // Changes the selected state of this item to |selected|. |
| 49 // SelectedStateChanged. | 49 // SelectedStateChanged is called if |notify| is true. |
| 50 void SetSelected(bool selected); | 50 void SetSelected(bool selected, bool notify); |
| 51 | 51 |
| 52 // Returns a pointer to the PaymentRequestItemList that owns this object. | 52 // Returns a pointer to the PaymentRequestItemList that owns this object. |
| 53 PaymentRequestItemList* list() { return list_; } | 53 PaymentRequestItemList* list() { return list_; } |
| 54 | 54 |
| 55 // Returns a pointer to the PaymentRequestSpec/State objects associated with | 55 // Returns a pointer to the PaymentRequestSpec/State objects associated with |
| 56 // this instance of the UI. | 56 // this instance of the UI. |
| 57 PaymentRequestSpec* spec() { return spec_; } | 57 PaymentRequestSpec* spec() { return spec_; } |
| 58 PaymentRequestState* state() { return state_; } | 58 PaymentRequestState* state() { return state_; } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 std::vector<std::unique_ptr<Item>> items_; | 125 std::vector<std::unique_ptr<Item>> items_; |
| 126 Item* selected_item_; | 126 Item* selected_item_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(PaymentRequestItemList); | 128 DISALLOW_COPY_AND_ASSIGN(PaymentRequestItemList); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace payments | 131 } // namespace payments |
| 132 | 132 |
| 133 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ | 133 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ |
| OLD | NEW |