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_STORAGE_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
| 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/observer_list_threadsafe.h" | 14 #include "base/observer_list_threadsafe.h" |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/storage_monitor/storage_info.h" | 17 #include "chrome/browser/storage_monitor/storage_info.h" |
| 18 | 18 |
| 19 class ChromeBrowserMainPartsLinux; | 19 class ChromeBrowserMainPartsLinux; |
| 20 class ChromeBrowserMainPartsMac; | 20 class ChromeBrowserMainPartsMac; |
| 21 class MediaGalleriesPrivateApiTest; | 21 class MediaGalleriesPrivateApiTest; |
| 22 class MediaGalleriesPrivateEjectApiTest; | 22 class MediaGalleriesPrivateEjectApiTest; |
| 23 class SystemInfoStorageApiTest; | 23 class SystemInfoStorageApiTest; |
| 24 | 24 |
| 25 namespace device { | |
| 26 class MediaTransferProtocolManager; | |
| 27 } | |
| 28 | |
| 25 namespace chrome { | 29 namespace chrome { |
| 26 | 30 |
| 27 class MediaFileSystemRegistryTest; | 31 class MediaFileSystemRegistryTest; |
| 28 class RemovableStorageObserver; | 32 class RemovableStorageObserver; |
| 29 class TransientDeviceIds; | 33 class TransientDeviceIds; |
| 30 | 34 |
| 31 // Base class for platform-specific instances watching for removable storage | 35 // Base class for platform-specific instances watching for removable storage |
| 32 // attachments/detachments. | 36 // attachments/detachments. |
| 33 // Lifecycle contracts: This class is created by ChromeBrowserMain | 37 // Lifecycle contracts: This class is created by ChromeBrowserMain |
| 34 // implementations before the profile is initialized, so listeners can be | 38 // implementations before the profile is initialized, so listeners can be |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 // On success, returns true and fills in |device_location| with device | 76 // On success, returns true and fills in |device_location| with device |
| 73 // interface details and |storage_object_id| with the string ID that | 77 // interface details and |storage_object_id| with the string ID that |
| 74 // uniquely identifies the object on the device. This ID need not be | 78 // uniquely identifies the object on the device. This ID need not be |
| 75 // persistent across sessions. | 79 // persistent across sessions. |
| 76 virtual bool GetMTPStorageInfoFromDeviceId( | 80 virtual bool GetMTPStorageInfoFromDeviceId( |
| 77 const std::string& storage_device_id, | 81 const std::string& storage_device_id, |
| 78 string16* device_location, | 82 string16* device_location, |
| 79 string16* storage_object_id) const = 0; | 83 string16* storage_object_id) const = 0; |
| 80 #endif | 84 #endif |
| 81 | 85 |
| 86 #if defined(OS_LINUX) | |
| 87 virtual device::MediaTransferProtocolManager* | |
|
Lei Zhang
2013/04/10 04:31:21
This is not ideal, as discussed in person at some
| |
| 88 media_transfer_protocol_manager() = 0; | |
| 89 #endif | |
| 90 | |
| 82 // Returns information for attached removable storage. | 91 // Returns information for attached removable storage. |
| 83 std::vector<StorageInfo> GetAttachedStorage() const; | 92 std::vector<StorageInfo> GetAttachedStorage() const; |
| 84 | 93 |
| 85 void AddObserver(RemovableStorageObserver* obs); | 94 void AddObserver(RemovableStorageObserver* obs); |
| 86 void RemoveObserver(RemovableStorageObserver* obs); | 95 void RemoveObserver(RemovableStorageObserver* obs); |
| 87 | 96 |
| 88 std::string GetTransientIdForDeviceId(const std::string& device_id); | 97 std::string GetTransientIdForDeviceId(const std::string& device_id); |
| 89 std::string GetDeviceIdForTransientId(const std::string& transient_id) const; | 98 std::string GetDeviceIdForTransientId(const std::string& transient_id) const; |
| 90 | 99 |
| 91 virtual void EjectDevice( | 100 virtual void EjectDevice( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 140 |
| 132 // Map of all the attached removable storage devices. | 141 // Map of all the attached removable storage devices. |
| 133 RemovableStorageMap storage_map_; | 142 RemovableStorageMap storage_map_; |
| 134 | 143 |
| 135 scoped_ptr<TransientDeviceIds> transient_device_ids_; | 144 scoped_ptr<TransientDeviceIds> transient_device_ids_; |
| 136 }; | 145 }; |
| 137 | 146 |
| 138 } // namespace chrome | 147 } // namespace chrome |
| 139 | 148 |
| 140 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 149 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
| OLD | NEW |