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

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

Issue 2853163002: [Web Payments] Implement proper focusing in Payment Request (Closed)
Patch Set: Allow ViewControllers to specify their first focused view Created 3 years, 8 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
index 05cdb38e999b986af13264bd56ce0a44a993ae1d..a613e77efa4a9e9c637355ede7f1cd4be62deadf 100644
--- a/chrome/browser/ui/views/payments/payment_request_row_view.cc
+++ b/chrome/browser/ui/views/payments/payment_request_row_view.cc
@@ -16,6 +16,7 @@ PaymentRequestRowView::PaymentRequestRowView(views::ButtonListener* listener,
: views::CustomButton(listener), clickable_(clickable) {
SetEnabled(clickable_);
SetBorder(payments::CreatePaymentRequestRowBorder());
+ SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
}
PaymentRequestRowView::~PaymentRequestRowView() {}
@@ -30,4 +31,18 @@ void PaymentRequestRowView::StateChanged(ButtonState old_state) {
}
}
+void PaymentRequestRowView::OnFocus() {
+ if (clickable_) {
+ set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY));
Mathieu 2017/05/02 13:16:10 We should get the proper color from the theme to u
anthonyvd 2017/05/02 13:43:32 Oh good call! Done.
+ SchedulePaint();
+ }
+}
+
+void PaymentRequestRowView::OnBlur() {
+ if (clickable_) {
+ set_background(nullptr);
+ SchedulePaint();
+ }
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698