| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 TOOLS_MEMORY_WATCHER_HOTKEY_H_ | 5 #ifndef TOOLS_MEMORY_WATCHER_HOTKEY_H_ |
| 6 #define TOOLS_MEMORY_WATCHER_HOTKEY_H_ | 6 #define TOOLS_MEMORY_WATCHER_HOTKEY_H_ |
| 7 | 7 |
| 8 #include "ui/base/win/window_impl.h" | |
| 9 #include "ui/gfx/rect.h" | 8 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/win/window_impl.h" |
| 10 | 10 |
| 11 // HotKey handler. | 11 // HotKey handler. |
| 12 // Programs wishing to register a hotkey can use this. | 12 // Programs wishing to register a hotkey can use this. |
| 13 class HotKeyHandler : public ui::WindowImpl { | 13 class HotKeyHandler : public gfx::WindowImpl { |
| 14 public: | 14 public: |
| 15 HotKeyHandler(UINT modifiers, UINT vk) | 15 HotKeyHandler(UINT modifiers, UINT vk) |
| 16 : modifiers_(modifiers), | 16 : modifiers_(modifiers), |
| 17 vkey_(vk) { | 17 vkey_(vk) { |
| 18 Start(); | 18 Start(); |
| 19 } | 19 } |
| 20 ~HotKeyHandler() { Stop(); } | 20 ~HotKeyHandler() { Stop(); } |
| 21 | 21 |
| 22 BEGIN_MSG_MAP_EX(HotKeyHandler) | 22 BEGIN_MSG_MAP_EX(HotKeyHandler) |
| 23 MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) | 23 MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Handle the registered Hotkey being pressed. | 40 // Handle the registered Hotkey being pressed. |
| 41 virtual LRESULT OnHotKey(UINT /*uMsg*/, WPARAM /*wParam*/, | 41 virtual LRESULT OnHotKey(UINT /*uMsg*/, WPARAM /*wParam*/, |
| 42 LPARAM /*lParam*/, BOOL& bHandled) = 0; | 42 LPARAM /*lParam*/, BOOL& bHandled) = 0; |
| 43 | 43 |
| 44 UINT modifiers_; | 44 UINT modifiers_; |
| 45 UINT vkey_; | 45 UINT vkey_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #endif // TOOLS_MEMORY_WATCHER_HOTKEY_H_ | 48 #endif // TOOLS_MEMORY_WATCHER_HOTKEY_H_ |
| OLD | NEW |