| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Convert a USB keycode into an equivalent platform native keycode. | 82 // Convert a USB keycode into an equivalent platform native keycode. |
| 83 static uint16_t UsbKeycodeToNativeKeycode(uint32_t usb_keycode); | 83 static uint16_t UsbKeycodeToNativeKeycode(uint32_t usb_keycode); |
| 84 | 84 |
| 85 // Convert a platform native keycode into an equivalent USB keycode. | 85 // Convert a platform native keycode into an equivalent USB keycode. |
| 86 static uint32_t NativeKeycodeToUsbKeycode(uint16_t native_keycode); | 86 static uint32_t NativeKeycodeToUsbKeycode(uint16_t native_keycode); |
| 87 | 87 |
| 88 // Convert a USB keycode into the string with the DOM3 |code| value. | 88 // Convert a USB keycode into the string with the DOM3 |code| value. |
| 89 // The returned pointer references a static global string. | 89 // The returned pointer references a static global string. |
| 90 static const char* UsbKeycodeToCode(uint32_t usb_keycode); | 90 static const char* UsbKeycodeToCode(uint32_t usb_keycode); |
| 91 | 91 |
| 92 // Convert a USB keycode into a DomCode. |
| 93 static DomCode UsbKeycodeToDomCode(uint32_t usb_keycode); |
| 94 |
| 92 // Convert a DOM3 Event |code| string into a USB keycode value. | 95 // Convert a DOM3 Event |code| string into a USB keycode value. |
| 93 static uint32_t CodeToUsbKeycode(const char* code); | 96 static uint32_t CodeToUsbKeycode(const char* code); |
| 94 | 97 |
| 95 // Static methods to support testing. | 98 // Static methods to support testing. |
| 96 static size_t NumKeycodeMapEntriesForTest(); | 99 static size_t NumKeycodeMapEntriesForTest(); |
| 97 static const KeycodeMapEntry* GetKeycodeMapForTest(); | 100 static const KeycodeMapEntry* GetKeycodeMapForTest(); |
| 98 static const char* DomCodeStringForTest(size_t index); | 101 static const char* DomCodeStringForTest(size_t index); |
| 99 static const char* DomKeyStringForTest(size_t index); | 102 static const char* DomKeyStringForTest(size_t index); |
| 100 | 103 |
| 101 private: | 104 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); | 105 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace ui | 108 } // namespace ui |
| 106 | 109 |
| 107 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 110 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
| OLD | NEW |