OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
7 #pragma once | |
8 | |
9 #include "build/build_config.h" | |
10 | |
11 #if defined(OS_WIN) | |
jam
2011/11/14 18:48:13
better to include this file only for windows, and
| |
12 #include <windows.h> | |
13 #endif // defined(OS_WIN) | |
14 | |
15 #include "base/basictypes.h" | |
16 #include "content/common/content_export.h" | |
17 | |
18 class CONTENT_EXPORT SystemMessageWindowWin { | |
19 public: | |
20 SystemMessageWindowWin(); | |
21 virtual ~SystemMessageWindowWin(); | |
22 | |
23 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data); | |
24 | |
25 private: | |
26 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, | |
27 WPARAM wparam, LPARAM lparam); | |
28 | |
29 static LRESULT CALLBACK WndProcThunk(HWND hwnd, | |
30 UINT message, | |
31 WPARAM wparam, | |
32 LPARAM lparam) { | |
33 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( | |
34 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | |
35 if (msg_wnd) | |
36 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | |
37 return ::DefWindowProc(hwnd, message, wparam, lparam); | |
38 } | |
39 | |
40 HWND window_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); | |
43 }; | |
44 | |
45 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
OLD | NEW |