Index: chrome/renderer/extensions/event_bindings.h |
diff --git a/chrome/renderer/extensions/event_bindings.h b/chrome/renderer/extensions/event_bindings.h |
index c7099539706e8c7b31fd8e2f1c775fa52160f5f9..89551c9bdb78856e856c56847967ebd74508aae7 100644 |
--- a/chrome/renderer/extensions/event_bindings.h |
+++ b/chrome/renderer/extensions/event_bindings.h |
@@ -5,19 +5,55 @@ |
#ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
#define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
+#include "chrome/renderer/extensions/chrome_v8_extension.h" |
#include "v8/include/v8.h" |
+namespace base { |
+class DictionaryValue; |
+} |
+ |
namespace extensions { |
class ChromeV8Context; |
-class ChromeV8Extension; |
class Dispatcher; |
class EventFilter; |
+class EventFilteringInfo; |
+class EventMatcher; |
// This class deals with the javascript bindings related to Event objects. |
-class EventBindings { |
+class EventBindings : public ChromeV8Extension { |
not at google - send to devlin
2014/04/15 16:44:11
Ideally you should extend ObjectBackedNativeHandle
koz (OOO until 15th September)
2014/04/15 23:36:57
Done.
|
public: |
- static ChromeV8Extension* Create(Dispatcher* dispatcher, |
- ChromeV8Context* context); |
+ EventBindings(Dispatcher* dispatcher, ChromeV8Context* context); |
+ virtual ~EventBindings(); |
+ |
+ // Attach an event name to an object. |
+ // |event_name| The name of the event to attach. |
+ void AttachEvent(const v8::FunctionCallbackInfo<v8::Value>& args); |
not at google - send to devlin
2014/04/15 16:44:11
can these be private?
koz (OOO until 15th September)
2014/04/15 23:36:57
Done.
|
+ |
+ // Detach an event name from an object. |
+ // |event_name| The name of the event to stop listening to. |
+ // |is_manual| True if this detach was done by the user via removeListener() |
+ // as opposed to automatically during shutdown, in which case we should inform |
+ // the browser we are no longer interested in that event. |
+ void DetachEvent(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ // MatcherID AttachFilteredEvent(string event_name, object filter) |
+ // |event_name| Name of the event to attach. |
+ // |filter| Which instances of the named event are we interested in. |
+ // returns the id assigned to the listener, which will be returned from calls |
+ // to MatchAgainstEventFilter where this listener matches. |
+ void AttachFilteredEvent(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ // void DetachFilteredEvent(int id, bool manual) |
+ // id - Id of the event to detach. |
+ // manual - false if this is part of the extension unload process where all |
+ // listeners are automatically detached. |
+ void DetachFilteredEvent(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ void MatchAgainstEventFilter(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ private: |
+ scoped_ptr<EventMatcher> ParseEventMatcher( |
+ base::DictionaryValue* filter_dict); |
}; |
} // namespace extensions |