| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ui/events/keycodes/keyboard_code_conversion.h" | 5 #include "ui/events/keycodes/keyboard_code_conversion.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| 11 #include "ui/events/keycodes/dom/dom_code.h" | 11 #include "ui/events/keycodes/dom/dom_code.h" |
| 12 #include "ui/events/keycodes/dom/dom_key.h" | 12 #include "ui/events/keycodes/dom/dom_key.h" |
| 13 #include "ui/events/keycodes/dom_us_layout_data.h" | 13 #include "ui/events/keycodes/dom_us_layout_data.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 bool IsRightSideDomCode(DomCode code) { | 19 bool IsRightSideDomCode(DomCode code) { |
| 20 return (code == DomCode::SHIFT_RIGHT) || (code == DomCode::CONTROL_RIGHT) || | 20 return (code == DomCode::SHIFT_RIGHT) || (code == DomCode::CONTROL_RIGHT) || |
| 21 (code == DomCode::ALT_RIGHT) || (code == DomCode::OS_RIGHT); | 21 (code == DomCode::ALT_RIGHT) || (code == DomCode::META_RIGHT); |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // anonymous namespace | 24 } // anonymous namespace |
| 25 | 25 |
| 26 base::char16 DomCodeToUsLayoutCharacter(DomCode dom_code, int flags) { | 26 base::char16 DomCodeToUsLayoutCharacter(DomCode dom_code, int flags) { |
| 27 DomKey dom_key; | 27 DomKey dom_key; |
| 28 KeyboardCode key_code; | 28 KeyboardCode key_code; |
| 29 if (DomCodeToUsLayoutDomKey(dom_code, flags, &dom_key, &key_code) && | 29 if (DomCodeToUsLayoutDomKey(dom_code, flags, &dom_key, &key_code) && |
| 30 dom_key.IsCharacter()) { | 30 dom_key.IsCharacter()) { |
| 31 return dom_key.ToCharacter(); | 31 return dom_key.ToCharacter(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 return VKEY_UNKNOWN; | 259 return VKEY_UNKNOWN; |
| 260 } | 260 } |
| 261 | 261 |
| 262 KeyboardCode DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code) { | 262 KeyboardCode DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code) { |
| 263 return LocatedToNonLocatedKeyboardCode( | 263 return LocatedToNonLocatedKeyboardCode( |
| 264 DomCodeToUsLayoutKeyboardCode(dom_code)); | 264 DomCodeToUsLayoutKeyboardCode(dom_code)); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace ui | 267 } // namespace ui |
| OLD | NEW |