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

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

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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 3bde99a95b2c54c315dd9d01fa22d478b23fb326..7080ad88abb9f4bb29c442ff3429bfd4cecc6819 100644
--- a/chrome/browser/chromeos/file_system_provider/provided_file_system.h
+++ b/chrome/browser/chromeos/file_system_provider/provided_file_system.h
@@ -31,10 +31,6 @@ namespace base {
class FilePath;
} // namespace base
-namespace extensions {
-class EventRouter;
-} // namespace extensions
-
namespace chromeos {
namespace file_system_provider {
@@ -73,7 +69,9 @@ class AutoUpdater : public base::RefCounted<AutoUpdater> {
// Provided file system implementation. Forwards requests between providers and
// clients.
-class ProvidedFileSystem : public ProvidedFileSystemInterface {
+template <class DestinationPolicy>
+class ProvidedFileSystem : public ProvidedFileSystemInterface,
+ public DestinationPolicy {
public:
ProvidedFileSystem(Profile* profile,
const ProvidedFileSystemInfo& file_system_info);
@@ -81,7 +79,8 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface {
// Sets a custom event router. Used in unit tests to mock out the real
// extension.
- void SetEventRouterForTesting(extensions::EventRouter* event_router);
+ void SetEventRouterForTesting(
+ typename DestinationPolicy::EventRouterType* event_router);
// Sets a custom notification manager. It will recreate the request manager,
// so is must be called just after creating ProvideFileSystem instance.
@@ -232,8 +231,10 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface {
const storage::AsyncFileUtil::StatusCallback& callback,
base::File::Error result);
- Profile* profile_; // Not owned.
- extensions::EventRouter* event_router_; // Not owned. May be NULL.
+ // Not owned.
+ Profile* profile_;
+ // Not owned. May be NULL
+ typename DestinationPolicy::EventRouterType* event_router_;
ProvidedFileSystemInfo file_system_info_;
scoped_ptr<NotificationManagerInterface> notification_manager_;
scoped_ptr<RequestManager> request_manager_;
@@ -242,8 +243,8 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface {
OpenedFiles opened_files_;
base::ObserverList<ProvidedFileSystemObserver> observers_;
- base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem);
+ base::WeakPtrFactory<ProvidedFileSystem<DestinationPolicy>> weak_ptr_factory_;
+ DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem<DestinationPolicy>);
};
} // namespace file_system_provider

Powered by Google App Engine
This is Rietveld 408576698