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 CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <windows.h> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 typedef LRESULT (*VolumeNameFunc)(LPCWSTR drive, |
| 14 LPWSTR volume_name, |
| 15 unsigned int volume_name_len); |
| 16 namespace chrome { |
| 17 |
| 18 class MediaDeviceNotificationsWindowWin { |
| 19 public: |
| 20 MediaDeviceNotificationsWindowWin(); |
| 21 // Only for use in unit tests. |
| 22 explicit MediaDeviceNotificationsWindowWin(VolumeNameFunc volumeNameFunc); |
| 23 |
| 24 virtual ~MediaDeviceNotificationsWindowWin(); |
| 25 |
| 26 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data); |
| 27 |
| 28 private: |
| 29 void Init(); |
| 30 |
| 31 LRESULT CALLBACK WndProc(HWND hwnd, |
| 32 UINT message, |
| 33 WPARAM wparam, |
| 34 LPARAM lparam); |
| 35 |
| 36 static LRESULT CALLBACK WndProcThunk(HWND hwnd, |
| 37 UINT message, |
| 38 WPARAM wparam, |
| 39 LPARAM lparam); |
| 40 |
| 41 HWND window_; |
| 42 VolumeNameFunc volume_name_func_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsWindowWin); |
| 45 }; |
| 46 |
| 47 } // namespace chrome |
| 48 |
| 49 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_ |
OLD | NEW |