Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FILE_MANAGER_VOLUME_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 const base::FilePath& mount_path() const { return mount_path_; } | 109 const base::FilePath& mount_path() const { return mount_path_; } |
| 110 chromeos::disks::MountCondition mount_condition() const { | 110 chromeos::disks::MountCondition mount_condition() const { |
| 111 return mount_condition_; | 111 return mount_condition_; |
| 112 } | 112 } |
| 113 MountContext mount_context() const { return mount_context_; } | 113 MountContext mount_context() const { return mount_context_; } |
| 114 const base::FilePath& system_path_prefix() const { | 114 const base::FilePath& system_path_prefix() const { |
| 115 return system_path_prefix_; | 115 return system_path_prefix_; |
| 116 } | 116 } |
| 117 const std::string& volume_label() const { return volume_label_; } | 117 const std::string& volume_label() const { return volume_label_; } |
| 118 bool is_parent() const { return is_parent_; } | 118 bool is_parent() const { return is_parent_; } |
| 119 // Whether the device is writable by applications. | |
| 119 bool is_read_only() const { return is_read_only_; } | 120 bool is_read_only() const { return is_read_only_; } |
| 121 // Whether the device is write-protected by hardware. This field is valid | |
| 122 // only when device_type is VOLUME_TYPE_REMOVABLE_DISK_PARTITION and | |
| 123 // source is SOURCE_DEVICE. | |
| 124 // When this value is true, is_read_only() is also true. | |
|
fukino
2016/10/26 07:23:31
Could you mention an example in which is_read_only
yamaguchi
2016/10/26 11:14:20
Done.
Described for what this change is, in the CL
| |
| 125 bool is_read_only_hardware() const { return is_read_only_hardware_; } | |
| 120 bool has_media() const { return has_media_; } | 126 bool has_media() const { return has_media_; } |
| 121 bool configurable() const { return configurable_; } | 127 bool configurable() const { return configurable_; } |
| 122 bool watchable() const { return watchable_; } | 128 bool watchable() const { return watchable_; } |
| 123 | 129 |
| 124 private: | 130 private: |
| 125 Volume(); | 131 Volume(); |
| 126 | 132 |
| 127 // The ID of the volume. | 133 // The ID of the volume. |
| 128 std::string volume_id_; | 134 std::string volume_id_; |
| 129 | 135 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 base::FilePath system_path_prefix_; | 174 base::FilePath system_path_prefix_; |
| 169 | 175 |
| 170 // Label for the volume if the volume is either removable or a provided | 176 // Label for the volume if the volume is either removable or a provided |
| 171 // file system. In case of removables, if disk is a parent, then its label, | 177 // file system. In case of removables, if disk is a parent, then its label, |
| 172 // else parents label (e.g. "TransMemory"). | 178 // else parents label (e.g. "TransMemory"). |
| 173 std::string volume_label_; | 179 std::string volume_label_; |
| 174 | 180 |
| 175 // Is the device is a parent device (i.e. sdb rather than sdb1). | 181 // Is the device is a parent device (i.e. sdb rather than sdb1). |
| 176 bool is_parent_; | 182 bool is_parent_; |
| 177 | 183 |
| 178 // True if the volume is read only. | 184 // True if the volume is not writable by applications. |
| 179 bool is_read_only_; | 185 bool is_read_only_; |
| 180 | 186 |
| 187 // True if the volume is made read_only due to its hardware. | |
| 188 // This implies is_read_only_. | |
| 189 bool is_read_only_hardware_; | |
| 190 | |
| 181 // True if the volume contains media. | 191 // True if the volume contains media. |
| 182 bool has_media_; | 192 bool has_media_; |
| 183 | 193 |
| 184 // True if the volume is configurable. | 194 // True if the volume is configurable. |
| 185 bool configurable_; | 195 bool configurable_; |
| 186 | 196 |
| 187 // True if the volume notifies about changes via file/directory watchers. | 197 // True if the volume notifies about changes via file/directory watchers. |
| 188 bool watchable_; | 198 bool watchable_; |
| 189 | 199 |
| 190 DISALLOW_COPY_AND_ASSIGN(Volume); | 200 DISALLOW_COPY_AND_ASSIGN(Volume); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 | 327 |
| 318 // Note: This should remain the last member so it'll be destroyed and | 328 // Note: This should remain the last member so it'll be destroyed and |
| 319 // invalidate its weak pointers before any other members are destroyed. | 329 // invalidate its weak pointers before any other members are destroyed. |
| 320 base::WeakPtrFactory<VolumeManager> weak_ptr_factory_; | 330 base::WeakPtrFactory<VolumeManager> weak_ptr_factory_; |
| 321 DISALLOW_COPY_AND_ASSIGN(VolumeManager); | 331 DISALLOW_COPY_AND_ASSIGN(VolumeManager); |
| 322 }; | 332 }; |
| 323 | 333 |
| 324 } // namespace file_manager | 334 } // namespace file_manager |
| 325 | 335 |
| 326 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 336 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| OLD | NEW |