OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DOM3_DOM_KEY_H_ | 5 #ifndef UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ |
6 #define UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ | 6 #define UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "ipc/ipc_param_traits.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 | 14 |
14 // Integer representation of UI Events KeyboardEvent.key value. | 15 // Integer representation of UI Events KeyboardEvent.key value. |
15 // | 16 // |
16 // The semantics follow the web string form[1]: the value is either a | 17 // The semantics follow the web string form[1]: the value is either a |
17 // Unicode character or one of a defined set of additional values[2]. | 18 // Unicode character or one of a defined set of additional values[2]. |
18 // There is one notable difference from the UI Events string key: for | 19 // There is one notable difference from the UI Events string key: for |
19 // the 'Dead' key, this type provides a whole range of values that also | 20 // the 'Dead' key, this type provides a whole range of values that also |
20 // encode the associated combining character. (They are not quite the | 21 // encode the associated combining character. (They are not quite the |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // In the future (cue the theremin) this can be replaced with constexpr | 141 // In the future (cue the theremin) this can be replaced with constexpr |
141 // functions. | 142 // functions. |
142 template<Base C> struct Constant { | 143 template<Base C> struct Constant { |
143 enum : Base { | 144 enum : Base { |
144 Character = TYPE_UNICODE | C, | 145 Character = TYPE_UNICODE | C, |
145 Dead = TYPE_DEAD | C, | 146 Dead = TYPE_DEAD | C, |
146 }; | 147 }; |
147 }; | 148 }; |
148 | 149 |
149 private: | 150 private: |
| 151 friend struct IPC::ParamTraits<ui::DomKey>; |
| 152 |
150 Base value_; | 153 Base value_; |
151 }; | 154 }; |
152 | 155 |
153 } // namespace ui | 156 } // namespace ui |
154 | 157 |
155 #endif // UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ | 158 #endif // UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ |
OLD | NEW |