Index: chrome/browser/media_gallery/media_device_notification_window_win.cc |
diff --git a/content/browser/system_message_window_win.cc b/chrome/browser/media_gallery/media_device_notification_window_win.cc |
similarity index 76% |
copy from content/browser/system_message_window_win.cc |
copy to chrome/browser/media_gallery/media_device_notification_window_win.cc |
index 1aca1c1c184d960a3822aecac657442c5364f9ff..e94567939816617dde8cec3aae106b34886efd1a 100644 |
--- a/content/browser/system_message_window_win.cc |
+++ b/chrome/browser/media_gallery/media_device_notification_window_win.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "content/browser/system_message_window_win.h" |
+#include "chrome/browser/media_gallery/media_device_notification_window_win.h" |
#include <windows.h> |
#include <dbt.h> |
@@ -13,7 +13,8 @@ |
#include "base/system_monitor/system_monitor.h" |
#include "base/win/wrapped_window_proc.h" |
-static const wchar_t* const WindowClassName = L"Chrome_SystemMessageWindow"; |
+static const wchar_t* const WindowClassName = |
+ L"Chrome_MediaDeviceNotificationWindow"; |
namespace { |
@@ -38,24 +39,25 @@ DWORD GetVolumeBitMaskFromBroadcastHeader(DWORD data) { |
} // namespace |
+namespace chrome { |
-SystemMessageWindowWin::SystemMessageWindowWin() |
+MediaDeviceNotificationWindowWin::MediaDeviceNotificationWindowWin() |
: volume_name_func_(&GetVolumeName) { |
Init(); |
} |
-SystemMessageWindowWin::SystemMessageWindowWin(VolumeNameFunc volume_name_func) |
- : volume_name_func_(volume_name_func) { |
+MediaDeviceNotificationWindowWin::MediaDeviceNotificationWindowWin( |
+ VolumeNameFunc volume_name_func) : volume_name_func_(volume_name_func) { |
Init(); |
} |
-void SystemMessageWindowWin::Init() { |
+void MediaDeviceNotificationWindowWin::Init() { |
HINSTANCE hinst = GetModuleHandle(NULL); |
WNDCLASSEX wc = {0}; |
wc.cbSize = sizeof(wc); |
- wc.lpfnWndProc = |
- base::win::WrappedWindowProc<&SystemMessageWindowWin::WndProcThunk>; |
+ wc.lpfnWndProc = base::win::WrappedWindowProc< |
+ &MediaDeviceNotificationWindowWin::WndProcThunk>; |
vandebo (ex-Chrome)
2012/04/24 21:58:17
nit: four spaces
tpayne
2012/04/24 22:59:17
Done.
|
wc.hInstance = hinst; |
wc.lpszClassName = WindowClassName; |
ATOM clazz = RegisterClassEx(&wc); |
@@ -66,19 +68,17 @@ void SystemMessageWindowWin::Init() { |
SetWindowLongPtr(window_, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); |
} |
-SystemMessageWindowWin::~SystemMessageWindowWin() { |
+MediaDeviceNotificationWindowWin::~MediaDeviceNotificationWindowWin() { |
if (window_) { |
DestroyWindow(window_); |
UnregisterClass(WindowClassName, GetModuleHandle(NULL)); |
} |
} |
-LRESULT SystemMessageWindowWin::OnDeviceChange(UINT event_type, DWORD data) { |
+LRESULT MediaDeviceNotificationWindowWin::OnDeviceChange( |
+ UINT event_type, DWORD data) { |
vandebo (ex-Chrome)
2012/04/24 21:58:17
nit: looks like the first arg will fit on the prev
tpayne
2012/04/24 22:59:17
Done.
|
base::SystemMonitor* monitor = base::SystemMonitor::Get(); |
switch (event_type) { |
- case DBT_DEVNODES_CHANGED: |
- monitor->ProcessDevicesChanged(); |
- break; |
case DBT_DEVICEARRIVAL: { |
DWORD unitmask = GetVolumeBitMaskFromBroadcastHeader(data); |
for (int i = 0; unitmask; ++i, unitmask >>= 1) { |
@@ -107,8 +107,8 @@ LRESULT SystemMessageWindowWin::OnDeviceChange(UINT event_type, DWORD data) { |
return TRUE; |
} |
-LRESULT CALLBACK SystemMessageWindowWin::WndProc(HWND hwnd, UINT message, |
- WPARAM wparam, LPARAM lparam) { |
+LRESULT CALLBACK MediaDeviceNotificationWindowWin::WndProc( |
+ HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
switch (message) { |
case WM_DEVICECHANGE: |
return OnDeviceChange(static_cast<UINT>(wparam), |
@@ -119,3 +119,5 @@ LRESULT CALLBACK SystemMessageWindowWin::WndProc(HWND hwnd, UINT message, |
return ::DefWindowProc(hwnd, message, wparam, lparam); |
} |
+ |
+} // namespace chrome |