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