| 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_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| 6 #define CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 6 #define CHROME_BROWSER_SYSTEM_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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // identifier. | 84 // identifier. |
| 85 virtual bool GetMTPStorageInfoFromDeviceId( | 85 virtual bool GetMTPStorageInfoFromDeviceId( |
| 86 const std::string& storage_device_id, | 86 const std::string& storage_device_id, |
| 87 string16* device_location, | 87 string16* device_location, |
| 88 string16* storage_object_id) const; | 88 string16* storage_object_id) const; |
| 89 | 89 |
| 90 // Constructs and returns a storage path from storage unique identifier. | 90 // Constructs and returns a storage path from storage unique identifier. |
| 91 static string16 GetStoragePathFromStorageId( | 91 static string16 GetStoragePathFromStorageId( |
| 92 const std::string& storage_unique_id); | 92 const std::string& storage_unique_id); |
| 93 | 93 |
| 94 // Set the volume notifications object to be used when new |
| 95 // devices are found. |
| 96 void SetNotifications(RemovableStorageNotifications::Receiver* notifications); |
| 97 |
| 94 private: | 98 private: |
| 95 friend class test::TestPortableDeviceWatcherWin; | 99 friend class test::TestPortableDeviceWatcherWin; |
| 96 | 100 |
| 97 // Key: MTP device storage unique id. | 101 // Key: MTP device storage unique id. |
| 98 // Value: Metadata for the given storage. | 102 // Value: Metadata for the given storage. |
| 99 typedef std::map<std::string, RemovableStorageNotifications::StorageInfo> | 103 typedef std::map<std::string, RemovableStorageNotifications::StorageInfo> |
| 100 MTPStorageMap; | 104 MTPStorageMap; |
| 101 | 105 |
| 102 // Key: MTP device plug and play ID string. | 106 // Key: MTP device plug and play ID string. |
| 103 // Value: Vector of device storage objects. | 107 // Value: Vector of device storage objects. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 125 // Attached media transfer protocol device storage objects map. | 129 // Attached media transfer protocol device storage objects map. |
| 126 MTPStorageMap storage_map_; | 130 MTPStorageMap storage_map_; |
| 127 | 131 |
| 128 // The task runner used to execute tasks that may take a long time and thus | 132 // The task runner used to execute tasks that may take a long time and thus |
| 129 // should not be performed on the UI thread. | 133 // should not be performed on the UI thread. |
| 130 scoped_refptr<base::SequencedTaskRunner> media_task_runner_; | 134 scoped_refptr<base::SequencedTaskRunner> media_task_runner_; |
| 131 | 135 |
| 132 // Used by |media_task_runner_| to create cancelable callbacks. | 136 // Used by |media_task_runner_| to create cancelable callbacks. |
| 133 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_; | 137 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_; |
| 134 | 138 |
| 139 // The notifications object to use to signal newly attached devices. |
| 140 RemovableStorageNotifications::Receiver* storage_notifications_; |
| 141 |
| 135 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); | 142 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); |
| 136 }; | 143 }; |
| 137 | 144 |
| 138 } // namespace chrome | 145 } // namespace chrome |
| 139 | 146 |
| 140 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 147 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| OLD | NEW |