| 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 "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if !defined(OS_IOS) | |
| 14 #include "ipc/ipc_param_traits.h" // nogncheck | |
| 15 #endif | |
| 16 | |
| 17 namespace ui { | 13 namespace ui { |
| 18 | 14 |
| 19 // Integer representation of UI Events KeyboardEvent.key value. | 15 // Integer representation of UI Events KeyboardEvent.key value. |
| 20 // | 16 // |
| 21 // 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 |
| 22 // 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]. |
| 23 // 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 |
| 24 // 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 |
| 25 // encode the associated combining character. (They are not quite the | 21 // encode the associated combining character. (They are not quite the |
| 26 // same thing: a dead key is a non-printing operator that modifies a | 22 // same thing: a dead key is a non-printing operator that modifies a |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // 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 |
| 146 // functions. | 142 // functions. |
| 147 template<Base C> struct Constant { | 143 template<Base C> struct Constant { |
| 148 enum : Base { | 144 enum : Base { |
| 149 Character = TYPE_UNICODE | C, | 145 Character = TYPE_UNICODE | C, |
| 150 Dead = TYPE_DEAD | C, | 146 Dead = TYPE_DEAD | C, |
| 151 }; | 147 }; |
| 152 }; | 148 }; |
| 153 | 149 |
| 154 private: | 150 private: |
| 155 #if !defined(OS_IOS) | |
| 156 friend struct IPC::ParamTraits<ui::DomKey>; | |
| 157 #endif | |
| 158 | |
| 159 Base value_; | 151 Base value_; |
| 160 }; | 152 }; |
| 161 | 153 |
| 162 } // namespace ui | 154 } // namespace ui |
| 163 | 155 |
| 164 #endif // UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ | 156 #endif // UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_ |
| OLD | NEW |