Index: chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
index c2a4953cbd46bdbd75f2fcc1fdaba9c1f6e5a8e5..71b6940a5c64de02da262d4c719a149013b240c3 100644 |
--- a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
+++ b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
@@ -13,48 +13,56 @@ namespace chromeos { |
namespace file_system_provider { |
namespace operations { |
-CreateFile::CreateFile(extensions::EventRouter* event_router, |
- const ProvidedFileSystemInfo& file_system_info, |
- const base::FilePath& file_path, |
- const storage::AsyncFileUtil::StatusCallback& callback) |
- : Operation(event_router, file_system_info), |
+template <class DestinationPolicy> |
+CreateFile<DestinationPolicy>::CreateFile( |
+ typename DestinationPolicy::EventRouterType* event_router, |
+ const ProvidedFileSystemInfo& file_system_info, |
+ const base::FilePath& file_path, |
+ const storage::AsyncFileUtil::StatusCallback& callback) |
+ : Operation<DestinationPolicy>(event_router, file_system_info), |
file_path_(file_path), |
callback_(callback) { |
} |
-CreateFile::~CreateFile() { |
+template <class DestinationPolicy> |
+CreateFile<DestinationPolicy>::~CreateFile() { |
} |
-bool CreateFile::Execute(int request_id) { |
+template <class DestinationPolicy> |
+bool CreateFile<DestinationPolicy>::Execute(int request_id) { |
using extensions::api::file_system_provider::CreateFileRequestedOptions; |
- if (!file_system_info_.writable()) |
+ if (!this->file_system_info_.writable()) |
return false; |
CreateFileRequestedOptions 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.file_path = file_path_.AsUTF8Unsafe(); |
- return SendEvent( |
+ return this->SendEvent( |
request_id, |
extensions::api::file_system_provider::OnCreateFileRequested::kEventName, |
extensions::api::file_system_provider::OnCreateFileRequested::Create( |
options)); |
} |
-void CreateFile::OnSuccess(int /* request_id */, |
- scoped_ptr<RequestValue> /* result */, |
- bool has_more) { |
+template <class DestinationPolicy> |
+void CreateFile<DestinationPolicy>::OnSuccess(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ bool has_more) { |
callback_.Run(base::File::FILE_OK); |
} |
-void CreateFile::OnError(int /* request_id */, |
- scoped_ptr<RequestValue> /* result */, |
- base::File::Error error) { |
+template <class DestinationPolicy> |
+void CreateFile<DestinationPolicy>::OnError(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ base::File::Error error) { |
callback_.Run(error); |
} |
+FOR_EACH_DESTINATION_SPECIALIZE(CreateFile) |
+ |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |