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

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

Issue 2451713002: Propagate the read_only_hardware flag of volumes to js. (Closed)
Patch Set: Apply default value for others than removable disk volume. 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.cc
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc
index e2274225166fd9456d81a893f96ae44046620158..bcd5306690b3febf1e11d13aa0ee027b49172263 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -151,10 +151,10 @@ Volume::Volume()
mount_context_(MOUNT_CONTEXT_UNKNOWN),
is_parent_(false),
is_read_only_(false),
+ is_read_only_hardware_(false),
has_media_(false),
configurable_(false),
- watchable_(false) {
-}
+ watchable_(false) {}
fukino 2016/10/26 07:23:31 nit: looks unnecessary change (the style is not co
yamaguchi 2016/10/26 11:14:20 Done.
Volume::~Volume() {
}
@@ -207,10 +207,11 @@ Volume* Volume::CreateForRemovable(
volume->system_path_prefix_ = base::FilePath(disk->system_path_prefix());
volume->is_parent_ = disk->is_parent();
volume->is_read_only_ = disk->is_read_only();
+ volume->is_read_only_hardware_ = disk->is_read_only_hardware();
volume->has_media_ = disk->has_media();
} else {
volume->device_type_ = chromeos::DEVICE_TYPE_UNKNOWN;
- volume->is_read_only_ =
+ volume->is_read_only_ = volume->is_read_only_hardware_ =
(mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE);
}
volume->volume_id_ = GenerateVolumeId(*volume);
@@ -244,6 +245,7 @@ Volume* Volume::CreateForProvidedFileSystem(
volume->mount_context_ = mount_context;
volume->is_parent_ = true;
volume->is_read_only_ = !file_system_info.writable();
+ volume->is_read_only_hardware_ = volume->is_read_only_;
volume->configurable_ = file_system_info.configurable();
volume->watchable_ = file_system_info.watchable();
volume->volume_id_ = GenerateVolumeId(*volume);

Powered by Google App Engine
This is Rietveld 408576698