| OLD | NEW |
| 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_DOM4_KEYCODE_CONVERTER_H_ |
| 6 #define UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 6 #define UI_EVENTS_KEYCODES_DOM4_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> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DOM3 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 DOM3 Event |code| string into an equivalent platform native |
| 106 // keycode. |
| 107 static int CodeStringToNativeKeycode(const std::string& code); |
| 104 | 108 |
| 105 // Static methods to support testing. | 109 // Static methods to support testing. |
| 106 static size_t NumKeycodeMapEntriesForTest(); | 110 static size_t NumKeycodeMapEntriesForTest(); |
| 107 static const KeycodeMapEntry* GetKeycodeMapForTest(); | 111 static const KeycodeMapEntry* GetKeycodeMapForTest(); |
| 108 static const char* DomKeyStringForTest(size_t index); | 112 static const char* DomKeyStringForTest(size_t index); |
| 109 | 113 |
| 110 private: | 114 private: |
| 111 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); | 115 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 } // namespace ui | 118 } // namespace ui |
| 115 | 119 |
| 116 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 120 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
| OLD | NEW |