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

Unified Diff: chromeos/dbus/cros_disks_client.cc

Issue 10231010: gdata: Apply correct mount label when mounting archives in GData (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « chromeos/dbus/cros_disks_client.h ('k') | chromeos/dbus/mock_cros_disks_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/cros_disks_client.cc
diff --git a/chromeos/dbus/cros_disks_client.cc b/chromeos/dbus/cros_disks_client.cc
index b9c420fd8dba03d030e4b0155c6fd87490a198d3..693372ddb18e34f4ef43e3a1061903d25b5dcbd3 100644
--- a/chromeos/dbus/cros_disks_client.cc
+++ b/chromeos/dbus/cros_disks_client.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/stl_util.h"
+#include "base/stringprintf.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
@@ -27,6 +28,8 @@ const char* kDefaultUnmountOptions[] = {
"force",
};
+const char kMountLabelOption[] = "mountlabel";
+
// Checks if retrieved media type is in boundaries of DeviceMediaType.
bool IsValidMediaType(uint32 type) {
return type < static_cast<uint32>(cros_disks::DEVICE_MEDIA_NUM_VALUES);
@@ -114,6 +117,7 @@ class CrosDisksClientImpl : public CrosDisksClient {
// CrosDisksClient override.
virtual void Mount(const std::string& source_path,
const std::string& source_format,
+ const std::string& mount_label,
MountType type,
const MountCallback& callback,
const ErrorCallback& error_callback) OVERRIDE {
@@ -125,6 +129,12 @@ class CrosDisksClientImpl : public CrosDisksClient {
std::vector<std::string> mount_options(kDefaultMountOptions,
kDefaultMountOptions +
arraysize(kDefaultMountOptions));
+ if (!mount_label.empty()) {
+ std::string mount_label_option = base::StringPrintf("%s=%s",
+ kMountLabelOption,
+ mount_label.c_str());
+ mount_options.push_back(mount_label_option);
+ }
writer.AppendArrayOfStrings(mount_options);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&CrosDisksClientImpl::OnMount,
@@ -377,6 +387,7 @@ class CrosDisksClientStubImpl : public CrosDisksClient {
virtual void Mount(const std::string& source_path,
const std::string& source_format,
+ const std::string& mount_label,
MountType type,
const MountCallback& callback,
const ErrorCallback& error_callback) OVERRIDE {}
« no previous file with comments | « chromeos/dbus/cros_disks_client.h ('k') | chromeos/dbus/mock_cros_disks_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698