Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/base/cocoa/cocoa_event_utils.h

Issue 152643007: mac: Create a static mapping of accelerators in the main menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acc_list
Patch Set: Indent error. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/accelerators/platform_accelerator_cocoa.h ('k') | ui/base/cocoa/cocoa_event_utils.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_BASE_COCOA_COCOA_EVENT_UTILS_H_ 5 #ifndef UI_BASE_COCOA_COCOA_EVENT_UTILS_H_
6 #define UI_BASE_COCOA_COCOA_EVENT_UTILS_H_ 6 #define UI_BASE_COCOA_COCOA_EVENT_UTILS_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "ui/base/ui_base_export.h" 10 #include "ui/base/ui_base_export.h"
11 #include "ui/base/window_open_disposition.h" 11 #include "ui/base/window_open_disposition.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 // Retrieves a bitsum of ui::EventFlags represented by |event|, 15 // Retrieves a bitsum of ui::EventFlags represented by |event|,
16 UI_BASE_EXPORT int EventFlagsFromNSEvent(NSEvent* event); 16 UI_BASE_EXPORT int EventFlagsFromNSEvent(NSEvent* event);
17 17
18 // Converts the Cocoa |modifiers| bitsum into a ui::EventFlags bitsum.
19 UI_BASE_EXPORT int EventFlagsFromModifiers(NSUInteger modifiers);
20
18 // Retrieves a bitsum of ui::EventFlags represented by |event|, 21 // Retrieves a bitsum of ui::EventFlags represented by |event|,
19 // but instead use the modifier flags given by |modifiers|, 22 // but instead use the modifier flags given by |modifiers|,
20 // which is the same format as |-NSEvent modifierFlags|. This allows 23 // which is the same format as |-NSEvent modifierFlags|. This allows
21 // substitution of the modifiers without having to create a new event from 24 // substitution of the modifiers without having to create a new event from
22 // scratch. 25 // scratch.
23 UI_BASE_EXPORT int EventFlagsFromNSEventWithModifiers(NSEvent* event, 26 UI_BASE_EXPORT int EventFlagsFromNSEventWithModifiers(NSEvent* event,
24 NSUInteger modifiers); 27 NSUInteger modifiers);
25 28
26 // Retrieves the WindowOpenDisposition used to open a link from a user gesture 29 // Retrieves the WindowOpenDisposition used to open a link from a user gesture
27 // represented by |event|. For example, a Cmd+Click would mean open the 30 // represented by |event|. For example, a Cmd+Click would mean open the
28 // associated link in a background tab. 31 // associated link in a background tab.
29 UI_BASE_EXPORT WindowOpenDisposition 32 UI_BASE_EXPORT WindowOpenDisposition
30 WindowOpenDispositionFromNSEvent(NSEvent* event); 33 WindowOpenDispositionFromNSEvent(NSEvent* event);
31 34
32 // Retrieves the WindowOpenDisposition used to open a link from a user gesture 35 // Retrieves the WindowOpenDisposition used to open a link from a user gesture
33 // represented by |event|, but instead use the modifier flags given by |flags|, 36 // represented by |event|, but instead use the modifier flags given by |flags|,
34 // which is the same format as |-NSEvent modifierFlags|. This allows 37 // which is the same format as |-NSEvent modifierFlags|. This allows
35 // substitution of the modifiers without having to create a new event from 38 // substitution of the modifiers without having to create a new event from
36 // scratch. 39 // scratch.
37 UI_BASE_EXPORT WindowOpenDisposition 40 UI_BASE_EXPORT WindowOpenDisposition
38 WindowOpenDispositionFromNSEventWithFlags(NSEvent* event, NSUInteger flags); 41 WindowOpenDispositionFromNSEventWithFlags(NSEvent* event, NSUInteger flags);
39 42
40 } // namespace ui 43 } // namespace ui
41 44
42 #endif // UI_BASE_COCOA_COCOA_EVENT_UTILS_H_ 45 #endif // UI_BASE_COCOA_COCOA_EVENT_UTILS_H_
OLDNEW
« no previous file with comments | « ui/base/accelerators/platform_accelerator_cocoa.h ('k') | ui/base/cocoa/cocoa_event_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698