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 CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // Type of device. | 34 // Type of device. |
| 35 enum DeviceType { | 35 enum DeviceType { |
| 36 DEVICE_TYPE_UNKNOWN, | 36 DEVICE_TYPE_UNKNOWN, |
| 37 DEVICE_TYPE_USB, // USB stick. | 37 DEVICE_TYPE_USB, // USB stick. |
| 38 DEVICE_TYPE_SD, // SD card. | 38 DEVICE_TYPE_SD, // SD card. |
| 39 DEVICE_TYPE_OPTICAL_DISC, // e.g. Optical disc excluding DVD. | 39 DEVICE_TYPE_OPTICAL_DISC, // e.g. Optical disc excluding DVD. |
| 40 DEVICE_TYPE_MOBILE, // Storage on a mobile device (e.g. Android). | 40 DEVICE_TYPE_MOBILE, // Storage on a mobile device (e.g. Android). |
| 41 DEVICE_TYPE_DVD, // DVD. | 41 DEVICE_TYPE_DVD, // DVD. |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Mount error code used by cros-disks. | 44 // Mount error code used by cros-disks. |
|
satorux1
2012/11/08 08:35:18
I think we should share these error codes with cro
tbarzic
2012/11/08 19:23:09
yep, I agree, I planed to do that in this cl (we a
| |
| 45 enum MountError { | 45 enum MountError { |
| 46 MOUNT_ERROR_NONE = 0, | 46 MOUNT_ERROR_NONE = 0, |
| 47 MOUNT_ERROR_UNKNOWN = 1, | 47 MOUNT_ERROR_UNKNOWN = 1, |
| 48 MOUNT_ERROR_INTERNAL = 2, | 48 MOUNT_ERROR_INTERNAL = 2, |
| 49 MOUNT_ERROR_INVALID_ARGUMENT = 3, | |
| 50 MOUNT_ERROR_INVALID_PATH = 4, | |
| 51 MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5, | |
| 52 MOUNT_ERROR_PATH_NOT_MOUNTED = 6, | |
| 53 MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7, | |
| 54 MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8, | |
| 55 MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9, | |
| 56 MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10, | |
| 57 MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11, | |
| 58 MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12, | |
| 59 MOUNT_ERROR_INVALID_DEVICE_PATH = 100, | |
| 49 MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101, | 60 MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101, |
| 50 MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102, | 61 MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102, |
| 51 MOUNT_ERROR_INVALID_ARCHIVE = 201, | 62 MOUNT_ERROR_INVALID_ARCHIVE = 201, |
| 52 MOUNT_ERROR_NOT_AUTHENTICATED = 601, | 63 MOUNT_ERROR_NOT_AUTHENTICATED = 601, |
| 53 MOUNT_ERROR_PATH_UNMOUNTED = 901, | 64 MOUNT_ERROR_PATH_UNMOUNTED = 901, |
| 54 // TODO(tbarzic): Add more error codes as they get added to cros-disks and | 65 // TODO(tbarzic): Add more error codes as they get added to cros-disks and |
| 55 // consider doing explicit translation from cros-disks error_types. | 66 // consider doing explicit translation from cros-disks error_types. |
| 56 }; | 67 }; |
| 57 | 68 |
| 69 // Format error reported by cros-disks. | |
| 70 enum FormatError { | |
| 71 FORMAT_ERROR_NONE, | |
| 72 FORMAT_ERROR_UNKNOWN, | |
| 73 FORMAT_ERROR_INTERNAL, | |
| 74 FORMAT_ERROR_INVALID_DEVICE_PATH, | |
| 75 FORMAT_ERROR_DEVICE_BEING_FORMATTED, | |
| 76 FORMAT_ERROR_UNSUPPORTED_FILESYSTEM, | |
| 77 FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND, | |
| 78 FORMAT_ERROR_FORMAT_PROGRAM_FAILED, | |
| 79 FORMAT_ERROR_DEVICE_NOT_ALLOWED, | |
| 80 }; | |
| 81 | |
| 58 // Event type each corresponding to a signal sent from cros-disks. | 82 // Event type each corresponding to a signal sent from cros-disks. |
| 59 enum MountEventType { | 83 enum MountEventType { |
| 60 DISK_ADDED, | 84 CROS_DISKS_DISK_ADDED, |
| 61 DISK_REMOVED, | 85 CROS_DISKS_DISK_REMOVED, |
| 62 DISK_CHANGED, | 86 CROS_DISKS_DISK_CHANGED, |
| 63 DEVICE_ADDED, | 87 CROS_DISKS_DEVICE_ADDED, |
| 64 DEVICE_REMOVED, | 88 CROS_DISKS_DEVICE_REMOVED, |
| 65 DEVICE_SCANNED, | 89 CROS_DISKS_DEVICE_SCANNED, |
| 66 FORMATTING_FINISHED, | 90 CROS_DISKS_FORMATTING_FINISHED, |
| 67 }; | 91 }; |
| 68 | 92 |
| 69 // Additional unmount flags to be added to unmount request. | 93 // Additional unmount flags to be added to unmount request. |
| 70 enum UnmountOptions { | 94 enum UnmountOptions { |
| 71 UNMOUNT_OPTIONS_NONE, | 95 UNMOUNT_OPTIONS_NONE, |
| 72 UNMOUNT_OPTIONS_LAZY, // Do lazy unmount. | 96 UNMOUNT_OPTIONS_LAZY, // Do lazy unmount. |
| 73 }; | 97 }; |
| 74 | 98 |
| 75 // A class to represent information about a disk sent from cros-disks. | 99 // A class to represent information about a disk sent from cros-disks. |
| 76 class DiskInfo { | 100 class DiskInfo { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 // Create() should be used instead. | 290 // Create() should be used instead. |
| 267 CrosDisksClient(); | 291 CrosDisksClient(); |
| 268 | 292 |
| 269 private: | 293 private: |
| 270 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); | 294 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); |
| 271 }; | 295 }; |
| 272 | 296 |
| 273 } // namespace chromeos | 297 } // namespace chromeos |
| 274 | 298 |
| 275 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 299 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
| OLD | NEW |