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 "chrome/browser/media_gallery/media_device_notifications_window_win.h" | 5 #include "chrome/browser/media_gallery/media_device_notifications_window_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <dbt.h> | 8 #include <dbt.h> |
| 9 |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/file_path.h" | 12 #include "base/file_path.h" |
12 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
13 #include "base/system_monitor/system_monitor.h" | 14 #include "base/system_monitor/system_monitor.h" |
14 #include "base/win/wrapped_window_proc.h" | 15 #include "base/win/wrapped_window_proc.h" |
15 | 16 |
16 static const wchar_t* const WindowClassName = | 17 namespace { |
17 L"Chrome_MediaDeviceNotificationWindow"; | |
18 | 18 |
19 namespace { | 19 const wchar_t WindowClassName[] = L"Chrome_MediaDeviceNotificationWindow"; |
20 | 20 |
21 LRESULT GetVolumeName(LPCWSTR drive, | 21 LRESULT GetVolumeName(LPCWSTR drive, |
22 LPWSTR volume_name, | 22 LPWSTR volume_name, |
23 unsigned int volume_name_len) { | 23 unsigned int volume_name_len) { |
24 return GetVolumeInformation(drive, volume_name, volume_name_len, NULL, NULL, | 24 return GetVolumeInformation(drive, volume_name, volume_name_len, NULL, NULL, |
25 NULL, NULL, 0); | 25 NULL, NULL, 0); |
26 } | 26 } |
27 | 27 |
28 // Returns 0 if the devicetype is not volume. | 28 // Returns 0 if the devicetype is not volume. |
29 DWORD GetVolumeBitMaskFromBroadcastHeader(DWORD data) { | 29 DWORD GetVolumeBitMaskFromBroadcastHeader(DWORD data) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 LPARAM lparam) { | 136 LPARAM lparam) { |
137 MediaDeviceNotificationsWindowWin* msg_wnd = | 137 MediaDeviceNotificationsWindowWin* msg_wnd = |
138 reinterpret_cast<MediaDeviceNotificationsWindowWin*>( | 138 reinterpret_cast<MediaDeviceNotificationsWindowWin*>( |
139 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | 139 GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
140 if (msg_wnd) | 140 if (msg_wnd) |
141 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | 141 return msg_wnd->WndProc(hwnd, message, wparam, lparam); |
142 return ::DefWindowProc(hwnd, message, wparam, lparam); | 142 return ::DefWindowProc(hwnd, message, wparam, lparam); |
143 } | 143 } |
144 | 144 |
145 } // namespace chrome | 145 } // namespace chrome |
OLD | NEW |