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