| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/accelerators_cocoa.h" | 5 #include "chrome/browser/cocoa/accelerators_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const struct AcceleratorMapping { | 13 const struct AcceleratorMapping { |
| 14 int command_id; | 14 int command_id; |
| 15 NSString* key; | 15 NSString* key; |
| 16 NSUInteger modifiers; | 16 NSUInteger modifiers; |
| 17 } kAcceleratorMap[] = { | 17 } kAcceleratorMap[] = { |
| 18 { IDC_CLEAR_BROWSING_DATA, @"\x8", NSCommandKeyMask | NSShiftKeyMask }, | 18 { IDC_CLEAR_BROWSING_DATA, @"\x8", NSCommandKeyMask | NSShiftKeyMask }, |
| 19 { IDC_COPY, @"c", NSCommandKeyMask }, | 19 { IDC_COPY, @"c", NSCommandKeyMask }, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 const menus::AcceleratorCocoa* AcceleratorsCocoa::GetAcceleratorForCommand( | 51 const menus::AcceleratorCocoa* AcceleratorsCocoa::GetAcceleratorForCommand( |
| 52 int command_id) { | 52 int command_id) { |
| 53 AcceleratorCocoaMap::iterator it = accelerators_.find(command_id); | 53 AcceleratorCocoaMap::iterator it = accelerators_.find(command_id); |
| 54 if (it == accelerators_.end()) | 54 if (it == accelerators_.end()) |
| 55 return NULL; | 55 return NULL; |
| 56 return &it->second; | 56 return &it->second; |
| 57 } | 57 } |
| OLD | NEW |