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

Side by Side Diff: chrome/renderer/extensions/event_bindings.h

Issue 238743002: Merge ExtensionImpl into EventBindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
7 7
8 #include "chrome/renderer/extensions/chrome_v8_extension.h"
8 #include "v8/include/v8.h" 9 #include "v8/include/v8.h"
9 10
11 namespace base {
12 class DictionaryValue;
13 }
14
10 namespace extensions { 15 namespace extensions {
11 class ChromeV8Context; 16 class ChromeV8Context;
12 class ChromeV8Extension;
13 class Dispatcher; 17 class Dispatcher;
14 class EventFilter; 18 class EventFilter;
19 class EventFilteringInfo;
20 class EventMatcher;
15 21
16 // This class deals with the javascript bindings related to Event objects. 22 // This class deals with the javascript bindings related to Event objects.
17 class EventBindings { 23 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.
18 public: 24 public:
19 static ChromeV8Extension* Create(Dispatcher* dispatcher, 25 EventBindings(Dispatcher* dispatcher, ChromeV8Context* context);
20 ChromeV8Context* context); 26 virtual ~EventBindings();
27
28 // Attach an event name to an object.
29 // |event_name| The name of the event to attach.
30 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.
31
32 // Detach an event name from an object.
33 // |event_name| The name of the event to stop listening to.
34 // |is_manual| True if this detach was done by the user via removeListener()
35 // as opposed to automatically during shutdown, in which case we should inform
36 // the browser we are no longer interested in that event.
37 void DetachEvent(const v8::FunctionCallbackInfo<v8::Value>& args);
38
39 // MatcherID AttachFilteredEvent(string event_name, object filter)
40 // |event_name| Name of the event to attach.
41 // |filter| Which instances of the named event are we interested in.
42 // returns the id assigned to the listener, which will be returned from calls
43 // to MatchAgainstEventFilter where this listener matches.
44 void AttachFilteredEvent(const v8::FunctionCallbackInfo<v8::Value>& args);
45
46 // void DetachFilteredEvent(int id, bool manual)
47 // id - Id of the event to detach.
48 // manual - false if this is part of the extension unload process where all
49 // listeners are automatically detached.
50 void DetachFilteredEvent(const v8::FunctionCallbackInfo<v8::Value>& args);
51
52 void MatchAgainstEventFilter(const v8::FunctionCallbackInfo<v8::Value>& args);
53
54 private:
55 scoped_ptr<EventMatcher> ParseEventMatcher(
56 base::DictionaryValue* filter_dict);
21 }; 57 };
22 58
23 } // namespace extensions 59 } // namespace extensions
24 60
25 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 61 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698