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

Side by Side Diff: components/keyboard_lock/keyboard_lock_types.h

Issue 2815023002: [System-Keyboard-Lock] Add KeyboardLockHost and KeyEventInterceptor (Closed)
Patch Set: Use NativeKeycode instead of ui::KeyboardCode Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « components/keyboard_lock/keyboard_lock_host_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_
7
8 #include <type_traits>
9 #include <utility>
10
11 #include "ui/events/keycodes/dom/keycode_converter.h"
12
13 namespace keyboard_lock {
14
15 // The type to represent a layout independent native keycode.
16 // https://cs.chromium.org/chromium/src/ui/events/keycodes/dom/keycode_converter .h?l=36&gs=cpp%253Aui%253A%253A%253Calias-of-KeycodeMapEntry%253E%253A%253Anativ e_keycode%2540chromium%252F..%252F..%252Fui%252Fevents%252Fkeycodes%252Fdom%252F keycode_converter.h%257Cdef&gsn=native_keycode&ct=xref_usages
17 // Though it equals to integer, most of the components in the keyboard_lock
18 // expects it to be in range [0, 256). Keyboard events out of this range will
19 // usually be ignored.
20 typedef decltype(std::declval<ui::KeycodeMapEntry>().native_keycode)
21 NativeKeycode;
22
23 static_assert(std::is_same<NativeKeycode, int>::value,
24 "Expect native_keycode to be int");
25
26 } // namespace keyboard_lock
27
28 #endif // COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/keyboard_lock_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698