OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 6 |
5 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
6 #include <Carbon/Carbon.h> | |
7 | |
8 #include "chrome/browser/global_keyboard_shortcuts_mac.h" | |
9 | 8 |
10 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
13 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 12 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
14 | 13 |
15 namespace { | 14 namespace { |
16 | 15 |
17 // Returns the menu item associated with |key| in |menu|, or nil if not found. | 16 // Returns the menu item associated with |key| in |menu|, or nil if not found. |
18 NSMenuItem* FindMenuItem(NSEvent* key, NSMenu* menu) { | 17 NSMenuItem* FindMenuItem(NSEvent* key, NSMenu* menu) { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 292 } |
294 } | 293 } |
295 | 294 |
296 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). | 295 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). |
297 if ([event modifierFlags] & NSAlternateKeyMask) | 296 if ([event modifierFlags] & NSAlternateKeyMask) |
298 return rawChar; | 297 return rawChar; |
299 } | 298 } |
300 | 299 |
301 return noModifiersChar; | 300 return noModifiersChar; |
302 } | 301 } |
OLD | NEW |