| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 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 UI_BASE_COCOA_COCOA_EVENT_UTILS_H_ | |
| 6 #define UI_BASE_COCOA_COCOA_EVENT_UTILS_H_ | |
| 7 | |
| 8 #import <Cocoa/Cocoa.h> | |
| 9 | |
| 10 #include "ui/base/ui_base_export.h" | |
| 11 #include "ui/base/window_open_disposition.h" | |
| 12 | |
| 13 namespace ui { | |
| 14 | |
| 15 // Retrieves a bitsum of ui::EventFlags represented by |event|, | |
| 16 UI_BASE_EXPORT int EventFlagsFromNSEvent(NSEvent* event); | |
| 17 | |
| 18 // Converts the Cocoa |modifiers| bitsum into a ui::EventFlags bitsum. | |
| 19 UI_BASE_EXPORT int EventFlagsFromModifiers(NSUInteger modifiers); | |
| 20 | |
| 21 // Retrieves a bitsum of ui::EventFlags represented by |event|, | |
| 22 // but instead use the modifier flags given by |modifiers|, | |
| 23 // which is the same format as |-NSEvent modifierFlags|. This allows | |
| 24 // substitution of the modifiers without having to create a new event from | |
| 25 // scratch. | |
| 26 UI_BASE_EXPORT int EventFlagsFromNSEventWithModifiers(NSEvent* event, | |
| 27 NSUInteger modifiers); | |
| 28 | |
| 29 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | |
| 30 // represented by |event|. For example, a Cmd+Click would mean open the | |
| 31 // associated link in a background tab. | |
| 32 UI_BASE_EXPORT WindowOpenDisposition | |
| 33 WindowOpenDispositionFromNSEvent(NSEvent* event); | |
| 34 | |
| 35 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | |
| 36 // represented by |event|, but instead use the modifier flags given by |flags|, | |
| 37 // which is the same format as |-NSEvent modifierFlags|. This allows | |
| 38 // substitution of the modifiers without having to create a new event from | |
| 39 // scratch. | |
| 40 UI_BASE_EXPORT WindowOpenDisposition | |
| 41 WindowOpenDispositionFromNSEventWithFlags(NSEvent* event, NSUInteger flags); | |
| 42 | |
| 43 } // namespace ui | |
| 44 | |
| 45 #endif // UI_BASE_COCOA_COCOA_EVENT_UTILS_H_ | |
| OLD | NEW |