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#include "ui/base/accelerators/accelerator.h" 11 12namespace extensions { 13 14// ChromeOS-specific implementation of the GlobalShortcutListener class that 15// listens for global shortcuts. Handles basic keyboard intercepting and 16// forwards its output to the base class for processing. 17class GlobalShortcutListenerChromeOS : public GlobalShortcutListener, 18 ui::AcceleratorTarget { 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 // ui::AcceleratorTarget implementation. 33 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; 34 virtual bool CanHandleAccelerators() const OVERRIDE; 35 36 // Whether this object is listening for global shortcuts. 37 bool is_listening_; 38 39 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerChromeOS); 40}; 41 42} // namespace extensions 43 44#endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ 45