OLD | NEW |
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 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" | 5 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #import <Carbon/Carbon.h> | 9 #import <Carbon/Carbon.h> |
10 | 10 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 characters = [event charactersIgnoringModifiers]; | 538 characters = [event charactersIgnoringModifiers]; |
539 if ([characters length] > 0) | 539 if ([characters length] > 0) |
540 code = KeyboardCodeFromCharCode([characters characterAtIndex:0]); | 540 code = KeyboardCodeFromCharCode([characters characterAtIndex:0]); |
541 if (code) | 541 if (code) |
542 return code; | 542 return code; |
543 } | 543 } |
544 return KeyboardCodeFromKeyCode([event keyCode]); | 544 return KeyboardCodeFromKeyCode([event keyCode]); |
545 } | 545 } |
546 | 546 |
547 const char* CodeFromNSEvent(NSEvent* event) { | 547 const char* CodeFromNSEvent(NSEvent* event) { |
548 return KeycodeConverter::GetInstance()->NativeKeycodeToCode( | 548 return ui::KeycodeConverter::NativeKeycodeToCode([event keyCode]); |
549 [event keyCode]); | |
550 } | 549 } |
551 | 550 |
552 } // namespace ui | 551 } // namespace ui |
OLD | NEW |