Chromium Code Reviews| 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..5381d03dfdd2176c5e8d252aea6b4be8ae705b08 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,13 @@ 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 +140,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 +165,12 @@ class EventRouter : public KeyedService, |
| bool got_error, |
| const std::vector<std::string>& extension_ids); |
| + void DispatchDirectoryChangeEventImpl( |
|
mtomasz
2014/10/17 05:26:56
nit: Comment is missing.
yawano
2014/10/20 00:49:48
Done.
|
| + 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( |
| @@ -213,6 +231,10 @@ class EventRouter : public KeyedService, |
| // 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_; |
|
mtomasz
2014/10/17 05:26:56
Please keep weak_factory_ as the last member. See
yawano
2014/10/20 00:49:48
Done.
|
| + |
| + DispatchDirectoryChangeEventImplCallback |
|
mtomasz
2014/10/17 05:26:56
(No need for a comment for trivial members).
yawano
2014/10/20 00:49:48
Acknowledged.
|
| + dispatch_directory_change_event_impl_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(EventRouter); |
| }; |