Index: chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc |
diff --git a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc |
index 87c227a638be2cc7a9af3e24e5736b132527a436..eacbf78ed4ad1ee7419bb8875f34b33a28e55ce5 100644 |
--- a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc |
+++ b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc |
@@ -13,51 +13,60 @@ namespace chromeos { |
namespace file_system_provider { |
namespace operations { |
-CopyEntry::CopyEntry(extensions::EventRouter* event_router, |
- const ProvidedFileSystemInfo& file_system_info, |
- const base::FilePath& source_path, |
- const base::FilePath& target_path, |
- const storage::AsyncFileUtil::StatusCallback& callback) |
- : Operation(event_router, file_system_info), |
+template <int source> |
+CopyEntry<source>::CopyEntry( |
+ typename Operation<source>::EventRouterType* event_router, |
+ const ProvidedFileSystemInfo& file_system_info, |
+ const base::FilePath& source_path, |
+ const base::FilePath& target_path, |
+ const storage::AsyncFileUtil::StatusCallback& callback) |
+ : Operation<source>(event_router, file_system_info), |
source_path_(source_path), |
target_path_(target_path), |
callback_(callback) { |
} |
-CopyEntry::~CopyEntry() { |
+template <int source> |
+CopyEntry<source>::~CopyEntry() { |
} |
-bool CopyEntry::Execute(int request_id) { |
+template <int source> |
+bool CopyEntry<source>::Execute(int request_id) { |
using extensions::api::file_system_provider::CopyEntryRequestedOptions; |
- if (!file_system_info_.writable()) |
+ if (!this->file_system_info_.writable()) |
return false; |
CopyEntryRequestedOptions options; |
- options.file_system_id = file_system_info_.file_system_id(); |
+ options.file_system_id = this->file_system_info_.file_system_id(); |
options.request_id = request_id; |
options.source_path = source_path_.AsUTF8Unsafe(); |
options.target_path = target_path_.AsUTF8Unsafe(); |
- return SendEvent( |
+ return this->SendEvent( |
request_id, |
extensions::api::file_system_provider::OnCopyEntryRequested::kEventName, |
extensions::api::file_system_provider::OnCopyEntryRequested::Create( |
options)); |
} |
-void CopyEntry::OnSuccess(int /* request_id */, |
- scoped_ptr<RequestValue> /* result */, |
- bool has_more) { |
+template <int source> |
+void CopyEntry<source>::OnSuccess(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ bool has_more) { |
callback_.Run(base::File::FILE_OK); |
} |
-void CopyEntry::OnError(int /* request_id */, |
- scoped_ptr<RequestValue> /* result */, |
- base::File::Error error) { |
+template <int source> |
+void CopyEntry<source>::OnError(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ base::File::Error error) { |
callback_.Run(error); |
} |
+template class CopyEntry<Source_Type::extension>; |
+template class CopyEntry<Source_Type::plugin>; |
+ |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |