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

Unified Diff: chrome/browser/chromeos/file_system_provider/service.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: Rebased. 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/service.h
diff --git a/chrome/browser/chromeos/file_system_provider/service.h b/chrome/browser/chromeos/file_system_provider/service.h
index 12686ed2431d92d3740797a7dba531c92142e9f8..7f69e5aa096b7c6e8492b7c5c466d9776de8d86b 100644
--- a/chrome/browser/chromeos/file_system_provider/service.h
+++ b/chrome/browser/chromeos/file_system_provider/service.h
@@ -18,6 +18,8 @@
#include "base/threading/thread_checker.h"
#include "base/values.h"
#include "chrome/browser/chromeos/file_system_provider/observer.h"
+#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
+#include "chrome/browser/chromeos/file_system_provider/provided_file_system_observer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/file_system_provider.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -40,6 +42,7 @@ namespace file_system_provider {
extern const char kPrefKeyFileSystemId[];
extern const char kPrefKeyDisplayName[];
extern const char kPrefKeyWritable[];
+extern const char kPrefKeySupportsNotifyTag[];
class ProvidedFileSystemFactoryInterface;
class ProvidedFileSystemInfo;
@@ -52,7 +55,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// Manages and registers the file system provider service. Maintains provided
// file systems.
class Service : public KeyedService,
- public extensions::ExtensionRegistryObserver {
+ public extensions::ExtensionRegistryObserver,
+ public ProvidedFileSystemObserver {
public:
typedef base::Callback<ProvidedFileSystemInterface*(
Profile* profile,
@@ -74,12 +78,15 @@ class Service : public KeyedService,
// Mounts a file system provided by an extension with the |extension_id|. If
// |writable| is set to true, then the file system is mounted in a R/W mode.
- // Otherwise, only read-only operations are supported. For success, returns
+ // Otherwise, only read-only operations are supported. If change notification
+ // tags are supported, then |supports_notify_tag| must be true. Note, that
+ // it is required in order to enable the internal cache. For success, returns
// true, otherwise false.
bool MountFileSystem(const std::string& extension_id,
const std::string& file_system_id,
const std::string& display_name,
- bool writable);
+ bool writable,
+ bool supports_notify_tag);
// Unmounts a file system with the specified |file_system_id| for the
// |extension_id|. For success returns true, otherwise false.
@@ -124,6 +131,19 @@ class Service : public KeyedService,
content::BrowserContext* browser_context,
const extensions::Extension* extension) override;
+ // ProvidedFileSystemInterface::Observer overrides.
+ virtual void OnObservedEntryChanged(
+ const ProvidedFileSystemInfo& file_system_info,
+ const base::FilePath& observed_path,
+ ProvidedFileSystemObserver::ChangeType change_type,
+ const ProvidedFileSystemObserver::ChildChanges& child_changes,
+ const base::Closure& callback) override;
+ virtual void OnObservedEntryTagUpdated(
+ const ProvidedFileSystemInfo& file_system_info,
+ const base::FilePath& observed_path) override;
+ virtual void OnObservedEntryListChanged(
+ const ProvidedFileSystemInfo& file_system_info) override;
+
private:
// Key is a pair of an extension id and file system id, which makes it
// unique among the entire service instance.

Powered by Google App Engine
This is Rietveld 408576698