OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | 5 #ifndef CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ |
6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | 6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 | 13 |
13 class CONTENT_EXPORT SystemMessageWindowWin { | 14 class CONTENT_EXPORT SystemMessageWindowWin { |
14 public: | 15 public: |
15 SystemMessageWindowWin(); | 16 SystemMessageWindowWin(); |
16 | 17 |
17 virtual ~SystemMessageWindowWin(); | 18 virtual ~SystemMessageWindowWin(); |
18 | 19 |
19 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data); | 20 virtual LRESULT OnDeviceChange(UINT event_type, DWORD_PTR data); |
20 | 21 |
21 private: | 22 private: |
22 void Init(); | 23 void Init(); |
23 | 24 |
24 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, | 25 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, |
25 WPARAM wparam, LPARAM lparam); | 26 WPARAM wparam, LPARAM lparam); |
26 | 27 |
27 static LRESULT CALLBACK WndProcThunk(HWND hwnd, | 28 static LRESULT CALLBACK WndProcThunk(HWND hwnd, |
28 UINT message, | 29 UINT message, |
29 WPARAM wparam, | 30 WPARAM wparam, |
30 LPARAM lparam) { | 31 LPARAM lparam) { |
31 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( | 32 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( |
32 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | 33 GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
33 if (msg_wnd) | 34 if (msg_wnd) |
34 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | 35 return msg_wnd->WndProc(hwnd, message, wparam, lparam); |
35 return ::DefWindowProc(hwnd, message, wparam, lparam); | 36 return ::DefWindowProc(hwnd, message, wparam, lparam); |
36 } | 37 } |
37 | 38 |
38 HMODULE instance_; | 39 HMODULE instance_; |
39 HWND window_; | 40 HWND window_; |
| 41 class DeviceNotifications; |
| 42 scoped_ptr<DeviceNotifications> device_notifications_; |
40 | 43 |
41 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); | 44 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); |
42 }; | 45 }; |
43 | 46 |
44 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | 47 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ |
OLD | NEW |