Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: tools/memory_watcher/hotkey.h

Issue 196081: Use base::WindowImpl instead of CWindowImpl to remove a dependency on ATL.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/memory_watcher/memory_watcher.gyp » ('j') | tools/memory_watcher/memory_watcher.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/memory_watcher/hotkey.h
===================================================================
--- tools/memory_watcher/hotkey.h (revision 25904)
+++ tools/memory_watcher/hotkey.h (working copy)
@@ -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_
« no previous file with comments | « no previous file | tools/memory_watcher/memory_watcher.gyp » ('j') | tools/memory_watcher/memory_watcher.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698