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