Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / remoting / key_code_conv.cc
blobbaa87bd55017479b1f749c96b3421518ed64f8af
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/test/remoting/key_code_conv.h"
7 #include "chrome/test/remoting/key_code_map.h"
9 namespace remoting {
11 ui::KeyboardCode InvalidKeyboardCode() {
12 return key_code_map[0].vkey_code;
15 void GetKeyValuesFromChar(
16 char c, const char** code, ui::KeyboardCode* vkey_code, bool* shift) {
17 *code = NULL;
18 *vkey_code = InvalidKeyboardCode();
20 for (size_t i = 0; i < arraysize(key_code_map); ++i) {
21 if (key_code_map[i].lower_char == c) {
22 *code = key_code_map[i].code;
23 *vkey_code = key_code_map[i].vkey_code;
24 *shift = false;
25 return;
28 if (key_code_map[i].upper_char == c) {
29 *code = key_code_map[i].code;
30 *vkey_code = key_code_map[i].vkey_code;
31 *shift = true;
36 } // namespace remoting