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

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

Issue 10917166: Extend the capability of SystemMonitor to support watching storage free space change (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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 CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_ 5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_
6 #define CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_ 6 #define CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 15
16 typedef LRESULT (*VolumeNameFunc)(LPCWSTR drive, 16 typedef LRESULT (*VolumeNameFunc)(LPCWSTR drive,
17 LPWSTR volume_name, 17 LPWSTR volume_name,
18 unsigned int volume_name_len); 18 unsigned int volume_name_len);
19 namespace chrome { 19 namespace chrome {
20 20
21 class MediaDeviceNotificationsWindowWin 21 class MediaDeviceNotificationsWindowWin
22 : public base::RefCountedThreadSafe<MediaDeviceNotificationsWindowWin> { 22 : public base::RefCountedThreadSafe<MediaDeviceNotificationsWindowWin>,
23 public base::SystemMonitor::StorageFreeSpaceDelegate {
23 public: 24 public:
24 MediaDeviceNotificationsWindowWin(); 25 MediaDeviceNotificationsWindowWin();
25 // Only for use in unit tests. 26 // Only for use in unit tests.
26 explicit MediaDeviceNotificationsWindowWin(VolumeNameFunc volumeNameFunc); 27 explicit MediaDeviceNotificationsWindowWin(VolumeNameFunc volumeNameFunc);
27 28
28 LRESULT OnDeviceChange(UINT event_type, DWORD data); 29 LRESULT OnDeviceChange(UINT event_type, DWORD data);
29 30
30 private: 31 private:
31 friend class base::RefCountedThreadSafe<MediaDeviceNotificationsWindowWin>; 32 friend class base::RefCountedThreadSafe<MediaDeviceNotificationsWindowWin>;
32 33
(...skipping 13 matching lines...) Expand all
46 47
47 void CheckDeviceTypeOnFileThread(const std::string& id, 48 void CheckDeviceTypeOnFileThread(const std::string& id,
48 const FilePath::StringType& device_name, 49 const FilePath::StringType& device_name,
49 const FilePath& path); 50 const FilePath& path);
50 51
51 void ProcessMediaDeviceAttachedOnUIThread( 52 void ProcessMediaDeviceAttachedOnUIThread(
52 const std::string& id, 53 const std::string& id,
53 const FilePath::StringType& device_name, 54 const FilePath::StringType& device_name,
54 const FilePath& path); 55 const FilePath& path);
55 56
57 // Overriden from SystemMonitor::StorageFreeSpaceDelegate.
58 virtual bool StartWatchingStorage(const FilePath::StringType& path) OVERRIDE;
59 virtual bool StopWatchingStorage(const FilePath::StringType& path) OVERRIDE;
60
56 // The window class of |window_|. 61 // The window class of |window_|.
57 ATOM atom_; 62 ATOM atom_;
58 63
59 // The handle of the module that contains the window procedure of |window_|. 64 // The handle of the module that contains the window procedure of |window_|.
60 HMODULE instance_; 65 HMODULE instance_;
61 66
62 HWND window_; 67 HWND window_;
63 VolumeNameFunc volume_name_func_; 68 VolumeNameFunc volume_name_func_;
64 69
65 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsWindowWin); 70 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsWindowWin);
66 }; 71 };
67 72
68 } // namespace chrome 73 } // namespace chrome
69 74
70 #endif // CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H _ 75 #endif // CHROME_BROWSER_SYSTEM_MONITOR_MEDIA_DEVICE_NOTIFICATIONS_WINDOW_WIN_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698