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..0762c9058478f4aa0c9f5ea06d1c9a93160f7ca9 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,57 @@ 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 <int source> |
+AddWatcher<source>::AddWatcher( |
+ typename Operation<source>::EventRouterType* event_router, |
+ const ProvidedFileSystemInfo& file_system_info, |
+ const base::FilePath& entry_path, |
+ bool recursive, |
+ const storage::AsyncFileUtil::StatusCallback& callback) |
+ : Operation<source>(event_router, file_system_info), |
entry_path_(entry_path), |
recursive_(recursive), |
callback_(callback) { |
} |
-AddWatcher::~AddWatcher() { |
+template <int source> |
+AddWatcher<source>::~AddWatcher() { |
} |
-bool AddWatcher::Execute(int request_id) { |
+template <int source> |
+bool AddWatcher<source>::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 <int source> |
+void AddWatcher<source>::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 <int source> |
+void AddWatcher<source>::OnError(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ base::File::Error error) { |
callback_.Run(error); |
} |
+template class AddWatcher<Source_Type::extension>; |
+template class AddWatcher<Source_Type::plugin>; |
+ |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |