| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ | 5 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ |
| 6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ | 6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // -1 will be returned if the keycode can't be converted. | 30 // -1 will be returned if the keycode can't be converted. |
| 31 // This function is mainly for simulating keyboard events in unit tests. | 31 // This function is mainly for simulating keyboard events in unit tests. |
| 32 // See |KeyboardCodeFromNSEvent| for reverse conversion. | 32 // See |KeyboardCodeFromNSEvent| for reverse conversion. |
| 33 EVENTS_BASE_EXPORT int MacKeyCodeForWindowsKeyCode( | 33 EVENTS_BASE_EXPORT int MacKeyCodeForWindowsKeyCode( |
| 34 KeyboardCode keycode, | 34 KeyboardCode keycode, |
| 35 NSUInteger flags, | 35 NSUInteger flags, |
| 36 unichar* us_keyboard_shifted_character, | 36 unichar* us_keyboard_shifted_character, |
| 37 unichar* keyboard_character); | 37 unichar* keyboard_character); |
| 38 | 38 |
| 39 // This implementation cribbed from: | 39 // This implementation cribbed from: |
| 40 // content/browser/render_host/input/web_input_event_builder_mac.mm | 40 // third_party/WebKit/Source/web/mac/WebInputEventFactory.mm |
| 41 // Converts |event| into a |KeyboardCode|. The mapping is not direct as the Mac | 41 // Converts |event| into a |KeyboardCode|. The mapping is not direct as the Mac |
| 42 // has a different notion of key codes. | 42 // has a different notion of key codes. |
| 43 EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromNSEvent(NSEvent* event); | 43 EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromNSEvent(NSEvent* event); |
| 44 | 44 |
| 45 EVENTS_BASE_EXPORT DomCode CodeFromNSEvent(NSEvent* event); | 45 EVENTS_BASE_EXPORT DomCode CodeFromNSEvent(NSEvent* event); |
| 46 | 46 |
| 47 } // namespace ui | 47 } // namespace ui |
| 48 | 48 |
| 49 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ | 49 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_MAC_H_ |
| OLD | NEW |