OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
| 7 |
| 8 #include "base/lazy_instance.h" |
| 9 #include "chrome/browser/extensions/global_shortcut_listener.h" |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 // Mac-specific implementation of the GlobalShortcutListener class that |
| 14 // listens for global shortcuts. Handles basic keyboard intercepting and |
| 15 // forwards its output to the base class for processing. |
| 16 // TODO(finnur/smus): Implement this class. |
| 17 class GlobalShortcutListenerMac : public GlobalShortcutListener { |
| 18 public: |
| 19 virtual ~GlobalShortcutListenerMac(); |
| 20 |
| 21 virtual void StartListening() OVERRIDE; |
| 22 virtual void StopListening() OVERRIDE; |
| 23 |
| 24 private: |
| 25 friend struct base::DefaultLazyInstanceTraits<GlobalShortcutListenerMac>; |
| 26 |
| 27 GlobalShortcutListenerMac(); |
| 28 |
| 29 // Register an |accelerator| with the particular |observer|. |
| 30 virtual void RegisterAccelerator( |
| 31 const ui::Accelerator& accelerator, |
| 32 GlobalShortcutListener::Observer* observer) OVERRIDE; |
| 33 // Unregister an |accelerator| with the particular |observer|. |
| 34 virtual void UnregisterAccelerator( |
| 35 const ui::Accelerator& accelerator, |
| 36 GlobalShortcutListener::Observer* observer) OVERRIDE; |
| 37 |
| 38 // Whether this object is listening for global shortcuts. |
| 39 bool is_listening_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerMac); |
| 42 }; |
| 43 |
| 44 } // namespace extensions |
| 45 |
| 46 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
OLD | NEW |