Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4440)

Unified Diff: chrome/browser/chromeos/file_manager/volume_manager.h

Issue 2451713002: Propagate the read_only_hardware flag of volumes to js. (Closed)
Patch Set: Fix comment. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_manager/volume_manager.h
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.h b/chrome/browser/chromeos/file_manager/volume_manager.h
index cc4ae549c50a89f43747aa34f45edff7cc55dc43..a4615cda3648329a8f71f2313a370074c126b2ba 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.h
+++ b/chrome/browser/chromeos/file_manager/volume_manager.h
@@ -116,7 +116,16 @@ class Volume : public base::SupportsWeakPtr<Volume> {
}
const std::string& volume_label() const { return volume_label_; }
bool is_parent() const { return is_parent_; }
+ // Whether the applications can write to the volume. True if not writable.
+ // For example, when write access to external storage is restricted by the
+ // policy (ExternalStorageReadOnly), is_read_only() will be true even when
+ // is_read_only_hardware() is false.
bool is_read_only() const { return is_read_only_; }
+ // Whether the device is write-protected by hardware. This field is valid
+ // only when device_type is VOLUME_TYPE_REMOVABLE_DISK_PARTITION and
+ // source is SOURCE_DEVICE.
+ // When this value is true, is_read_only() is also true.
+ bool is_read_only_hardware() const { return is_read_only_hardware_; }
fukino 2016/10/27 05:27:34 optional nit: is_read_only_device might be more co
yamaguchi 2016/10/27 07:32:54 In Disk class, "hardware" was adopted for the fiel
bool has_media() const { return has_media_; }
bool configurable() const { return configurable_; }
bool watchable() const { return watchable_; }
@@ -175,9 +184,13 @@ class Volume : public base::SupportsWeakPtr<Volume> {
// Is the device is a parent device (i.e. sdb rather than sdb1).
bool is_parent_;
- // True if the volume is read only.
+ // True if the volume is not writable by applications.
bool is_read_only_;
+ // True if the volume is made read_only due to its hardware.
+ // This implies is_read_only_.
+ bool is_read_only_hardware_;
+
// True if the volume contains media.
bool has_media_;

Powered by Google App Engine
This is Rietveld 408576698