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

Unified Diff: ui/base/cocoa/cocoa_event_utils.mm

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/cocoa/cocoa_event_utils.h ('k') | ui/events/keycodes/keyboard_code_conversion_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/cocoa_event_utils.mm
diff --git a/ui/base/cocoa/cocoa_event_utils.mm b/ui/base/cocoa/cocoa_event_utils.mm
index 55c885e5443e2a9977b9abcc561e6ec4e6b0e97d..87165f4370c2aa47ca8e497d20ecef64e27f84a0 100644
--- a/ui/base/cocoa/cocoa_event_utils.mm
+++ b/ui/base/cocoa/cocoa_event_utils.mm
@@ -43,13 +43,18 @@ int EventFlagsFromNSEvent(NSEvent* event) {
return EventFlagsFromNSEventWithModifiers(event, modifiers);
}
-int EventFlagsFromNSEventWithModifiers(NSEvent* event, NSUInteger modifiers) {
+int EventFlagsFromModifiers(NSUInteger modifiers) {
int flags = 0;
flags |= (modifiers & NSAlphaShiftKeyMask) ? ui::EF_CAPS_LOCK_DOWN : 0;
flags |= (modifiers & NSShiftKeyMask) ? ui::EF_SHIFT_DOWN : 0;
flags |= (modifiers & NSControlKeyMask) ? ui::EF_CONTROL_DOWN : 0;
flags |= (modifiers & NSAlternateKeyMask) ? ui::EF_ALT_DOWN : 0;
flags |= (modifiers & NSCommandKeyMask) ? ui::EF_COMMAND_DOWN : 0;
+ return flags;
+}
+
+int EventFlagsFromNSEventWithModifiers(NSEvent* event, NSUInteger modifiers) {
+ int flags = EventFlagsFromModifiers(modifiers);
flags |= isLeftButtonEvent(event) ? ui::EF_LEFT_MOUSE_BUTTON : 0;
flags |= isRightButtonEvent(event) ? ui::EF_RIGHT_MOUSE_BUTTON : 0;
flags |= isMiddleButtonEvent(event) ? ui::EF_MIDDLE_MOUSE_BUTTON : 0;
« no previous file with comments | « ui/base/cocoa/cocoa_event_utils.h ('k') | ui/events/keycodes/keyboard_code_conversion_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698