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 27 matching lines...) Expand all Loading... | |
38 // A class to convert between the current platform's native keycode (scancode) | 38 // A class to convert between the current platform's native keycode (scancode) |
39 // and platform-neutral |code| values (as defined in the W3C UI Events | 39 // and platform-neutral |code| values (as defined in the W3C UI Events |
40 // spec (http://www.w3.org/TR/uievents/). | 40 // spec (http://www.w3.org/TR/uievents/). |
41 class KeycodeConverter { | 41 class KeycodeConverter { |
42 public: | 42 public: |
43 // Return the value that identifies an invalid native keycode. | 43 // Return the value that identifies an invalid native keycode. |
44 static int InvalidNativeKeycode(); | 44 static int InvalidNativeKeycode(); |
45 | 45 |
46 // Convert a native (Mac/Win/Linux) keycode into the |code| string. | 46 // Convert a native (Mac/Win/Linux) keycode into the |code| string. |
47 // The returned pointer references a static global string. | 47 // The returned pointer references a static global string. |
48 static const char* NativeKeycodeToCode(int native_keycode); | 48 static const char* NativeKeycodeToCode(int native_keycode); |
Wez
2015/05/05 20:11:48
If we're removing |code| string to native keycode,
kpschoedel
2015/05/05 20:48:50
I had left them because the uses were outside test
kpschoedel
2015/05/05 23:10:56
On further inspection, it looks like all the users
| |
49 | 49 |
50 // Convert a native (Mac/Win/Linux) keycode into a DomCode. | 50 // Convert a native (Mac/Win/Linux) keycode into a DomCode. |
51 static DomCode NativeKeycodeToDomCode(int native_keycode); | 51 static DomCode NativeKeycodeToDomCode(int native_keycode); |
52 | 52 |
53 // Convert a UI Events |code| string value into a native keycode. | |
54 static int CodeToNativeKeycode(const char* code); | |
55 | |
56 // Convert a DomCode into a native keycode. | 53 // Convert a DomCode into a native keycode. |
57 static int DomCodeToNativeKeycode(DomCode code); | 54 static int DomCodeToNativeKeycode(DomCode code); |
58 | 55 |
59 // Convert a UI Events |code| string value into a DomCode. | 56 // Convert a UI Events |code| string value into a DomCode. |
60 static DomCode CodeStringToDomCode(const char* code); | 57 static DomCode CodeStringToDomCode(const char* code); |
61 | 58 |
62 // Convert a DomCode into a UI Events |code| string value. | 59 // Convert a DomCode into a UI Events |code| string value. |
63 static const char* DomCodeToCodeString(DomCode dom_code); | 60 static const char* DomCodeToCodeString(DomCode dom_code); |
64 | 61 |
65 // Convert a UI Events |key| string value into a DomKey. | 62 // Convert a UI Events |key| string value into a DomKey. |
(...skipping 30 matching lines...) Expand all Loading... | |
96 static const KeycodeMapEntry* GetKeycodeMapForTest(); | 93 static const KeycodeMapEntry* GetKeycodeMapForTest(); |
97 static const char* DomKeyStringForTest(size_t index); | 94 static const char* DomKeyStringForTest(size_t index); |
98 | 95 |
99 private: | 96 private: |
100 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); | 97 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); |
101 }; | 98 }; |
102 | 99 |
103 } // namespace ui | 100 } // namespace ui |
104 | 101 |
105 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 102 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
OLD | NEW |