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 #include "media/device_monitors/system_message_window_win.h" | 5 #include "media/device_monitors/system_message_window_win.h" |
6 | 6 |
7 #include <dbt.h> | 7 #include <dbt.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/system_monitor/system_monitor.h" | 12 #include "base/system_monitor/system_monitor.h" |
13 #include "base/win/wrapped_window_proc.h" | 13 #include "base/win/wrapped_window_proc.h" |
14 #include "media/audio/win/core_audio_util_win.h" | 14 #include "media/audio/win/core_audio_util_win.h" |
15 | 15 |
16 namespace media { | 16 namespace media { |
17 | 17 |
18 namespace { | 18 namespace { |
19 const wchar_t kWindowClassName[] = L"Chrome_SystemMessageWindow"; | 19 const wchar_t kWindowClassName[] = L"Chrome_SystemMessageWindow"; |
20 | 20 |
21 // A static map from a device category guid to base::SystemMonitor::DeviceType. | 21 // A static map from a device category guid to base::SystemMonitor::DeviceType. |
22 struct { | 22 struct { |
23 const GUID device_category; | 23 const GUID device_category; |
24 const base::SystemMonitor::DeviceType device_type; | 24 const base::SystemMonitor::DeviceType device_type; |
25 } const kDeviceCategoryMap[] = { | 25 } const kDeviceCategoryMap[] = { |
26 {KSCATEGORY_AUDIO, base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE}, | 26 {KSCATEGORY_AUDIO, base::SystemMonitor::DEVTYPE_AUDIO}, |
27 {KSCATEGORY_VIDEO, base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE}, | 27 {KSCATEGORY_VIDEO, base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE}, |
28 }; | 28 }; |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 // Manages the device notification handles for SystemMessageWindowWin. | 31 // Manages the device notification handles for SystemMessageWindowWin. |
32 class SystemMessageWindowWin::DeviceNotifications { | 32 class SystemMessageWindowWin::DeviceNotifications { |
33 public: | 33 public: |
34 explicit DeviceNotifications(HWND hwnd) : notifications_() { Register(hwnd); } | 34 explicit DeviceNotifications(HWND hwnd) : notifications_() { Register(hwnd); } |
35 | 35 |
36 ~DeviceNotifications() { Unregister(); } | 36 ~DeviceNotifications() { Unregister(); } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 case WM_DEVICECHANGE: | 150 case WM_DEVICECHANGE: |
151 return OnDeviceChange(static_cast<UINT>(wparam), lparam); | 151 return OnDeviceChange(static_cast<UINT>(wparam), lparam); |
152 default: | 152 default: |
153 break; | 153 break; |
154 } | 154 } |
155 | 155 |
156 return ::DefWindowProc(hwnd, message, wparam, lparam); | 156 return ::DefWindowProc(hwnd, message, wparam, lparam); |
157 } | 157 } |
158 | 158 |
159 } // namespace media | 159 } // namespace media |
OLD | NEW |