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/events/keycodes/keyboard_code_conversion_mac.mm

Issue 494813002: events: keycodes: Remove the stateless singleton instance of KeycodeConverter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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
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 #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
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
OLDNEW
« no previous file with comments | « ui/events/keycodes/dom4/keycode_converter_unittest.cc ('k') | ui/events/keycodes/keyboard_code_conversion_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698