summaryrefslogtreecommitdiffstats
path: root/ash/sticky_keys
diff options
context:
space:
mode:
authorkpschoedel@chromium.org <kpschoedel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-25 17:10:17 +0000
committerkpschoedel@chromium.org <kpschoedel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-25 17:10:17 +0000
commit947211d035a701096dfd2641c14c348b897ee8f4 (patch)
tree24749f5a778bf736ca9758a8f6fddebaadb36b09 /ash/sticky_keys
parent7225f8584c2672e7ea20514f6f79dfe42aa670e9 (diff)
downloadchromium_src-947211d035a701096dfd2641c14c348b897ee8f4.zip
chromium_src-947211d035a701096dfd2641c14c348b897ee8f4.tar.gz
chromium_src-947211d035a701096dfd2641c14c348b897ee8f4.tar.bz2
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
Diffstat (limited to 'ash/sticky_keys')
-rw-r--r--ash/sticky_keys/sticky_keys_unittest.cc4
1 files changed, 2 insertions, 2 deletions
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.