Index: chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc |
diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc b/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc |
similarity index 64% |
copy from chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
copy to chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc |
index c2a4953cbd46bdbd75f2fcc1fdaba9c1f6e5a8e5..e42d74accacbae9d963c0c64106fa69b2448e9cb 100644 |
--- a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc |
+++ b/chrome/browser/chromeos/file_system_provider/operations/add_watcher.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/chromeos/file_system_provider/operations/create_file.h" |
+#include "chrome/browser/chromeos/file_system_provider/operations/add_watcher.h" |
#include <string> |
@@ -13,43 +13,43 @@ namespace chromeos { |
namespace file_system_provider { |
namespace operations { |
-CreateFile::CreateFile(extensions::EventRouter* event_router, |
+AddWatcher::AddWatcher(extensions::EventRouter* event_router, |
const ProvidedFileSystemInfo& file_system_info, |
- const base::FilePath& file_path, |
+ const base::FilePath& entry_path, |
+ bool recursive, |
const storage::AsyncFileUtil::StatusCallback& callback) |
: Operation(event_router, file_system_info), |
- file_path_(file_path), |
+ entry_path_(entry_path), |
+ recursive_(recursive), |
callback_(callback) { |
} |
-CreateFile::~CreateFile() { |
+AddWatcher::~AddWatcher() { |
} |
-bool CreateFile::Execute(int request_id) { |
- using extensions::api::file_system_provider::CreateFileRequestedOptions; |
+bool AddWatcher::Execute(int request_id) { |
+ using extensions::api::file_system_provider::AddWatcherRequestedOptions; |
- if (!file_system_info_.writable()) |
- return false; |
- |
- CreateFileRequestedOptions options; |
+ AddWatcherRequestedOptions options; |
options.file_system_id = file_system_info_.file_system_id(); |
options.request_id = request_id; |
- options.file_path = file_path_.AsUTF8Unsafe(); |
+ options.entry_path = entry_path_.AsUTF8Unsafe(); |
+ options.recursive = recursive_; |
return SendEvent( |
request_id, |
- extensions::api::file_system_provider::OnCreateFileRequested::kEventName, |
- extensions::api::file_system_provider::OnCreateFileRequested::Create( |
+ extensions::api::file_system_provider::OnAddWatcherRequested::kEventName, |
+ extensions::api::file_system_provider::OnAddWatcherRequested::Create( |
options)); |
} |
-void CreateFile::OnSuccess(int /* request_id */, |
+void AddWatcher::OnSuccess(int /* request_id */, |
scoped_ptr<RequestValue> /* result */, |
bool has_more) { |
callback_.Run(base::File::FILE_OK); |
} |
-void CreateFile::OnError(int /* request_id */, |
+void AddWatcher::OnError(int /* request_id */, |
scoped_ptr<RequestValue> /* result */, |
base::File::Error error) { |
callback_.Run(error); |