Chromium Code Reviews| 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_ROW_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/views/controls/button/custom_button.h" | 9 #include "ui/views/controls/button/custom_button.h" |
| 10 | 10 |
| 11 namespace payments { | 11 namespace payments { |
| 12 | 12 |
| 13 // This class implements a clickable row of the Payment Request dialog that | 13 // This class implements a clickable row of the Payment Request dialog that |
| 14 // darkens on hover and displays a horizontal ruler on its lower bound. | 14 // darkens on hover and displays a horizontal ruler on its lower bound. |
| 15 class PaymentRequestRowView : public views::CustomButton { | 15 class PaymentRequestRowView : public views::CustomButton { |
| 16 public: | 16 public: |
| 17 // Creates a row view. If |clickable| is true, the row will be shaded on hover | 17 // Creates a row view. If |clickable| is true, the row will be shaded on hover |
| 18 // and handle click events. | 18 // and handle click events. |
| 19 PaymentRequestRowView(views::ButtonListener* listener, bool clickable); | 19 PaymentRequestRowView(views::ButtonListener* listener, |
| 20 bool clickable, | |
| 21 const gfx::Insets& insets); | |
|
sky
2017/05/07 22:26:14
Document what insets is used for.
Bret
2017/05/09 22:03:09
Done.
| |
| 20 ~PaymentRequestRowView() override; | 22 ~PaymentRequestRowView() override; |
| 21 | 23 |
| 22 private: | 24 private: |
| 23 // Sets this row's background to the theme's hovered color to indicate that | 25 // Sets this row's background to the theme's hovered color to indicate that |
| 24 // it's begin hovered or it's focused. | 26 // it's begin hovered or it's focused. |
| 25 void SetActiveBackground(); | 27 void SetActiveBackground(); |
| 26 | 28 |
| 27 // views::CustomButton: | 29 // views::CustomButton: |
| 28 void StateChanged(ButtonState old_state) override; | 30 void StateChanged(ButtonState old_state) override; |
| 29 | 31 |
| 30 // views::View: | 32 // views::View: |
| 31 void OnFocus() override; | 33 void OnFocus() override; |
| 32 void OnBlur() override; | 34 void OnBlur() override; |
| 33 | 35 |
| 34 bool clickable_; | 36 bool clickable_; |
| 35 | 37 |
| 36 DISALLOW_COPY_AND_ASSIGN(PaymentRequestRowView); | 38 DISALLOW_COPY_AND_ASSIGN(PaymentRequestRowView); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 } // namespace payments | 41 } // namespace payments |
| 40 | 42 |
| 41 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ | 43 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ |
| OLD | NEW |