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

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

Issue 16402012: Use a direct include of strings headers in ui/, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/ime/win/tsf_text_store.h ('k') | ui/base/l10n/l10n_font_util.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_x.h" 5 #include "ui/base/keycodes/keyboard_code_conversion_x.h"
6 6
7 #define XK_3270 // for XK_3270_BackTab 7 #define XK_3270 // for XK_3270_BackTab
8 #include <X11/keysym.h> 8 #include <X11/keysym.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
11 #include <X11/XF86keysym.h> 11 #include <X11/XF86keysym.h>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/stringprintf.h" 15 #include "base/strings/stringprintf.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 17
18 namespace ui { 18 namespace ui {
19 19
20 // Get an ui::KeyboardCode from an X keyevent 20 // Get an ui::KeyboardCode from an X keyevent
21 KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev) { 21 KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev) {
22 // XLookupKeysym does not take into consideration the state of the lock/shift 22 // XLookupKeysym does not take into consideration the state of the lock/shift
23 // etc. keys. So it is necessary to use XLookupString instead. 23 // etc. keys. So it is necessary to use XLookupString instead.
24 KeySym keysym; 24 KeySym keysym;
25 XLookupString(&xev->xkey, NULL, 0, &keysym, NULL); 25 XLookupString(&xev->xkey, NULL, 0, &keysym, NULL);
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 case VKEY_KBD_BRIGHTNESS_UP: 786 case VKEY_KBD_BRIGHTNESS_UP:
787 return XF86XK_KbdBrightnessUp; 787 return XF86XK_KbdBrightnessUp;
788 788
789 default: 789 default:
790 LOG(WARNING) << "Unknown keycode:" << keycode; 790 LOG(WARNING) << "Unknown keycode:" << keycode;
791 return 0; 791 return 0;
792 } 792 }
793 } 793 }
794 794
795 } // namespace ui 795 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/win/tsf_text_store.h ('k') | ui/base/l10n/l10n_font_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698