OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "webkit/glue/window_open_disposition.h" | 11 #include "webkit/glue/window_open_disposition.h" |
12 | 12 |
13 namespace event_utils { | 13 namespace event_utils { |
14 | 14 |
| 15 // Retrieves a bitsum of ui::EventFlags from NSEvent. |
| 16 int EventFlagsFromNSEvent(NSEvent* event); |
| 17 |
15 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | 18 // Retrieves the WindowOpenDisposition used to open a link from a user gesture |
16 // represented by |event|. For example, a Cmd+Click would mean open the | 19 // represented by |event|. For example, a Cmd+Click would mean open the |
17 // associated link in a background tab. | 20 // associated link in a background tab. |
18 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event); | 21 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event); |
19 | 22 |
20 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | 23 // Retrieves the WindowOpenDisposition used to open a link from a user gesture |
21 // represented by |event|, but instead use the modifier flags given by |flags|, | 24 // represented by |event|, but instead use the modifier flags given by |flags|, |
22 // which is the same format as |-NSEvent modifierFlags|. This allows | 25 // which is the same format as |-NSEvent modifierFlags|. This allows |
23 // substitution of the modifiers without having to create a new event from | 26 // substitution of the modifiers without having to create a new event from |
24 // scratch. | 27 // scratch. |
25 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( | 28 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( |
26 NSEvent* event, NSUInteger flags); | 29 NSEvent* event, NSUInteger flags); |
27 | 30 |
28 } // namespace event_utils | 31 } // namespace event_utils |
29 | 32 |
30 #endif // CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ | 33 #endif // CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ |
OLD | NEW |