From 947211d035a701096dfd2641c14c348b897ee8f4 Mon Sep 17 00:00:00 2001 From: "kpschoedel@chromium.org" Date: Fri, 25 Jul 2014 17:10:17 +0000 Subject: Distinguish between keystroke and character events. As described in its class comment, a ui::KeyEvent can be either of two distinct kinds. When constructing a ui::KeyEvent from a native event, the distinction is made by a new IsCharFromNative() call, in the same way that other ui::Event properties are determined, instead of having the caller inspect the native event itself. Removing the redundant |is_char| parameter from constructors also prevent accidental synthetic `mixed' events that consuming code does not handle. Incidentally, while KeyEvent constructor calls are being touched, use EF_NONE instead of 0 to make that argument's purpose clear. BUG=380349 TEST=unit_tests,ash_unittests,events_unittests,ui_unittests,interactive_ui_tests Review URL: https://codereview.chromium.org/404203003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285605 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/sticky_keys/sticky_keys_unittest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ash/sticky_keys') diff --git a/ash/sticky_keys/sticky_keys_unittest.cc b/ash/sticky_keys/sticky_keys_unittest.cc index 6e2fa18..6505b65 100644 --- a/ash/sticky_keys/sticky_keys_unittest.cc +++ b/ash/sticky_keys/sticky_keys_unittest.cc @@ -58,7 +58,7 @@ class StickyKeysTest : public test::AshTestBase { ui::KeyEvent* GenerateKey(ui::EventType type, ui::KeyboardCode code) { scoped_xevent_.InitKeyEvent(type, code, 0); - ui::KeyEvent* event = new ui::KeyEvent(scoped_xevent_, false); + ui::KeyEvent* event = new ui::KeyEvent(scoped_xevent_); return event; } @@ -122,7 +122,7 @@ class StickyKeysTest : public test::AshTestBase { // Creates a synthesized KeyEvent that is not backed by a native event. ui::KeyEvent* GenerateSynthesizedKeyEvent(ui::EventType type, ui::KeyboardCode code) { - return new ui::KeyEvent(type, code, 0, true); + return new ui::KeyEvent(type, code, ui::EF_NONE); } // Creates a synthesized MouseEvent that is not backed by a native event. -- cgit v1.1