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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_watcher_manager.h

Issue 2736613002: mediaview: Implement ArcDocumentsProviderWatcherManager. (Closed)
Patch Set: Created 3 years, 9 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/arc/fileapi/arc_documents_provider_watcher_manager.h
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_watcher_manager.h b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_watcher_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..17ddf72acb09a511acfc869f37d60ffef428b4ab
--- /dev/null
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_watcher_manager.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_WATCHER_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_WATCHER_MANAGER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "storage/browser/fileapi/watcher_manager.h"
+
+namespace arc {
+
+class ArcDocumentsProviderRootMap;
+
+// The implementation of storage::WatcherManager for ARC documents provider
+// filesystem.
+//
+// Note that this WatcherManager is not always correct. See comments at
+// ArcDocumentsProviderRoot::AddWatcher().
+class ArcDocumentsProviderWatcherManager : public storage::WatcherManager {
+ public:
+ explicit ArcDocumentsProviderWatcherManager(
+ ArcDocumentsProviderRootMap* roots);
+ ~ArcDocumentsProviderWatcherManager() override;
+
+ // storage::WatcherManager overrides.
+ void AddWatcher(const storage::FileSystemURL& url,
+ bool recursive,
+ const StatusCallback& callback,
+ const NotificationCallback& notification_callback) override;
+ void RemoveWatcher(const storage::FileSystemURL& url,
+ bool recursive,
+ const StatusCallback& callback) override;
+
+ private:
+ // Owned by ArcDocumentsProviderBackendDelegate.
+ ArcDocumentsProviderRootMap* const roots_;
+
+ base::WeakPtrFactory<ArcDocumentsProviderWatcherManager> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcDocumentsProviderWatcherManager);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_WATCHER_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698