diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 21:24:42 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 21:24:42 +0000 |
commit | e7de7b8167ec1e264e15780bd7a2fb3f40a7138d (patch) | |
tree | b307955c07ecf27a0e0cbfb75f5b3d2e506385dc /tools/memory_watcher | |
parent | 3faa8bf360291a68a3d0cb679dee1f9750638d8b (diff) | |
download | chromium_src-e7de7b8167ec1e264e15780bd7a2fb3f40a7138d.zip chromium_src-e7de7b8167ec1e264e15780bd7a2fb3f40a7138d.tar.gz chromium_src-e7de7b8167ec1e264e15780bd7a2fb3f40a7138d.tar.bz2 |
Use base::WindowImpl instead of CWindowImpl to remove a dependency on ATL.
BUG=5027
TEST=none
Review URL: http://codereview.chromium.org/196081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/memory_watcher')
-rw-r--r-- | tools/memory_watcher/hotkey.h | 30 | ||||
-rw-r--r-- | tools/memory_watcher/memory_watcher.gyp | 3 |
2 files changed, 18 insertions, 15 deletions
diff --git a/tools/memory_watcher/hotkey.h b/tools/memory_watcher/hotkey.h index c8b1ef6..ef09e48 100644 --- a/tools/memory_watcher/hotkey.h +++ b/tools/memory_watcher/hotkey.h @@ -5,44 +5,44 @@ #ifndef TOOLS_MEMORY_WATCHER_HOTKEY_H_ #define TOOLS_MEMORY_WATCHER_HOTKEY_H_ -#include <atlbase.h> -#include <atlwin.h> +#include "base/gfx/rect.h" +#include "base/window_impl.h" // HotKey handler. // Programs wishing to register a hotkey can use this. -class HotKeyHandler : public CWindowImpl<HotKeyHandler> { +class HotKeyHandler : public base::WindowImpl { public: HotKeyHandler(UINT modifiers, UINT vk) - : m_modifiers(modifiers), - m_vkey(vk) { + : modifiers_(modifiers), + vkey_(vk) { Start(); } ~HotKeyHandler() { Stop(); } -BEGIN_MSG_MAP(HotKeyHandler) - MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) -END_MSG_MAP() + BEGIN_MSG_MAP_EX(HotKeyHandler) + MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) + END_MSG_MAP() private: static const int hotkey_id = 0x0000baba; bool Start() { - if (NULL == Create(NULL, NULL, NULL, WS_POPUP)) - return false; - return RegisterHotKey(m_hWnd, hotkey_id, m_modifiers, m_vkey) == TRUE; + set_window_style(WS_POPUP); + Init(NULL, gfx::Rect()); + return RegisterHotKey(hwnd(), hotkey_id, modifiers_, vkey_) == TRUE; } void Stop() { - UnregisterHotKey(m_hWnd, hotkey_id); - DestroyWindow(); + UnregisterHotKey(hwnd(), hotkey_id); + DestroyWindow(hwnd()); } // Handle the registered Hotkey being pressed. virtual LRESULT OnHotKey(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) = 0; - UINT m_modifiers; - UINT m_vkey; + UINT modifiers_; + UINT vkey_; }; #endif // TOOLS_MEMORY_WATCHER_HOTKEY_H_ diff --git a/tools/memory_watcher/memory_watcher.gyp b/tools/memory_watcher/memory_watcher.gyp index ab605a0..995affa 100644 --- a/tools/memory_watcher/memory_watcher.gyp +++ b/tools/memory_watcher/memory_watcher.gyp @@ -13,12 +13,15 @@ 'msvs_guid': '3BD81303-4E14-4559-AA69-B30C3BAB08DD', 'dependencies': [ '../../base/base.gyp:base', + '../../base/base.gyp:base_gfx', ], 'defines': [ 'BUILD_MEMORY_WATCHER', ], 'include_dirs': [ '../..', + # TODO(beng): move wtl to src/third_party + '../../chrome/third_party/wtl/include', ], 'sources': [ 'call_stack.cc', |