Make Accelerator a standalone JS type.

This makes menu and global-shortcut share the same code on accelerator.
This commit is contained in:
Cheng Zhao 2014-08-05 00:00:39 +08:00
parent 28b9df24a6
commit 6dc01945af
9 changed files with 114 additions and 65 deletions

View file

@ -34,9 +34,10 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
private:
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;
bool Register(const std::string& keycode, const base::Closure& callback);
bool IsRegistered(const std::string& keycode);
void Unregister(const std::string& keycode);
bool Register(const ui::Accelerator& accelerator,
const base::Closure& callback);
bool IsRegistered(const ui::Accelerator& accelerator);
void Unregister(const ui::Accelerator& accelerator);
void UnregisterAll();
// GlobalShortcutListener::Observer implementation.