diff options
author | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-29 02:32:04 +0000 |
---|---|---|
committer | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-29 02:32:04 +0000 |
commit | 5d03a6a39aca9a1228be384513866bc435414630 (patch) | |
tree | bfb9a520c8a643536541da2f69a82c2e80e8a553 /ui/events/event_utils.h | |
parent | a5852ba2246e28ec99eb05bf7223c6fc9f6cd4b0 (diff) | |
download | chromium_src-5d03a6a39aca9a1228be384513866bc435414630.zip chromium_src-5d03a6a39aca9a1228be384513866bc435414630.tar.gz chromium_src-5d03a6a39aca9a1228be384513866bc435414630.tar.bz2 |
MacViews: Implement basic NSEvent -> ui::Event conversion for Mac
Mac currently links events_stub.cc. This change adds an events_mac.mm
allowing basic ui::Event fields to be populated for keyboard and mouse.
To implement CopyNativeEvent on Mac, some objective C code needs to be
called. Part of this change moves CopyNativeEvent from an anonymous
namespace to platform-specific events_foo.cc/mm, and adds a
corresponding ReleaseCopiedNativeEvent.
BUG=366021
TEST=events_unittests
Review URL: https://codereview.chromium.org/251493002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/events/event_utils.h')
-rw-r--r-- | ui/events/event_utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/events/event_utils.h b/ui/events/event_utils.h index 9c40ab5..08bbfbc 100644 --- a/ui/events/event_utils.h +++ b/ui/events/event_utils.h @@ -84,6 +84,15 @@ EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( const base::NativeEvent& native_event); +// Returns a copy of |native_event|. Depending on the platform, this copy may +// need to be deleted with ReleaseCopiedNativeEvent(). +base::NativeEvent CopyNativeEvent( + const base::NativeEvent& native_event); + +// Delete a |native_event| previously created by CopyNativeEvent(). +void ReleaseCopiedNativeEvent( + const base::NativeEvent& native_event); + // Gets the touch id from a native event. EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); |