Commit 879b7350 authored by Bailey Berro's avatar Bailey Berro Committed by Commit Bot

Implement MoveEntry on SmbProviderClient

This change implements MoveEntry on SmbProviderClient
and FakeSmbProviderClient.

BUG=chromium:757625
TEST=compiles

Change-Id: Icf38fa220dbb993a86f12e8c5464b93b18f06c3d
Reviewed-on: https://chromium-review.googlesource.com/923081Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Bailey Berro <baileyberro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537924}
parent 7ab5b919
...@@ -115,4 +115,12 @@ void FakeSmbProviderClient::CreateDirectory( ...@@ -115,4 +115,12 @@ void FakeSmbProviderClient::CreateDirectory(
FROM_HERE, base::BindOnce(std::move(callback), smbprovider::ERROR_OK)); FROM_HERE, base::BindOnce(std::move(callback), smbprovider::ERROR_OK));
} }
void FakeSmbProviderClient::MoveEntry(int32_t mount_id,
const base::FilePath& source_path,
const base::FilePath& target_path,
StatusCallback callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), smbprovider::ERROR_OK));
}
} // namespace chromeos } // namespace chromeos
...@@ -66,6 +66,11 @@ class CHROMEOS_EXPORT FakeSmbProviderClient : public SmbProviderClient { ...@@ -66,6 +66,11 @@ class CHROMEOS_EXPORT FakeSmbProviderClient : public SmbProviderClient {
bool recursive, bool recursive,
StatusCallback callback) override; StatusCallback callback) override;
void MoveEntry(int32_t mount_id,
const base::FilePath& source_path,
const base::FilePath& target_path,
StatusCallback callback) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(FakeSmbProviderClient); DISALLOW_COPY_AND_ASSIGN(FakeSmbProviderClient);
}; };
......
...@@ -186,6 +186,17 @@ class SmbProviderClientImpl : public SmbProviderClient { ...@@ -186,6 +186,17 @@ class SmbProviderClientImpl : public SmbProviderClient {
CallDefaultMethod(smbprovider::kCreateDirectoryMethod, options, &callback); CallDefaultMethod(smbprovider::kCreateDirectoryMethod, options, &callback);
} }
void MoveEntry(int32_t mount_id,
const base::FilePath& source_path,
const base::FilePath& target_path,
StatusCallback callback) override {
smbprovider::MoveEntryOptionsProto options;
options.set_mount_id(mount_id);
options.set_source_path(source_path.value());
options.set_target_path(target_path.value());
CallDefaultMethod(smbprovider::kMoveEntryMethod, options, &callback);
}
protected: protected:
// DBusClient override. // DBusClient override.
void Init(dbus::Bus* bus) override { void Init(dbus::Bus* bus) override {
......
...@@ -128,6 +128,14 @@ class CHROMEOS_EXPORT SmbProviderClient : public DBusClient { ...@@ -128,6 +128,14 @@ class CHROMEOS_EXPORT SmbProviderClient : public DBusClient {
bool recursive, bool recursive,
StatusCallback callback) = 0; StatusCallback callback) = 0;
// Calls MoveEntry. Using the corresponding |mount_id|, this moves the entry
// at |source_path| to |target_path|. This operation will fail if the
// target already exists.
virtual void MoveEntry(int32_t mount_id,
const base::FilePath& source_path,
const base::FilePath& target_path,
StatusCallback callback) = 0;
protected: protected:
// Create() should be used instead. // Create() should be used instead.
SmbProviderClient(); SmbProviderClient();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment