Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_COCOA_ACCELERATORS_COCOA_H_ | |
| 6 #define CHROME_BROWSER_COCOA_ACCELERATORS_COCOA_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "app/menus/accelerator_cocoa.h" | |
| 11 | |
| 12 // This class maintains a map of command_ids to AcceleratorCocoa objects (see | |
| 13 // chrome/app/chrome_dll_resource.h). Currently, this only lists the commands | |
| 14 // that are used in the Wrench menu. | |
| 15 // | |
| 16 // It is recommended that this class be used as a singleton so that the key map | |
| 17 // isn't created multiple places. | |
| 18 // | |
| 19 // #import "base/singleton.h" | |
| 20 // ... | |
| 21 // AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get(); | |
| 22 // return keymap->GetAcceleratorForCommand(IDC_COPY); | |
| 23 // | |
| 24 class AcceleratorsCocoa { | |
| 25 public: | |
| 26 AcceleratorsCocoa(); | |
| 27 ~AcceleratorsCocoa() {} | |
| 28 | |
| 29 typedef std::map<int, menus::AcceleratorCocoa> AcceleratorCocoaMap; | |
| 30 | |
| 31 // Returns NULL if there is no accelerator for the command. | |
| 32 const menus::AcceleratorCocoa* GetAcceleratorForCommand(int command_id); | |
| 33 | |
| 34 private: | |
| 35 AcceleratorCocoaMap accelerators_; | |
|
pink (ping after 24hrs)
2010/06/21 19:21:56
DISALLOW_COPY_AND_ASSIGN(AcceleratorsCocoa)?
| |
| 36 }; | |
| 37 | |
| 38 #endif // CHROME_BROWSER_COCOA_ACCELERATORS_COCOA_H_ | |
| OLD | NEW |