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