Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1142)

Unified Diff: content/browser/system_message_window_win.cc

Issue 11529012: Use the device listener in Media on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/audio/win/audio_device_listener_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/system_message_window_win.cc
diff --git a/content/browser/system_message_window_win.cc b/content/browser/system_message_window_win.cc
index d2a7808223c07993701cd63eb76094772dc772c9..07e5827af353d5212430a033664455e96cf1b655 100644
--- a/content/browser/system_message_window_win.cc
+++ b/content/browser/system_message_window_win.cc
@@ -10,11 +10,13 @@
#include "base/logging.h"
#include "base/system_monitor/system_monitor.h"
+#include "base/win/windows_version.h"
#include "base/win/wrapped_window_proc.h"
namespace content {
namespace {
+
const wchar_t kWindowClassName[] = L"Chrome_SystemMessageWindow";
// A static map from a device category guid to base::SystemMonitor::DeviceType.
@@ -25,6 +27,11 @@ struct {
{ KSCATEGORY_AUDIO, base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE },
{ KSCATEGORY_VIDEO, base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE },
};
+
+bool IsCoreAudioSupported() {
+ return (base::win::GetVersion() >= base::win::VERSION_VISTA);
+}
+
} // namespace
// Manages the device notification handles for SystemMessageWindowWin.
@@ -46,6 +53,11 @@ class SystemMessageWindowWin::DeviceNotifications {
filter.dbcc_size = sizeof(filter);
filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
for (int i = 0; i < arraysize(kDeviceCategoryMap); ++i) {
+ // From Vista, we use a device listener in AudioDeviceListenerWin.
+ if (IsCoreAudioSupported() &&
DaleCurtis 2012/12/11 19:27:59 This should use Henrik's CoreAudioUtil class.
no longer working on chromium 2012/12/11 20:15:49 I tried include the media/audio/win/core_audio_uti
no longer working on chromium 2012/12/12 10:17:16 including the CoreAudioUtil.h gives me this compil
tommi (sloooow) - chröme 2012/12/12 13:01:09 This doesn't look like related to CoreAudioUtil.h
+ KSCATEGORY_AUDIO == kDeviceCategoryMap[i].device_category)
+ continue;
+
filter.dbcc_classguid = kDeviceCategoryMap[i].device_category;
DCHECK_EQ(notifications_[i], static_cast<HDEVNOTIFY>(NULL));
notifications_[i] = RegisterDeviceNotification(
« no previous file with comments | « no previous file | media/audio/win/audio_device_listener_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698