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

Side by Side Diff: ui/events/keycodes/dom/keycode_converter.h

Issue 2910873002: [System-Keyboard-Lock] Add KeycodeConverter::CodeStringToNativeKeycode() function (Closed)
Patch Set: Resolve review comments 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ 5 #ifndef UI_EVENTS_KEYCODES_DOM_KEYCODE_CONVERTER_H_
6 #define UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ 6 #define UI_EVENTS_KEYCODES_DOM_KEYCODE_CONVERTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/events/keycodes/dom/dom_key.h" 13 #include "ui/events/keycodes/dom/dom_key.h"
14 14
15 // For reference, the W3C UI Event spec is located at: 15 // For reference, the W3C UI Event spec is located at:
16 // http://www.w3.org/TR/uievents/ 16 // http://www.w3.org/TR/uievents/
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // Convert a platform native keycode into an equivalent USB keycode. 93 // Convert a platform native keycode into an equivalent USB keycode.
94 static uint32_t NativeKeycodeToUsbKeycode(int native_keycode); 94 static uint32_t NativeKeycodeToUsbKeycode(int native_keycode);
95 95
96 // Convert a USB keycode into a DomCode. 96 // Convert a USB keycode into a DomCode.
97 static DomCode UsbKeycodeToDomCode(uint32_t usb_keycode); 97 static DomCode UsbKeycodeToDomCode(uint32_t usb_keycode);
98 98
99 // Convert a DomCode into a USB keycode. 99 // Convert a DomCode into a USB keycode.
100 static uint32_t DomCodeToUsbKeycode(DomCode dom_code); 100 static uint32_t DomCodeToUsbKeycode(DomCode dom_code);
101 101
102 // Convert a DOM3 Event |code| string into a USB keycode value. 102 // Convert a UI Event |code| string into a USB keycode value.
103 static uint32_t CodeToUsbKeycode(const std::string& code); 103 static uint32_t CodeStringToUsbKeycode(const std::string& code);
104
105 // Convert a UI Event |code| string into a native keycode.
106 static int CodeStringToNativeKeycode(const std::string& code);
104 107
105 // Static methods to support testing. 108 // Static methods to support testing.
106 static size_t NumKeycodeMapEntriesForTest(); 109 static size_t NumKeycodeMapEntriesForTest();
107 static const KeycodeMapEntry* GetKeycodeMapForTest(); 110 static const KeycodeMapEntry* GetKeycodeMapForTest();
108 static const char* DomKeyStringForTest(size_t index); 111 static const char* DomKeyStringForTest(size_t index);
109 112
110 private: 113 private:
111 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); 114 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter);
112 }; 115 };
113 116
114 } // namespace ui 117 } // namespace ui
115 118
116 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ 119 #endif // UI_EVENTS_KEYCODES_DOM_KEYCODE_CONVERTER_H_
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.cc ('k') | ui/events/keycodes/dom/keycode_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698