Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: ui/events/keycodes/keyboard_code_conversion.cc

Issue 1908683002: Replace OS_LEFT/RIGHT with META_LEFT/RIGHT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/events/keycodes/dom_us_layout_data.h ('k') | ui/events/keycodes/keyboard_code_conversion_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698