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

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 1977793006: Pressing spacebar on toolbar buttons triggers the ripple effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting changes Created 4 years, 7 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: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 770f92ff16dcf521f4af1e43de27e957f57d1202..527a6d82093dae2edb9635960c47b3ff1a206ccf 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -268,6 +268,10 @@ bool CustomButton::OnKeyPressed(const ui::KeyEvent& event) {
// KeyRelease and Enter clicks the button on KeyPressed.
if (event.key_code() == ui::VKEY_SPACE) {
SetState(STATE_PRESSED);
+ if (ink_drop_delegate_ &&
+ ink_drop_delegate_->GetTargetInkDropState() !=
+ views::InkDropState::ACTION_PENDING)
+ ink_drop_delegate_->OnAction(views::InkDropState::ACTION_PENDING);
} else if (event.key_code() == ui::VKEY_RETURN) {
SetState(STATE_NORMAL);
NotifyClick(event);
« no previous file with comments | « ui/views/animation/test/test_ink_drop_delegate.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698