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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc

Issue 384303002: [fsp] Add support for copying files within a provided file system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 5 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_system_provider/operations/copy_entry.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/close_file.cc b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc
similarity index 63%
copy from chrome/browser/chromeos/file_system_provider/operations/close_file.cc
copy to chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc
index ad977368a03d6a85dda7c73ae502b9e6e50669f3..56fd67d0a43c1c00d0a3687d18657ecc88413400 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/close_file.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/file_system_provider/operations/close_file.h"
+#include "chrome/browser/chromeos/file_system_provider/operations/copy_entry.h"
#include <string>
@@ -13,35 +13,38 @@ namespace chromeos {
namespace file_system_provider {
namespace operations {
-CloseFile::CloseFile(extensions::EventRouter* event_router,
+CopyEntry::CopyEntry(extensions::EventRouter* event_router,
const ProvidedFileSystemInfo& file_system_info,
- int open_request_id,
+ const base::FilePath& source_path,
+ const base::FilePath& target_path,
const fileapi::AsyncFileUtil::StatusCallback& callback)
: Operation(event_router, file_system_info),
- open_request_id_(open_request_id),
+ source_path_(source_path),
+ target_path_(target_path),
callback_(callback) {
}
-CloseFile::~CloseFile() {
+CopyEntry::~CopyEntry() {
}
-bool CloseFile::Execute(int request_id) {
+bool CopyEntry::Execute(int request_id) {
scoped_ptr<base::DictionaryValue> values(new base::DictionaryValue);
- values->SetInteger("openRequestId", open_request_id_);
+ values->SetString("sourcePath", source_path_.AsUTF8Unsafe());
+ values->SetString("targetPath", target_path_.AsUTF8Unsafe());
return SendEvent(
request_id,
- extensions::api::file_system_provider::OnCloseFileRequested::kEventName,
+ extensions::api::file_system_provider::OnCopyEntryRequested::kEventName,
values.Pass());
}
-void CloseFile::OnSuccess(int /* request_id */,
- scoped_ptr<RequestValue> result,
+void CopyEntry::OnSuccess(int /* request_id */,
+ scoped_ptr<RequestValue> /* result */,
bool has_more) {
callback_.Run(base::File::FILE_OK);
}
-void CloseFile::OnError(int /* request_id */,
+void CopyEntry::OnError(int /* request_id */,
scoped_ptr<RequestValue> /* result */,
base::File::Error error) {
callback_.Run(error);

Powered by Google App Engine
This is Rietveld 408576698