OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/global_shortcut_listener.h" | 8 #include "chrome/browser/extensions/global_shortcut_listener.h" |
9 | 9 |
10 #include "ui/base/accelerators/accelerator.h" | 10 #include "ui/base/accelerators/accelerator.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 // ChromeOS-specific implementation of the GlobalShortcutListener class that | 14 // ChromeOS-specific implementation of the GlobalShortcutListener class that |
15 // listens for global shortcuts. Handles basic keyboard intercepting and | 15 // listens for global shortcuts. Handles basic keyboard intercepting and |
16 // forwards its output to the base class for processing. | 16 // forwards its output to the base class for processing. |
17 class GlobalShortcutListenerChromeOS : public GlobalShortcutListener, | 17 class GlobalShortcutListenerChromeOS : public GlobalShortcutListener, |
18 ui::AcceleratorTarget { | 18 ui::AcceleratorTarget { |
19 public: | 19 public: |
20 GlobalShortcutListenerChromeOS(); | 20 GlobalShortcutListenerChromeOS(); |
21 virtual ~GlobalShortcutListenerChromeOS(); | 21 virtual ~GlobalShortcutListenerChromeOS(); |
22 | 22 |
23 private: | 23 private: |
24 // GlobalShortcutListener implementation. | 24 // GlobalShortcutListener implementation. |
25 virtual void StartListening() OVERRIDE; | 25 virtual void StartListening() override; |
26 virtual void StopListening() OVERRIDE; | 26 virtual void StopListening() override; |
27 virtual bool RegisterAcceleratorImpl( | 27 virtual bool RegisterAcceleratorImpl( |
28 const ui::Accelerator& accelerator) OVERRIDE; | 28 const ui::Accelerator& accelerator) override; |
29 virtual void UnregisterAcceleratorImpl( | 29 virtual void UnregisterAcceleratorImpl( |
30 const ui::Accelerator& accelerator) OVERRIDE; | 30 const ui::Accelerator& accelerator) override; |
31 | 31 |
32 // ui::AcceleratorTarget implementation. | 32 // ui::AcceleratorTarget implementation. |
33 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 33 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
34 virtual bool CanHandleAccelerators() const OVERRIDE; | 34 virtual bool CanHandleAccelerators() const override; |
35 | 35 |
36 // Whether this object is listening for global shortcuts. | 36 // Whether this object is listening for global shortcuts. |
37 bool is_listening_; | 37 bool is_listening_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerChromeOS); | 39 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerChromeOS); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace extensions | 42 } // namespace extensions |
43 | 43 |
44 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ | 44 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_CHROMEOS_H_ |
OLD | NEW |