Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| 6 #define CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| 7 | 7 |
| 8 #include <portabledeviceapi.h> | 8 #include <portabledeviceapi.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 namespace chrome { | 23 namespace chrome { |
| 24 | 24 |
| 25 namespace test { | 25 namespace test { |
| 26 class TestPortableDeviceWatcherWin; | 26 class TestPortableDeviceWatcherWin; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // This class watches the portable device mount points and sends notifications | 29 // This class watches the portable device mount points and sends notifications |
| 30 // about the attached/detached media transfer protocol (MTP) devices. | 30 // about the attached/detached media transfer protocol (MTP) devices. |
| 31 // This is a singleton class instantiated by | 31 // This is a singleton class instantiated by |
| 32 // RemovableDeviceNotificationsWindowWin. This class is created, destroyed and | 32 // StorageMonitorWindowWin. This class is created, destroyed and |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
StorageMonitorWin x2
| |
| 33 // operates on the UI thread, except for long running tasks it spins off to a | 33 // operates on the UI thread, except for long running tasks it spins off to a |
| 34 // SequencedTaskRunner. | 34 // SequencedTaskRunner. |
| 35 class PortableDeviceWatcherWin { | 35 class PortableDeviceWatcherWin { |
| 36 public: | 36 public: |
| 37 typedef std::vector<string16> StorageObjectIDs; | 37 typedef std::vector<string16> StorageObjectIDs; |
| 38 | 38 |
| 39 struct DeviceStorageObject { | 39 struct DeviceStorageObject { |
| 40 DeviceStorageObject(const string16& temporary_id, | 40 DeviceStorageObject(const string16& temporary_id, |
| 41 const std::string& persistent_id); | 41 const std::string& persistent_id); |
| 42 | 42 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 64 StorageObjects storage_objects; | 64 StorageObjects storage_objects; |
| 65 }; | 65 }; |
| 66 typedef std::vector<DeviceDetails> Devices; | 66 typedef std::vector<DeviceDetails> Devices; |
| 67 | 67 |
| 68 // TODO(gbillock): Change to take the device notifications object as | 68 // TODO(gbillock): Change to take the device notifications object as |
| 69 // an argument. | 69 // an argument. |
| 70 PortableDeviceWatcherWin(); | 70 PortableDeviceWatcherWin(); |
| 71 virtual ~PortableDeviceWatcherWin(); | 71 virtual ~PortableDeviceWatcherWin(); |
| 72 | 72 |
| 73 // Must be called after the browser blocking pool is ready for use. | 73 // Must be called after the browser blocking pool is ready for use. |
| 74 // RemovableDeviceNotificationsWindowsWin::Init() will call this function. | 74 // StorageMonitorWindowsWin::Init() will call this function. |
| 75 void Init(HWND hwnd); | 75 void Init(HWND hwnd); |
| 76 | 76 |
| 77 // Processes DEV_BROADCAST_DEVICEINTERFACE messages and triggers a | 77 // Processes DEV_BROADCAST_DEVICEINTERFACE messages and triggers a |
| 78 // notification if appropriate. | 78 // notification if appropriate. |
| 79 void OnWindowMessage(UINT event_type, LPARAM data); | 79 void OnWindowMessage(UINT event_type, LPARAM data); |
| 80 | 80 |
| 81 // Gets the information of the MTP storage specified by |storage_device_id|. | 81 // Gets the information of the MTP storage specified by |storage_device_id|. |
| 82 // On success, returns true and fills in |device_location| with device | 82 // On success, returns true and fills in |device_location| with device |
| 83 // interface details and |storage_object_id| with storage object temporary | 83 // interface details and |storage_object_id| with storage object temporary |
| 84 // identifier. | 84 // identifier. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 138 |
| 139 // The notifications object to use to signal newly attached devices. | 139 // The notifications object to use to signal newly attached devices. |
| 140 StorageMonitor::Receiver* storage_notifications_; | 140 StorageMonitor::Receiver* storage_notifications_; |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); | 142 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace chrome | 145 } // namespace chrome |
| 146 | 146 |
| 147 #endif // CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 147 #endif // CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| OLD | NEW |