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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // The dialog that contains and owns this object. | 57 // The dialog that contains and owns this object. |
58 // Caller should not take ownership of the result. | 58 // Caller should not take ownership of the result. |
59 PaymentRequestDialogView* dialog() { return dialog_; } | 59 PaymentRequestDialogView* dialog() { return dialog_; } |
60 | 60 |
61 protected: | 61 protected: |
62 // Clears the content part of the view represented by this view controller and | 62 // Clears the content part of the view represented by this view controller and |
63 // calls FillContentView again to re-populate it with updated views. | 63 // calls FillContentView again to re-populate it with updated views. |
64 void UpdateContentView(); | 64 void UpdateContentView(); |
65 | 65 |
| 66 // Update the focus to |focused_view|. |
| 67 void UpdateFocus(views::View* focused_view); |
| 68 |
66 // View controllers should call this if they have modified some layout aspect | 69 // View controllers should call this if they have modified some layout aspect |
67 // (e.g., made it taller or shorter), and want to relayout the whole pane. | 70 // (e.g., made it taller or shorter), and want to relayout the whole pane. |
68 void RelayoutPane(); | 71 void RelayoutPane(); |
69 | 72 |
70 // Creates and returns the primary action button for this sheet. It's | 73 // Creates and returns the primary action button for this sheet. It's |
71 // typically a blue button with the "Pay" or "Done" labels. Subclasses may | 74 // typically a blue button with the "Pay" or "Done" labels. Subclasses may |
72 // return an empty std::unique_ptr (nullptr) to indicate that no primary | 75 // return an empty std::unique_ptr (nullptr) to indicate that no primary |
73 // button should be displayed. The caller takes ownership of the button but | 76 // button should be displayed. The caller takes ownership of the button but |
74 // the view is guaranteed to be outlived by the controller so subclasses may | 77 // the view is guaranteed to be outlived by the controller so subclasses may |
75 // retain a raw pointer to the returned button (for example to control its | 78 // retain a raw pointer to the returned button (for example to control its |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // targets when subclasses don't want to focus anything else. | 150 // targets when subclasses don't want to focus anything else. |
148 std::unique_ptr<views::Button> primary_button_; | 151 std::unique_ptr<views::Button> primary_button_; |
149 std::unique_ptr<views::Button> secondary_button_; | 152 std::unique_ptr<views::Button> secondary_button_; |
150 | 153 |
151 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); | 154 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); |
152 }; | 155 }; |
153 | 156 |
154 } // namespace payments | 157 } // namespace payments |
155 | 158 |
156 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 159 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
OLD | NEW |