OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_CROS_MOUNT_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOUNT_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_MOUNT_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_MOUNT_LIBRARY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 virtual const DiskMap& disks() const = 0; | 176 virtual const DiskMap& disks() const = 0; |
177 virtual const MountPointMap& mount_points() const = 0; | 177 virtual const MountPointMap& mount_points() const = 0; |
178 | 178 |
179 virtual void RequestMountInfoRefresh() = 0; | 179 virtual void RequestMountInfoRefresh() = 0; |
180 virtual void MountPath(const char* source_path, | 180 virtual void MountPath(const char* source_path, |
181 MountType type, | 181 MountType type, |
182 const MountPathOptions& options) = 0; | 182 const MountPathOptions& options) = 0; |
183 // |path| is device's mount path. | 183 // |path| is device's mount path. |
184 virtual void UnmountPath(const char* path) = 0; | 184 virtual void UnmountPath(const char* path) = 0; |
185 | 185 |
| 186 // Retrieves total and remaining available size on |mount_path|. |
| 187 virtual void GetSizeStatsOnFileThread(const char* mount_path, |
| 188 size_t* total_size_kb, size_t* remaining_size_kb) = 0; |
| 189 |
186 // Formats device given its file path. | 190 // Formats device given its file path. |
187 // Example: file_path: /dev/sdb1 | 191 // Example: file_path: /dev/sdb1 |
188 virtual void FormatUnmountedDevice(const char* file_path) = 0; | 192 virtual void FormatUnmountedDevice(const char* file_path) = 0; |
189 | 193 |
190 // Formats Device given its mount path. Unmount's the device | 194 // Formats Device given its mount path. Unmount's the device |
191 // Example: mount_path: /media/VOLUME_LABEL | 195 // Example: mount_path: /media/VOLUME_LABEL |
192 virtual void FormatMountedDevice(const char* mount_path) = 0; | 196 virtual void FormatMountedDevice(const char* mount_path) = 0; |
193 | 197 |
194 // Unmounts device_poath and all of its known children. | 198 // Unmounts device_poath and all of its known children. |
195 virtual void UnmountDeviceRecursive(const char* device_path, | 199 virtual void UnmountDeviceRecursive(const char* device_path, |
196 UnmountDeviceRecursiveCallbackType callback, void* user_data) = 0; | 200 UnmountDeviceRecursiveCallbackType callback, void* user_data) = 0; |
197 | 201 |
198 // Helper functions for parameter conversions. | 202 // Helper functions for parameter conversions. |
199 static std::string MountTypeToString(MountType type); | 203 static std::string MountTypeToString(MountType type); |
200 static MountType MountTypeFromString(const std::string& type_str); | 204 static MountType MountTypeFromString(const std::string& type_str); |
201 static std::string MountConditionToString(MountCondition type); | 205 static std::string MountConditionToString(MountCondition type); |
202 | 206 |
203 // Used in testing. Enables mocking libcros. | 207 // Used in testing. Enables mocking libcros. |
204 virtual void SetLibcrosProxy(MountLibcrosProxy* proxy) {} | 208 virtual void SetLibcrosProxy(MountLibcrosProxy* proxy) {} |
205 | 209 |
206 // Factory function, creates a new instance and returns ownership. | 210 // Factory function, creates a new instance and returns ownership. |
207 // For normal usage, access the singleton via CrosLibrary::Get(). | 211 // For normal usage, access the singleton via CrosLibrary::Get(). |
208 static MountLibrary* GetImpl(bool stub); | 212 static MountLibrary* GetImpl(bool stub); |
209 }; | 213 }; |
210 | 214 |
211 } // namespace chromeos | 215 } // namespace chromeos |
212 | 216 |
213 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOUNT_LIBRARY_H_ | 217 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOUNT_LIBRARY_H_ |
OLD | NEW |