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_WIN_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/extensions/global_shortcut_listener.h" | 13 #include "chrome/browser/extensions/global_shortcut_listener.h" |
13 #include "ui/gfx/win/singleton_hwnd_observer.h" | 14 #include "ui/gfx/win/singleton_hwnd_observer.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // Windows-specific implementation of the GlobalShortcutListener class that | 18 // Windows-specific implementation of the GlobalShortcutListener class that |
18 // listens for global shortcuts. Handles setting up a keyboard hook and | 19 // listens for global shortcuts. Handles setting up a keyboard hook and |
19 // forwarding its output to the base class for processing. | 20 // forwarding its output to the base class for processing. |
20 class GlobalShortcutListenerWin : public GlobalShortcutListener { | 21 class GlobalShortcutListenerWin : public GlobalShortcutListener { |
21 public: | 22 public: |
(...skipping 10 matching lines...) Expand all Loading... |
32 bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override; | 33 bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override; |
33 void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override; | 34 void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override; |
34 | 35 |
35 // Whether this object is listening for global shortcuts. | 36 // Whether this object is listening for global shortcuts. |
36 bool is_listening_; | 37 bool is_listening_; |
37 | 38 |
38 // A map of registered accelerators and their registration ids. | 39 // A map of registered accelerators and their registration ids. |
39 typedef std::map<ui::Accelerator, int> HotkeyIdMap; | 40 typedef std::map<ui::Accelerator, int> HotkeyIdMap; |
40 HotkeyIdMap hotkey_ids_; | 41 HotkeyIdMap hotkey_ids_; |
41 | 42 |
42 scoped_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_; | 43 std::unique_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerWin); | 45 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerWin); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace extensions | 48 } // namespace extensions |
48 | 49 |
49 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ | 50 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_WIN_H_ |
OLD | NEW |