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_row_view.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/views/background.h" | 9 #include "ui/views/background.h" |
10 #include "ui/views/border.h" | 10 #include "ui/views/border.h" |
11 | 11 |
12 namespace payments { | 12 namespace payments { |
13 | 13 |
14 PaymentRequestRowView::PaymentRequestRowView( | 14 PaymentRequestRowView::PaymentRequestRowView( |
15 views::ButtonListener* listener) | 15 views::ButtonListener* listener) |
16 : views::CustomButton(listener) { | 16 : views::CustomButton(listener) { |
17 SetBorder(payments::CreatePaymentRequestRowBorder()); | 17 SetBorder(payments::CreatePaymentRequestRowBorder()); |
18 } | 18 } |
19 | 19 |
20 PaymentRequestRowView::~PaymentRequestRowView() {} | 20 PaymentRequestRowView::~PaymentRequestRowView() {} |
21 | 21 |
22 // views::CustomButton: | 22 // views::CustomButton: |
23 void PaymentRequestRowView::StateChanged() { | 23 void PaymentRequestRowView::StateChanged(ButtonState old_state) { |
24 if (state() == views::Button::STATE_HOVERED || | 24 if (state() == views::Button::STATE_HOVERED || |
25 state() == views::Button::STATE_PRESSED) { | 25 state() == views::Button::STATE_PRESSED) { |
26 set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY)); | 26 set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY)); |
27 } else { | 27 } else { |
28 set_background(nullptr); | 28 set_background(nullptr); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 } // namespace payments | 32 } // namespace payments |
OLD | NEW |