| Index: chrome/browser/chromeos/file_system_provider/operations/move_entry.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc b/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc
|
| index a41cc2cf2df1ae1b20016bccce00a6510b0d1de6..8b89a2668542fb453c340883252769f4ef6a1581 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc
|
| @@ -12,52 +12,59 @@
|
| namespace chromeos {
|
| namespace file_system_provider {
|
| namespace operations {
|
| -
|
| -MoveEntry::MoveEntry(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>
|
| +MoveEntry<DestinationPolicy>::MoveEntry(
|
| + 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) {
|
| }
|
|
|
| -MoveEntry::~MoveEntry() {
|
| +template <class DestinationPolicy>
|
| +MoveEntry<DestinationPolicy>::~MoveEntry() {
|
| }
|
|
|
| -bool MoveEntry::Execute(int request_id) {
|
| +template <class DestinationPolicy>
|
| +bool MoveEntry<DestinationPolicy>::Execute(int request_id) {
|
| using extensions::api::file_system_provider::MoveEntryRequestedOptions;
|
|
|
| - if (!file_system_info_.writable())
|
| + if (!this->file_system_info_.writable())
|
| return false;
|
|
|
| MoveEntryRequestedOptions 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::OnMoveEntryRequested::kEventName,
|
| extensions::api::file_system_provider::OnMoveEntryRequested::Create(
|
| options));
|
| }
|
|
|
| -void MoveEntry::OnSuccess(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - bool has_more) {
|
| +template <class DestinationPolicy>
|
| +void MoveEntry<DestinationPolicy>::OnSuccess(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + bool has_more) {
|
| callback_.Run(base::File::FILE_OK);
|
| }
|
|
|
| -void MoveEntry::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <class DestinationPolicy>
|
| +void MoveEntry<DestinationPolicy>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(error);
|
| }
|
|
|
| +FOR_EACH_DESTINATION_SPECIALIZE(MoveEntry)
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|