| 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" | 5 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 12 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // 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. |
| 17 NSMenuItem* FindMenuItem(NSEvent* key, NSMenu* menu) { | 17 NSMenuItem* FindMenuItem(NSEvent* key, NSMenu* menu) { |
| 18 NSMenuItem* result = nil; | 18 NSMenuItem* result = nil; |
| 19 | 19 |
| 20 for (NSMenuItem* item in [menu itemArray]) { | 20 for (NSMenuItem* item in [menu itemArray]) { |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). | 293 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). |
| 294 if ([event modifierFlags] & NSAlternateKeyMask) | 294 if ([event modifierFlags] & NSAlternateKeyMask) |
| 295 return rawChar; | 295 return rawChar; |
| 296 } | 296 } |
| 297 | 297 |
| 298 return noModifiersChar; | 298 return noModifiersChar; |
| 299 } | 299 } |
| OLD | NEW |