Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4238)

Unified Diff: chrome/browser/chromeos/file_system_provider/provided_file_system.h

Issue 625463002: [fsp] Add support for observing entries and notifying about changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/provided_file_system.h
diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system.h b/chrome/browser/chromeos/file_system_provider/provided_file_system.h
index ce896bd5836dbe723658024e8baf874ec3031b35..799d9cc9f700f1ad53ed72f6bb890128aa550cee 100644
--- a/chrome/browser/chromeos/file_system_provider/provided_file_system.h
+++ b/chrome/browser/chromeos/file_system_provider/provided_file_system.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
#include "chrome/browser/chromeos/file_system_provider/request_manager.h"
@@ -89,8 +90,19 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface {
int64 offset,
int length,
const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
+ virtual AbortCallback ObserveDirectory(
+ const base::FilePath& directory_path,
+ bool recursive,
+ const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
+ virtual AbortCallback UnobserveEntry(
+ const base::FilePath& entry_path,
+ const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
virtual RequestManager* GetRequestManager() OVERRIDE;
+ virtual ObservedEntries* GetObservedEntries() OVERRIDE;
+ virtual void AddObserver(Observer* observer) OVERRIDE;
+ virtual void RemoveObserver(Observer* observer) OVERRIDE;
+ virtual ObserverList<Observer>* GetObservers() OVERRIDE;
virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE;
private:
@@ -100,11 +112,20 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface {
void Abort(int operation_request_id,
const storage::AsyncFileUtil::StatusCallback& callback);
+ // Called when a directory becomes watched successfully.
+ void OnObserveDirectoryCompleted(
+ const base::FilePath& directory_path,
+ bool recursive,
+ const storage::AsyncFileUtil::StatusCallback& callback,
+ base::File::Error result);
+
Profile* profile_; // Not owned.
extensions::EventRouter* event_router_; // Not owned. May be NULL.
ProvidedFileSystemInfo file_system_info_;
scoped_ptr<NotificationManagerInterface> notification_manager_;
RequestManager request_manager_;
+ ObservedEntries observed_entries_;
+ ObserverList<Observer> observers_;
base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem);

Powered by Google App Engine
This is Rietveld 408576698