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_DISKS_DISK_MOUNT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 // Returns corresponding string to |type| like "device" or "file". | 227 // Returns corresponding string to |type| like "device" or "file". |
228 static std::string MountTypeToString(MountType type); | 228 static std::string MountTypeToString(MountType type); |
229 | 229 |
230 // The inverse function of MountTypeToString. | 230 // The inverse function of MountTypeToString. |
231 static MountType MountTypeFromString(const std::string& type_str); | 231 static MountType MountTypeFromString(const std::string& type_str); |
232 | 232 |
233 // Returns corresponding string to |type| like "unknown_filesystem". | 233 // Returns corresponding string to |type| like "unknown_filesystem". |
234 static std::string MountConditionToString(MountCondition type); | 234 static std::string MountConditionToString(MountCondition type); |
235 | 235 |
| 236 // Returns corresponding string to |type|, like "sd", "usb". |
| 237 static std::string DeviceTypeToString(DeviceType type); |
| 238 |
236 // Creates the global DiskMountManager instance. | 239 // Creates the global DiskMountManager instance. |
237 static void Initialize(); | 240 static void Initialize(); |
238 | 241 |
239 // Similar to Initialize(), but can inject an alternative | 242 // Similar to Initialize(), but can inject an alternative |
240 // DiskMountManager such as MockDiskMountManager for testing. | 243 // DiskMountManager such as MockDiskMountManager for testing. |
241 // The injected object will be owned by the internal pointer and deleted | 244 // The injected object will be owned by the internal pointer and deleted |
242 // by Shutdown(). | 245 // by Shutdown(). |
243 static void InitializeForTesting(DiskMountManager* disk_mount_manager); | 246 static void InitializeForTesting(DiskMountManager* disk_mount_manager); |
244 | 247 |
245 // Destroys the global DiskMountManager instance if it exists. | 248 // Destroys the global DiskMountManager instance if it exists. |
246 static void Shutdown(); | 249 static void Shutdown(); |
247 | 250 |
248 // Returns a pointer to the global DiskMountManager instance. | 251 // Returns a pointer to the global DiskMountManager instance. |
249 // Initialize() should already have been called. | 252 // Initialize() should already have been called. |
250 static DiskMountManager* GetInstance(); | 253 static DiskMountManager* GetInstance(); |
251 }; | 254 }; |
252 | 255 |
253 } // namespace disks | 256 } // namespace disks |
254 } // namespace chromeos | 257 } // namespace chromeos |
255 | 258 |
256 #endif // CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ | 259 #endif // CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ |
OLD | NEW |