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

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

Issue 100303003: Move more uses of string16 to specify base:: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/text/bytes_formatting.cc ('k') | ui/gfx/pango_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/events/keycodes/keyboard_code_conversion_x.h" 5 #include "ui/events/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>
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const char* CodeFromXEvent(XEvent* xev) { 441 const char* CodeFromXEvent(XEvent* xev) {
442 return KeycodeConverter::GetInstance()->NativeKeycodeToCode( 442 return KeycodeConverter::GetInstance()->NativeKeycodeToCode(
443 xev->xkey.keycode); 443 xev->xkey.keycode);
444 } 444 }
445 445
446 uint16 GetCharacterFromXEvent(XEvent* xev) { 446 uint16 GetCharacterFromXEvent(XEvent* xev) {
447 char buf[6]; 447 char buf[6];
448 int bytes_written = XLookupString(&xev->xkey, buf, 6, NULL, NULL); 448 int bytes_written = XLookupString(&xev->xkey, buf, 6, NULL, NULL);
449 DCHECK_LE(bytes_written, 6); 449 DCHECK_LE(bytes_written, 6);
450 450
451 string16 result; 451 base::string16 result;
452 return (bytes_written > 0 && UTF8ToUTF16(buf, bytes_written, &result) && 452 return (bytes_written > 0 && UTF8ToUTF16(buf, bytes_written, &result) &&
453 result.length() == 1) ? result[0] : 0; 453 result.length() == 1) ? result[0] : 0;
454 } 454 }
455 455
456 unsigned int DefaultXKeysymFromHardwareKeycode(unsigned int hardware_code) { 456 unsigned int DefaultXKeysymFromHardwareKeycode(unsigned int hardware_code) {
457 static const unsigned int kHardwareKeycodeMap[] = { 457 static const unsigned int kHardwareKeycodeMap[] = {
458 0, // 0x00: 458 0, // 0x00:
459 0, // 0x01: 459 0, // 0x01:
460 0, // 0x02: 460 0, // 0x02:
461 0, // 0x03: 461 0, // 0x03:
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 case VKEY_KBD_BRIGHTNESS_UP: 801 case VKEY_KBD_BRIGHTNESS_UP:
802 return XF86XK_KbdBrightnessUp; 802 return XF86XK_KbdBrightnessUp;
803 803
804 default: 804 default:
805 LOG(WARNING) << "Unknown keycode:" << keycode; 805 LOG(WARNING) << "Unknown keycode:" << keycode;
806 return 0; 806 return 0;
807 } 807 }
808 } 808 }
809 809
810 } // namespace ui 810 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/text/bytes_formatting.cc ('k') | ui/gfx/pango_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698