OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_CAPTURE_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
6 #define MEDIA_CAPTURE_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
7 | |
8 #include <windows.h> | |
9 | |
10 #include <memory> | |
11 | |
12 #include "base/macros.h" | |
13 #include "media/capture/capture_export.h" | |
14 | |
15 namespace media { | |
16 | |
17 class CAPTURE_EXPORT SystemMessageWindowWin { | |
18 public: | |
19 SystemMessageWindowWin(); | |
20 | |
21 virtual ~SystemMessageWindowWin(); | |
22 | |
23 virtual LRESULT OnDeviceChange(UINT event_type, LPARAM data); | |
24 | |
25 private: | |
26 void Init(); | |
27 | |
28 LRESULT CALLBACK WndProc(HWND hwnd, | |
29 UINT message, | |
30 WPARAM wparam, | |
31 LPARAM lparam); | |
32 | |
33 static LRESULT CALLBACK WndProcThunk(HWND hwnd, | |
34 UINT message, | |
35 WPARAM wparam, | |
36 LPARAM lparam) { | |
37 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( | |
38 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | |
39 if (msg_wnd) | |
40 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | |
41 return ::DefWindowProc(hwnd, message, wparam, lparam); | |
42 } | |
43 | |
44 HMODULE instance_; | |
45 HWND window_; | |
46 class DeviceNotifications; | |
47 std::unique_ptr<DeviceNotifications> device_notifications_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); | |
50 }; | |
51 | |
52 } // namespace media | |
53 | |
54 #endif // MEDIA_CAPTURE_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
OLD | NEW |