Chromium Code Reviews| Index: ui/views/controls/link.cc |
| diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc |
| index e61140f007658c6345e95910d1ed2e576b1b6495..ab4d007655518d9322de1a8a2d2dac58cd056902 100644 |
| --- a/ui/views/controls/link.cc |
| +++ b/ui/views/controls/link.cc |
| @@ -20,6 +20,7 @@ |
| #include "ui/native_theme/native_theme.h" |
| #include "ui/views/controls/link_listener.h" |
| #include "ui/views/native_cursor.h" |
| +#include "ui/views/style/platform_style.h" |
| namespace views { |
| @@ -90,7 +91,8 @@ void Link::OnMouseCaptureLost() { |
| bool Link::OnKeyPressed(const ui::KeyEvent& event) { |
| bool activate = (((event.key_code() == ui::VKEY_SPACE) && |
| (event.flags() & ui::EF_ALT_DOWN) == 0) || |
| - (event.key_code() == ui::VKEY_RETURN)); |
| + (event.key_code() == ui::VKEY_RETURN && |
| + PlatformStyle::kReturnClicksFocusedControl)); |
| if (!activate) |
| return false; |
| @@ -123,9 +125,11 @@ void Link::OnGestureEvent(ui::GestureEvent* event) { |
| } |
| bool Link::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
| - // Make sure we don't process space or enter as accelerators. |
| + // Don't process Space and Return (depending on the platform) as an |
| + // accelerator. |
| return (event.key_code() == ui::VKEY_SPACE) || |
|
tapted
2017/01/05 02:26:54
nit: the parens around this `==` look odd
karandeepb
2017/01/05 11:15:40
Done.
|
| - (event.key_code() == ui::VKEY_RETURN); |
| + (event.key_code() == ui::VKEY_RETURN && |
| + PlatformStyle::kReturnClicksFocusedControl); |
| } |
| void Link::GetAccessibleNodeData(ui::AXNodeData* node_data) { |