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 represented by |event|, | |
16 int EventFlagsFromNSEvent(NSEvent* event); | |
17 | |
18 // Retrieves a bitsum of ui::EventFlags represented by |event|, | |
19 // but instead use the modifier flags given by |flags|, | |
Avi (use Gerrit)
2011/08/30 20:11:17
s/|flags|/|modifiers|/ ?
shinyak (Google)
2011/08/31 06:09:23
Done.
| |
20 // which is the same format as |-NSEvent modifierFlags|. This allows | |
21 // substitution of the modifiers without having to create a new event from | |
22 // scratch. | |
23 int EventFlagsFromNSEventWithModifiers(NSEvent* event, NSUInteger modifiers); | |
24 | |
15 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | 25 // 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 | 26 // represented by |event|. For example, a Cmd+Click would mean open the |
17 // associated link in a background tab. | 27 // associated link in a background tab. |
18 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event); | 28 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event); |
19 | 29 |
20 // Retrieves the WindowOpenDisposition used to open a link from a user gesture | 30 // 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|, | 31 // represented by |event|, but instead use the modifier flags given by |flags|, |
22 // which is the same format as |-NSEvent modifierFlags|. This allows | 32 // which is the same format as |-NSEvent modifierFlags|. This allows |
23 // substitution of the modifiers without having to create a new event from | 33 // substitution of the modifiers without having to create a new event from |
24 // scratch. | 34 // scratch. |
25 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( | 35 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( |
26 NSEvent* event, NSUInteger flags); | 36 NSEvent* event, NSUInteger flags); |
27 | 37 |
28 } // namespace event_utils | 38 } // namespace event_utils |
29 | 39 |
30 #endif // CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ | 40 #endif // CHROME_BROWSER_UI_COCOA_EVENT_UTILS_H_ |
OLD | NEW |