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

Side by Side Diff: base/keyboard_code_conversion_mac.h

Issue 2986004: [Mac]Port browser_keyevents_browsertest.cc and browser_focus_uitest.cc to Mac. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Enable BrowserFocusTest and BrowserKeyEventsTests on Mac. Created 10 years, 5 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
« no previous file with comments | « base/keyboard_code_conversion_gtk.cc ('k') | base/keyboard_code_conversion_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_KEYBOARD_CODE_CONVERSION_MAC_H_
6 #define BASE_KEYBOARD_CODE_CONVERSION_MAC_H_
7
8 #import <Cocoa/Cocoa.h>
9 #include "basictypes.h"
10 #include "base/keyboard_codes_posix.h"
11
12 namespace base {
13
14 // We use windows virtual keycodes throughout our keyboard event related code,
15 // including unit tests. But Mac uses a different set of virtual keycodes.
16 // This function converts a windows virtual keycode into Mac's virtual key code
17 // and corresponding unicode character. |flags| is the modifiers mask such
18 // as NSControlKeyMask, NSShiftKeyMask, etc.
19 // When success, the corresponding Mac's virtual key code will be returned.
20 // The corresponding unicode character will be stored in |character|, and the
21 // corresponding unicode character ignoring the modifiers will be stored in
22 // |characterIgnoringModifiers|.
23 // -1 will be returned if the keycode can't be converted.
24 // This function is mainly for simulating keyboard events in unit tests.
25 // See third_party/WebKit/WebKit/chromium/src/mac/WebInputEventFactory.mm for
26 // reverse conversion.
27 int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode,
28 NSUInteger flags,
29 unichar* character,
30 unichar* characterIgnoringModifiers);
31
32 } // namespace base
33
34 #endif // BASE_KEYBOARD_CODE_CONVERSION_MAC_H_
OLDNEW
« no previous file with comments | « base/keyboard_code_conversion_gtk.cc ('k') | base/keyboard_code_conversion_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698