Home | History | Annotate | Download | only in extensions
      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 "chrome/browser/extensions/global_shortcut_listener.h"
      9 
     10 // TODO(finnur): Figure out what to do on ChromeOS, where the Commands API kind
     11 // of is global already...
     12 
     13 namespace extensions {
     14 
     15 // ChromeOS-specific implementation of the GlobalShortcutListener class that
     16 // listens for global shortcuts. Handles basic keyboard intercepting and
     17 // forwards its output to the base class for processing.
     18 class GlobalShortcutListenerChromeOS : public GlobalShortcutListener {
     19  public:
     20   GlobalShortcutListenerChromeOS();
     21   virtual ~GlobalShortcutListenerChromeOS();
     22 
     23  private:
     24   // GlobalShortcutListener implementation.
     25   virtual void StartListening() OVERRIDE;
     26   virtual void StopListening() OVERRIDE;
     27   virtual bool RegisterAcceleratorImpl(
     28       const ui::Accelerator& accelerator) OVERRIDE;
     29   virtual void UnregisterAcceleratorImpl(
     30       const ui::Accelerator& accelerator) OVERRIDE;
     31 
     32   // Whether this object is listening for global shortcuts.
     33   bool is_listening_;
     34 
     35   DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerChromeOS);
     36 };
     37 
     38 }  // namespace extensions
     39 
     40 #endif  // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_
     41