| Index: chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc b/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc
|
| index e42d74accacbae9d963c0c64106fa69b2448e9cb..6e02152beb19987fa9e67f3b8bd3580904154ca6 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc
|
| @@ -13,48 +13,56 @@ namespace chromeos {
|
| namespace file_system_provider {
|
| namespace operations {
|
|
|
| -AddWatcher::AddWatcher(extensions::EventRouter* event_router,
|
| - const ProvidedFileSystemInfo& file_system_info,
|
| - const base::FilePath& entry_path,
|
| - bool recursive,
|
| - const storage::AsyncFileUtil::StatusCallback& callback)
|
| - : Operation(event_router, file_system_info),
|
| +template <class DestinationPolicy>
|
| +AddWatcher<DestinationPolicy>::AddWatcher(
|
| + typename Operation<DestinationPolicy>::EventRouterType* event_router,
|
| + const ProvidedFileSystemInfo& file_system_info,
|
| + const base::FilePath& entry_path,
|
| + bool recursive,
|
| + const storage::AsyncFileUtil::StatusCallback& callback)
|
| + : Operation<DestinationPolicy>(event_router, file_system_info),
|
| entry_path_(entry_path),
|
| recursive_(recursive),
|
| callback_(callback) {
|
| }
|
|
|
| -AddWatcher::~AddWatcher() {
|
| +template <class DestinationPolicy>
|
| +AddWatcher<DestinationPolicy>::~AddWatcher() {
|
| }
|
|
|
| -bool AddWatcher::Execute(int request_id) {
|
| +template <class DestinationPolicy>
|
| +bool AddWatcher<DestinationPolicy>::Execute(int request_id) {
|
| using extensions::api::file_system_provider::AddWatcherRequestedOptions;
|
|
|
| AddWatcherRequestedOptions 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.entry_path = entry_path_.AsUTF8Unsafe();
|
| options.recursive = recursive_;
|
|
|
| - return SendEvent(
|
| + return this->SendEvent(
|
| request_id,
|
| extensions::api::file_system_provider::OnAddWatcherRequested::kEventName,
|
| extensions::api::file_system_provider::OnAddWatcherRequested::Create(
|
| options));
|
| }
|
|
|
| -void AddWatcher::OnSuccess(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - bool has_more) {
|
| +template <class DestinationPolicy>
|
| +void AddWatcher<DestinationPolicy>::OnSuccess(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + bool has_more) {
|
| callback_.Run(base::File::FILE_OK);
|
| }
|
|
|
| -void AddWatcher::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <class DestinationPolicy>
|
| +void AddWatcher<DestinationPolicy>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(error);
|
| }
|
|
|
| +FOR_EACH_DESTINATION_SPECIALIZE(AddWatcher)
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|