Allow to pass remount option to Mount method of cros_disks.
The remount option will be handled by cros_disks after this change:
https://chromium-review.googlesource.com/#/c/390410/

BUG=642247

Review-Url: https://chromiumcodereview.appspot.com/2392503002
Cr-Commit-Position: refs/heads/master@{#426792}
diff --git a/chromeos/dbus/cros_disks_client.cc b/chromeos/dbus/cros_disks_client.cc
index 298657f..47f961d3 100644
--- a/chromeos/dbus/cros_disks_client.cc
+++ b/chromeos/dbus/cros_disks_client.cc
@@ -37,6 +37,7 @@
 };
 const char kReadOnlyOption[] = "ro";
 const char kReadWriteOption[] = "rw";
+const char kRemountOption[] = "remount";
 const char kMountLabelOption[] = "mountlabel";
 
 const char* kDefaultUnmountOptions[] = {
@@ -104,6 +105,7 @@
              const std::string& source_format,
              const std::string& mount_label,
              MountAccessMode access_mode,
+             RemountOption remount,
              const base::Closure& callback,
              const base::Closure& error_callback) override {
     dbus::MethodCall method_call(cros_disks::kCrosDisksInterface,
@@ -112,7 +114,7 @@
     writer.AppendString(source_path);
     writer.AppendString(source_format);
     std::vector<std::string> mount_options =
-        ComposeMountOptions(mount_label, access_mode);
+        ComposeMountOptions(mount_label, access_mode, remount);
     writer.AppendArrayOfStrings(mount_options);
     proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
                        base::Bind(&CrosDisksClientImpl::OnMount,
@@ -655,7 +657,8 @@
 // static
 std::vector<std::string> CrosDisksClient::ComposeMountOptions(
     const std::string& mount_label,
-    MountAccessMode access_mode) {
+    MountAccessMode access_mode,
+    RemountOption remount) {
   std::vector<std::string> mount_options(
       kDefaultMountOptions,
       kDefaultMountOptions + arraysize(kDefaultMountOptions));
@@ -667,6 +670,9 @@
       mount_options.push_back(kReadWriteOption);
       break;
   }
+  if (remount == REMOUNT_OPTION_REMOUNT_EXISTING_DEVICE) {
+    mount_options.push_back(kRemountOption);
+  }
 
   if (!mount_label.empty()) {
     std::string mount_label_option =