| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 virtual ~PortableDeviceWatcherWin(); | 64 virtual ~PortableDeviceWatcherWin(); |
| 65 | 65 |
| 66 // Must be called after the browser blocking pool is ready for use. | 66 // Must be called after the browser blocking pool is ready for use. |
| 67 // RemovableDeviceNotificationsWindowsWin::Init() will call this function. | 67 // RemovableDeviceNotificationsWindowsWin::Init() will call this function. |
| 68 void Init(HWND hwnd); | 68 void Init(HWND hwnd); |
| 69 | 69 |
| 70 // Processes DEV_BROADCAST_DEVICEINTERFACE messages and triggers a | 70 // Processes DEV_BROADCAST_DEVICEINTERFACE messages and triggers a |
| 71 // SystemMonitor notification if appropriate. | 71 // SystemMonitor notification if appropriate. |
| 72 void OnWindowMessage(UINT event_type, LPARAM data); | 72 void OnWindowMessage(UINT event_type, LPARAM data); |
| 73 | 73 |
| 74 // Gets the information of the MTP storage specified by |storage_device_id|. |
| 75 // On success, returns true and fills in |device_location| with device |
| 76 // interface details and |storage_object_id| with storage object temporary |
| 77 // identifier. |
| 78 bool GetMTPStorageInfoFromDeviceId(const std::string& storage_device_id, |
| 79 string16* device_location, |
| 80 string16* storage_object_id); |
| 81 |
| 74 private: | 82 private: |
| 75 friend class TestPortableDeviceWatcherWin; | 83 friend class TestPortableDeviceWatcherWin; |
| 76 | 84 |
| 77 // Key: MTP device storage unique id. | 85 // Key: MTP device storage unique id. |
| 78 // Value: Metadata for the given storage. | 86 // Value: Metadata for the given storage. |
| 79 typedef std::map<std::string, base::SystemMonitor::RemovableStorageInfo> | 87 typedef std::map<std::string, base::SystemMonitor::RemovableStorageInfo> |
| 80 MTPStorageMap; | 88 MTPStorageMap; |
| 81 | 89 |
| 82 // Key: MTP device plug and play ID string. | 90 // Key: MTP device plug and play ID string. |
| 83 // Value: Vector of device storage objects. | 91 // Value: Vector of device storage objects. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 111 | 119 |
| 112 // Used by |media_task_runner_| to create cancelable callbacks. | 120 // Used by |media_task_runner_| to create cancelable callbacks. |
| 113 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_; | 121 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_; |
| 114 | 122 |
| 115 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); | 123 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); |
| 116 }; | 124 }; |
| 117 | 125 |
| 118 } // namespace chrome | 126 } // namespace chrome |
| 119 | 127 |
| 120 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ | 128 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ |
| OLD | NEW |