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

Side by Side Diff: chrome/browser/media_gallery/media_device_notifications_window_win.h

Issue 10211008: Moves media device notification code to chrome/browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 8 years, 8 months 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 unified diff | Download patch
OLDNEW
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 #ifndef CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_
6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "content/common/content_export.h"
13 12
14 typedef LRESULT (*VolumeNameFunc)(LPCWSTR drive, 13 typedef LRESULT (*VolumeNameFunc)(LPCWSTR drive,
15 LPWSTR volume_name, 14 LPWSTR volume_name,
16 unsigned int volume_name_len); 15 unsigned int volume_name_len);
16 namespace chrome {
17 17
18 class CONTENT_EXPORT SystemMessageWindowWin { 18 class MediaDeviceNotificationsWindowWin {
19 public: 19 public:
20 SystemMessageWindowWin(); 20 MediaDeviceNotificationsWindowWin();
21 // Only for use in unit tests. 21 // Only for use in unit tests.
22 explicit SystemMessageWindowWin::SystemMessageWindowWin( 22 explicit MediaDeviceNotificationsWindowWin::MediaDeviceNotificationsWindowWin(
Lei Zhang 2012/04/24 23:10:42 Do you need to write this as Foo::Foo(params) ?
tpayne 2012/04/25 00:04:31 Done.
23 VolumeNameFunc volumeNameFunc); 23 VolumeNameFunc volumeNameFunc);
24 24
25 virtual ~SystemMessageWindowWin(); 25 virtual ~MediaDeviceNotificationsWindowWin();
26 26
27 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data); 27 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data);
28 28
29 private: 29 private:
30 void Init(); 30 void Init();
31 31
32 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, 32 LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
33 WPARAM wparam, LPARAM lparam); 33 WPARAM wparam, LPARAM lparam);
34 34
35 static LRESULT CALLBACK WndProcThunk(HWND hwnd, 35 static LRESULT CALLBACK WndProcThunk(HWND hwnd,
36 UINT message, 36 UINT message,
37 WPARAM wparam, 37 WPARAM wparam,
38 LPARAM lparam) { 38 LPARAM lparam) {
39 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( 39 MediaDeviceNotificationsWindowWin* msg_wnd =
Lei Zhang 2012/04/24 23:10:42 Would you mind moving the implementation to the .c
tpayne 2012/04/25 00:04:31 Done.
40 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 40 reinterpret_cast<MediaDeviceNotificationsWindowWin*>(
41 GetWindowLongPtr(hwnd, GWLP_USERDATA));
41 if (msg_wnd) 42 if (msg_wnd)
42 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 43 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
43 return ::DefWindowProc(hwnd, message, wparam, lparam); 44 return ::DefWindowProc(hwnd, message, wparam, lparam);
44 } 45 }
45 46
46 HWND window_; 47 HWND window_;
47 VolumeNameFunc volume_name_func_; 48 VolumeNameFunc volume_name_func_;
48 49
49 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); 50 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsWindowWin);
50 }; 51 };
51 52
52 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ 53 } // namespace chrome
54
55 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698