| 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..c8882e2b685721503d35ca9b19e622d35746ffd0 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,58 @@ 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 <class DestinationPolicy>
|
| +CopyEntry<DestinationPolicy>::CopyEntry(
|
| + typename DestinationPolicy::EventRouterType* event_router,
|
| + const ProvidedFileSystemInfo& file_system_info,
|
| + const base::FilePath& source_path,
|
| + const base::FilePath& target_path,
|
| + const storage::AsyncFileUtil::StatusCallback& callback)
|
| + : Operation<DestinationPolicy>(event_router, file_system_info),
|
| source_path_(source_path),
|
| target_path_(target_path),
|
| callback_(callback) {
|
| }
|
|
|
| -CopyEntry::~CopyEntry() {
|
| +template <class DestinationPolicy>
|
| +CopyEntry<DestinationPolicy>::~CopyEntry() {
|
| }
|
|
|
| -bool CopyEntry::Execute(int request_id) {
|
| +template <class DestinationPolicy>
|
| +bool CopyEntry<DestinationPolicy>::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 <class DestinationPolicy>
|
| +void CopyEntry<DestinationPolicy>::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 <class DestinationPolicy>
|
| +void CopyEntry<DestinationPolicy>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(error);
|
| }
|
|
|
| +FOR_EACH_DESTINATION_SPECIALIZE(CopyEntry)
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|