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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/event_router.h

Issue 658013002: Changed api to notify when watched directory is deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted arguments. 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/extensions/file_manager/event_router.h
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.h b/chrome/browser/chromeos/extensions/file_manager/event_router.h
index 205591e63b2ff078ceac6e07d013ced11872c04a..15be21b6735efa1ccf317c11eae1183c5795de20 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.h
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.h
@@ -7,6 +7,7 @@
#include <map>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -57,6 +58,12 @@ class EventRouter : public KeyedService,
public VolumeManagerObserver,
public content::NotificationObserver {
public:
+ typedef base::Callback<void(const base::FilePath& virtual_path,
+ const drive::FileChange* list,
+ bool got_error,
+ const std::vector<std::string>& extension_ids)>
+ DispatchDirectoryChangeEventImplCallback;
+
explicit EventRouter(Profile* profile);
virtual ~EventRouter();
@@ -132,6 +139,10 @@ class EventRouter : public KeyedService,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ // Set custom dispatch directory change event implementation for testing.
+ void SetDispatchDirectoryChangeEventImplForTesting(
+ const DispatchDirectoryChangeEventImplCallback& callback);
+
private:
typedef std::map<base::FilePath, FileWatcher*> WatcherMap;
@@ -153,6 +164,13 @@ class EventRouter : public KeyedService,
bool got_error,
const std::vector<std::string>& extension_ids);
+ // Default implementation of DispatchDirectoryChangeEvent.
+ void DispatchDirectoryChangeEventImpl(
+ const base::FilePath& path,
+ const drive::FileChange* list,
+ bool got_error,
+ const std::vector<std::string>& extension_ids);
+
// Sends directory change event, after converting the file definition to entry
// definition.
void DispatchDirectoryChangeEventWithEntryDefinition(
@@ -210,9 +228,13 @@ class EventRouter : public KeyedService,
scoped_ptr<DeviceEventRouter> device_event_router_;
+ DispatchDirectoryChangeEventImplCallback
+ dispatch_directory_change_event_impl_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed.
base::WeakPtrFactory<EventRouter> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(EventRouter);
};
« no previous file with comments | « chrome/browser/chromeos/drive/file_change.cc ('k') | chrome/browser/chromeos/extensions/file_manager/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698