Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4432)

Unified Diff: chrome/browser/ui/views/payments/payment_request_row_view.cc

Issue 2656853002: [Web Payments] Refactor the row display code. (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_request_row_view.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_row_view.cc b/chrome/browser/ui/views/payments/payment_request_row_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..28365b91bb674ef049058ce26e82ee0f8bd97178
--- /dev/null
+++ b/chrome/browser/ui/views/payments/payment_request_row_view.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/payments/payment_request_row_view.h"
+
+#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/views/background.h"
+#include "ui/views/border.h"
+
+namespace payments {
+
+PaymentRequestRowView::PaymentRequestRowView(
+ views::ButtonListener* listener)
+ : views::CustomButton(listener) {
+ SetBorder(payments::CreatePaymentRequestRowBorder());
+}
+
+PaymentRequestRowView::~PaymentRequestRowView() {}
+
+// views::CustomButton:
+void PaymentRequestRowView::StateChanged() {
+ if (state() == views::Button::STATE_HOVERED ||
+ state() == views::Button::STATE_PRESSED) {
+ set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY));
+ } else {
+ set_background(nullptr);
+ }
+}
+
+} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698