Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 5 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
| 6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 base::string16* storage_object_id) const OVERRIDE; | 43 base::string16* storage_object_id) const OVERRIDE; |
| 44 | 44 |
| 45 virtual void EjectDevice( | 45 virtual void EjectDevice( |
| 46 const std::string& device_id, | 46 const std::string& device_id, |
| 47 base::Callback<void(EjectStatus)> callback) OVERRIDE; | 47 base::Callback<void(EjectStatus)> callback) OVERRIDE; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 class PortableDeviceNotifications; | 50 class PortableDeviceNotifications; |
| 51 friend class TestStorageMonitorWin; | 51 friend class TestStorageMonitorWin; |
| 52 | 52 |
| 53 void MediaChangeNotificationRegister(); | |
| 54 | |
| 53 // Gets the removable storage information given a |device_path|. On success, | 55 // Gets the removable storage information given a |device_path|. On success, |
| 54 // returns true and fills in |info|. | 56 // returns true and fills in |info|. |
| 55 bool GetDeviceInfo(const base::FilePath& device_path, | 57 bool GetDeviceInfo(const base::FilePath& device_path, |
| 56 StorageInfo* info) const; | 58 StorageInfo* info) const; |
| 57 | 59 |
| 58 static LRESULT CALLBACK WndProcThunk(HWND hwnd, UINT message, WPARAM wparam, | 60 static LRESULT CALLBACK WndProcThunk(HWND hwnd, UINT message, WPARAM wparam, |
| 59 LPARAM lparam); | 61 LPARAM lparam); |
| 60 | 62 |
| 61 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, | 63 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, |
| 62 LPARAM lparam); | 64 LPARAM lparam); |
| 63 | 65 |
| 64 void OnDeviceChange(UINT event_type, LPARAM data); | 66 void OnDeviceChange(UINT event_type, LPARAM data); |
| 67 void OnMediaChange(WPARAM wparam, LPARAM lparam); | |
| 65 | 68 |
| 66 // The window class of |window_|. | 69 // The window class of |window_|. |
| 67 ATOM window_class_; | 70 ATOM window_class_; |
| 68 | 71 |
| 69 // The handle of the module that contains the window procedure of |window_|. | 72 // The handle of the module that contains the window procedure of |window_|. |
| 70 HMODULE instance_; | 73 HMODULE instance_; |
| 71 HWND window_; | 74 HWND window_; |
| 72 | 75 |
| 76 // The handle of a registration for shell notifications. | |
| 77 ULONG registration_handle_; | |
|
vandebo (ex-Chrome)
2014/04/23 16:34:35
This could have a more descriptive name
Kevin Bailey
2014/04/23 18:06:14
|notification_registration_handle_| ? I use "handl
vandebo (ex-Chrome)
2014/04/23 18:09:27
There's lots of things that are registered... shel
rvargas (doing something else)
2014/04/23 18:45:15
Given that this is not really a handle, shell_chan
Kevin Bailey
2014/04/24 15:12:38
Done.
| |
| 78 | |
| 73 // The volume mount point watcher, used to manage the mounted devices. | 79 // The volume mount point watcher, used to manage the mounted devices. |
| 74 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_; | 80 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_; |
| 75 | 81 |
| 76 // The portable device watcher, used to manage media transfer protocol | 82 // The portable device watcher, used to manage media transfer protocol |
| 77 // devices. | 83 // devices. |
| 78 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; | 84 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; |
| 79 | 85 |
| 80 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); | 86 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 } // namespace storage_monitor | 89 } // namespace storage_monitor |
| 84 | 90 |
| 85 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 91 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
| OLD | NEW |