| 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_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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "chromeos/dbus/cros_disks_client.h" | 10 #include "chromeos/dbus/cros_disks_client.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Used to house an instance of each found mount device. | 46 // Used to house an instance of each found mount device. |
| 47 class Disk { | 47 class Disk { |
| 48 public: | 48 public: |
| 49 Disk(const std::string& device_path, | 49 Disk(const std::string& device_path, |
| 50 const std::string& mount_path, | 50 const std::string& mount_path, |
| 51 const std::string& system_path, | 51 const std::string& system_path, |
| 52 const std::string& file_path, | 52 const std::string& file_path, |
| 53 const std::string& device_label, | 53 const std::string& device_label, |
| 54 const std::string& drive_label, | 54 const std::string& drive_label, |
| 55 const std::string& fs_uuid, |
| 55 const std::string& system_path_prefix, | 56 const std::string& system_path_prefix, |
| 56 DeviceType device_type, | 57 DeviceType device_type, |
| 57 uint64 total_size_in_bytes, | 58 uint64 total_size_in_bytes, |
| 58 bool is_parent, | 59 bool is_parent, |
| 59 bool is_read_only, | 60 bool is_read_only, |
| 60 bool has_media, | 61 bool has_media, |
| 61 bool on_boot_device, | 62 bool on_boot_device, |
| 62 bool is_hidden); | 63 bool is_hidden); |
| 63 ~Disk(); | 64 ~Disk(); |
| 64 | 65 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 78 // (e.g. /dev/sdb) | 79 // (e.g. /dev/sdb) |
| 79 const std::string& file_path() const { return file_path_; } | 80 const std::string& file_path() const { return file_path_; } |
| 80 | 81 |
| 81 // Device's label. | 82 // Device's label. |
| 82 const std::string& device_label() const { return device_label_; } | 83 const std::string& device_label() const { return device_label_; } |
| 83 | 84 |
| 84 // If disk is a parent, then its label, else parents label. | 85 // If disk is a parent, then its label, else parents label. |
| 85 // (e.g. "TransMemory") | 86 // (e.g. "TransMemory") |
| 86 const std::string& drive_label() const { return drive_label_; } | 87 const std::string& drive_label() const { return drive_label_; } |
| 87 | 88 |
| 89 // Returns the file system uuid string. |
| 90 const std::string& fs_uuid() const { return fs_uuid_; } |
| 91 |
| 88 // Path of the system device this device's block is a part of. | 92 // Path of the system device this device's block is a part of. |
| 89 // (e.g. /sys/devices/pci0000:00/.../8:0:0:0/) | 93 // (e.g. /sys/devices/pci0000:00/.../8:0:0:0/) |
| 90 const std::string& system_path_prefix() const { | 94 const std::string& system_path_prefix() const { |
| 91 return system_path_prefix_; | 95 return system_path_prefix_; |
| 92 } | 96 } |
| 93 | 97 |
| 94 // Device type. | 98 // Device type. |
| 95 DeviceType device_type() const { return device_type_; } | 99 DeviceType device_type() const { return device_type_; } |
| 96 | 100 |
| 97 // Total size of the device in bytes. | 101 // Total size of the device in bytes. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 118 | 122 |
| 119 void clear_mount_path() { mount_path_.clear(); } | 123 void clear_mount_path() { mount_path_.clear(); } |
| 120 | 124 |
| 121 private: | 125 private: |
| 122 std::string device_path_; | 126 std::string device_path_; |
| 123 std::string mount_path_; | 127 std::string mount_path_; |
| 124 std::string system_path_; | 128 std::string system_path_; |
| 125 std::string file_path_; | 129 std::string file_path_; |
| 126 std::string device_label_; | 130 std::string device_label_; |
| 127 std::string drive_label_; | 131 std::string drive_label_; |
| 132 std::string fs_uuid_; |
| 128 std::string system_path_prefix_; | 133 std::string system_path_prefix_; |
| 129 DeviceType device_type_; | 134 DeviceType device_type_; |
| 130 uint64 total_size_in_bytes_; | 135 uint64 total_size_in_bytes_; |
| 131 bool is_parent_; | 136 bool is_parent_; |
| 132 bool is_read_only_; | 137 bool is_read_only_; |
| 133 bool has_media_; | 138 bool has_media_; |
| 134 bool on_boot_device_; | 139 bool on_boot_device_; |
| 135 bool is_hidden_; | 140 bool is_hidden_; |
| 136 }; | 141 }; |
| 137 typedef std::map<std::string, Disk*> DiskMap; | 142 typedef std::map<std::string, Disk*> DiskMap; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 257 |
| 253 // Returns a pointer to the global DiskMountManager instance. | 258 // Returns a pointer to the global DiskMountManager instance. |
| 254 // Initialize() should already have been called. | 259 // Initialize() should already have been called. |
| 255 static DiskMountManager* GetInstance(); | 260 static DiskMountManager* GetInstance(); |
| 256 }; | 261 }; |
| 257 | 262 |
| 258 } // namespace disks | 263 } // namespace disks |
| 259 } // namespace chromeos | 264 } // namespace chromeos |
| 260 | 265 |
| 261 #endif // CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ | 266 #endif // CHROME_BROWSER_CHROMEOS_DISKS_DISK_MOUNT_MANAGER_H_ |
| OLD | NEW |