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 "content/browser/system_message_window_win.h" | 5 #include "content/browser/system_message_window_win.h" |
6 | 6 |
7 #include <dbt.h> | 7 #include <dbt.h> |
8 #include <ks.h> | 8 #include <ks.h> |
9 #include <ksmedia.h> | 9 #include <ksmedia.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.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 | 14 |
15 namespace content { | |
16 | |
17 namespace { | 15 namespace { |
18 | |
19 const wchar_t kWindowClassName[] = L"Chrome_SystemMessageWindow"; | 16 const wchar_t kWindowClassName[] = L"Chrome_SystemMessageWindow"; |
20 | 17 |
21 // A static map from a device category guid to base::SystemMonitor::DeviceType. | 18 // A static map from a device category guid to base::SystemMonitor::DeviceType. |
22 struct { | 19 struct { |
23 const GUID device_category; | 20 const GUID device_category; |
24 const base::SystemMonitor::DeviceType device_type; | 21 const base::SystemMonitor::DeviceType device_type; |
25 } const kDeviceCategoryMap[] = { | 22 } const kDeviceCategoryMap[] = { |
26 { KSCATEGORY_AUDIO, base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE }, | 23 { KSCATEGORY_AUDIO, base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE }, |
27 { KSCATEGORY_VIDEO, base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE }, | 24 { KSCATEGORY_VIDEO, base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE }, |
28 }; | 25 }; |
29 | |
30 } // namespace | 26 } // namespace |
31 | 27 |
32 // Manages the device notification handles for SystemMessageWindowWin. | 28 // Manages the device notification handles for SystemMessageWindowWin. |
33 class SystemMessageWindowWin::DeviceNotifications { | 29 class SystemMessageWindowWin::DeviceNotifications { |
34 public: | 30 public: |
35 explicit DeviceNotifications(HWND hwnd) : notifications_() { | 31 explicit DeviceNotifications(HWND hwnd) : notifications_() { |
36 Register(hwnd); | 32 Register(hwnd); |
37 } | 33 } |
38 | 34 |
39 ~DeviceNotifications() { | 35 ~DeviceNotifications() { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 WPARAM wparam, LPARAM lparam) { | 142 WPARAM wparam, LPARAM lparam) { |
147 switch (message) { | 143 switch (message) { |
148 case WM_DEVICECHANGE: | 144 case WM_DEVICECHANGE: |
149 return OnDeviceChange(static_cast<UINT>(wparam), lparam); | 145 return OnDeviceChange(static_cast<UINT>(wparam), lparam); |
150 default: | 146 default: |
151 break; | 147 break; |
152 } | 148 } |
153 | 149 |
154 return ::DefWindowProc(hwnd, message, wparam, lparam); | 150 return ::DefWindowProc(hwnd, message, wparam, lparam); |
155 } | 151 } |
156 | |
157 } // namespace content | |
OLD | NEW |