Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1537)

Unified Diff: chrome/browser/extensions/global_shortcut_listener_mac.h

Issue 60353008: Mac global keybindings (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/global_shortcut_listener_mac.h
===================================================================
--- chrome/browser/extensions/global_shortcut_listener_mac.h (revision 232310)
+++ chrome/browser/extensions/global_shortcut_listener_mac.h (working copy)
@@ -5,9 +5,17 @@
#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_
#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_
-#include "base/lazy_instance.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
+#include <set>
+#include <IOKit/hidsystem/ev_keymap.h>
+
+#include "ApplicationServices/ApplicationServices.h"
+#include "base/lazy_instance.h"
+#include "base/mac/scoped_nsobject.h"
+
+@class GlobalShortcutListenerTap;
+
namespace extensions {
// Mac-specific implementation of the GlobalShortcutListener class that
@@ -21,6 +29,11 @@
virtual void StartListening() OVERRIDE;
virtual void StopListening() OVERRIDE;
+ // Keyboard event callbacks.
+ bool OnKeyEvent(ui::KeyboardCode keyCode, int modifiers);
+ bool OnMediaKeyEvent(ui::KeyboardCode keyCode);
+
+
private:
friend struct base::DefaultLazyInstanceTraits<GlobalShortcutListenerMac>;
@@ -38,6 +51,13 @@
// Whether this object is listening for global shortcuts.
bool is_listening_;
+ // Set of registered accelerators.
+ typedef std::set<ui::Accelerator> RegisteredHotKeys;
+ RegisteredHotKeys registered_hot_keys_;
+
+ // A pointer to the global shortcut listener tap.
+ base::scoped_nsobject<GlobalShortcutListenerTap> tap_;
+
DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerMac);
};

Powered by Google App Engine
This is Rietveld 408576698