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 PlatformAppMediaGalleriesBrowserTest; | 23 class PlatformAppMediaGalleriesBrowserTest; |
24 class SystemInfoStorageApiTest; | 24 class SystemInfoStorageApiTest; |
25 | 25 |
| 26 namespace device { |
| 27 class MediaTransferProtocolManager; |
| 28 } |
| 29 |
26 namespace chrome { | 30 namespace chrome { |
27 | 31 |
28 class MediaFileSystemRegistryTest; | 32 class MediaFileSystemRegistryTest; |
29 class RemovableStorageObserver; | 33 class RemovableStorageObserver; |
30 class TransientDeviceIds; | 34 class TransientDeviceIds; |
31 | 35 |
32 // Base class for platform-specific instances watching for removable storage | 36 // Base class for platform-specific instances watching for removable storage |
33 // attachments/detachments. | 37 // attachments/detachments. |
34 // Lifecycle contracts: This class is created by ChromeBrowserMain | 38 // Lifecycle contracts: This class is created by ChromeBrowserMain |
35 // implementations before the profile is initialized, so listeners can be | 39 // implementations before the profile is initialized, so listeners can be |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // On success, returns true and fills in |device_location| with device | 77 // On success, returns true and fills in |device_location| with device |
74 // interface details and |storage_object_id| with the string ID that | 78 // interface details and |storage_object_id| with the string ID that |
75 // uniquely identifies the object on the device. This ID need not be | 79 // uniquely identifies the object on the device. This ID need not be |
76 // persistent across sessions. | 80 // persistent across sessions. |
77 virtual bool GetMTPStorageInfoFromDeviceId( | 81 virtual bool GetMTPStorageInfoFromDeviceId( |
78 const std::string& storage_device_id, | 82 const std::string& storage_device_id, |
79 string16* device_location, | 83 string16* device_location, |
80 string16* storage_object_id) const = 0; | 84 string16* storage_object_id) const = 0; |
81 #endif | 85 #endif |
82 | 86 |
| 87 #if defined(OS_LINUX) |
| 88 virtual device::MediaTransferProtocolManager* |
| 89 media_transfer_protocol_manager() = 0; |
| 90 #endif |
| 91 |
83 // Returns information for attached removable storage. | 92 // Returns information for attached removable storage. |
84 std::vector<StorageInfo> GetAttachedStorage() const; | 93 std::vector<StorageInfo> GetAttachedStorage() const; |
85 | 94 |
86 void AddObserver(RemovableStorageObserver* obs); | 95 void AddObserver(RemovableStorageObserver* obs); |
87 void RemoveObserver(RemovableStorageObserver* obs); | 96 void RemoveObserver(RemovableStorageObserver* obs); |
88 | 97 |
89 std::string GetTransientIdForDeviceId(const std::string& device_id); | 98 std::string GetTransientIdForDeviceId(const std::string& device_id); |
90 std::string GetDeviceIdForTransientId(const std::string& transient_id) const; | 99 std::string GetDeviceIdForTransientId(const std::string& transient_id) const; |
91 | 100 |
92 virtual void EjectDevice( | 101 virtual void EjectDevice( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 138 |
130 // Map of all the attached removable storage devices. | 139 // Map of all the attached removable storage devices. |
131 RemovableStorageMap storage_map_; | 140 RemovableStorageMap storage_map_; |
132 | 141 |
133 scoped_ptr<TransientDeviceIds> transient_device_ids_; | 142 scoped_ptr<TransientDeviceIds> transient_device_ids_; |
134 }; | 143 }; |
135 | 144 |
136 } // namespace chrome | 145 } // namespace chrome |
137 | 146 |
138 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ | 147 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ |
OLD | NEW |