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

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

Issue 8590010: Valgrind: Fix the gcc 4.2 mac build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/keycodes/keyboard_code_conversion.h" 5 #include "ui/base/keycodes/keyboard_code_conversion.h"
6 6
7 #include "ui/base/events.h" 7 #include "ui/base/events.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 case VKEY_RETURN: 50 case VKEY_RETURN:
51 return 0x0A; 51 return 0x0A;
52 // Returns 0 for all other keys to avoid inputting unexpected chars. 52 // Returns 0 for all other keys to avoid inputting unexpected chars.
53 default: 53 default:
54 return 0; 54 return 0;
55 } 55 }
56 } 56 }
57 } 57 }
58 58
59 // Normal characters 59 // Normal characters
60 if (key_code >= VKEY_0 && key_code <= VKEY_9) 60 if (key_code >= VKEY_0 && key_code <= VKEY_9) {
61 return shift ? ")!@#$%^&*("[key_code - VKEY_0] : key_code; 61 return shift ? ")!@#$%^&*("[key_code - VKEY_0] :
62 else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9) 62 static_cast<uint16>(key_code);
63 } else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9) {
63 return key_code - VKEY_NUMPAD0 + '0'; 64 return key_code - VKEY_NUMPAD0 + '0';
65 }
64 66
65 switch (key_code) { 67 switch (key_code) {
66 case VKEY_TAB: 68 case VKEY_TAB:
67 return '\t'; 69 return '\t';
68 case VKEY_RETURN: 70 case VKEY_RETURN:
69 return '\r'; 71 return '\r';
70 case VKEY_MULTIPLY: 72 case VKEY_MULTIPLY:
71 return '*'; 73 return '*';
72 case VKEY_ADD: 74 case VKEY_ADD:
73 return '+'; 75 return '+';
(...skipping 26 matching lines...) Expand all
100 case VKEY_OEM_6: 102 case VKEY_OEM_6:
101 return shift ? '}' : ']'; 103 return shift ? '}' : ']';
102 case VKEY_OEM_7: 104 case VKEY_OEM_7:
103 return shift ? '"' : '\''; 105 return shift ? '"' : '\'';
104 default: 106 default:
105 return 0; 107 return 0;
106 } 108 }
107 } 109 }
108 110
109 } // namespace ui 111 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698