OLD | NEW |
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 #include "chrome/renderer/extensions/event_bindings.h" | 5 #include "chrome/renderer/extensions/event_bindings.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // A map of extension IDs to filtered listener counts for that extension. | 65 // A map of extension IDs to filtered listener counts for that extension. |
66 base::LazyInstance<std::map<std::string, FilteredEventListenerCounts> > | 66 base::LazyInstance<std::map<std::string, FilteredEventListenerCounts> > |
67 g_filtered_listener_counts = LAZY_INSTANCE_INITIALIZER; | 67 g_filtered_listener_counts = LAZY_INSTANCE_INITIALIZER; |
68 | 68 |
69 base::LazyInstance<extensions::EventFilter> g_event_filter = | 69 base::LazyInstance<extensions::EventFilter> g_event_filter = |
70 LAZY_INSTANCE_INITIALIZER; | 70 LAZY_INSTANCE_INITIALIZER; |
71 | 71 |
72 // TODO(koz): Merge this into EventBindings. | 72 // TODO(koz): Merge this into EventBindings. |
73 class ExtensionImpl : public ChromeV8Extension { | 73 class ExtensionImpl : public ChromeV8Extension { |
74 public: | 74 public: |
75 | |
76 explicit ExtensionImpl(Dispatcher* dispatcher) | 75 explicit ExtensionImpl(Dispatcher* dispatcher) |
77 : ChromeV8Extension(dispatcher) { | 76 : ChromeV8Extension(dispatcher) { |
78 RouteStaticFunction("AttachEvent", &AttachEvent); | 77 RouteStaticFunction("AttachEvent", &AttachEvent); |
79 RouteStaticFunction("DetachEvent", &DetachEvent); | 78 RouteStaticFunction("DetachEvent", &DetachEvent); |
80 RouteStaticFunction("AttachFilteredEvent", &AttachFilteredEvent); | 79 RouteStaticFunction("AttachFilteredEvent", &AttachFilteredEvent); |
81 RouteStaticFunction("DetachFilteredEvent", &DetachFilteredEvent); | 80 RouteStaticFunction("DetachFilteredEvent", &DetachFilteredEvent); |
82 RouteStaticFunction("MatchAgainstEventFilter", &MatchAgainstEventFilter); | 81 RouteStaticFunction("MatchAgainstEventFilter", &MatchAgainstEventFilter); |
83 } | 82 } |
84 | 83 |
85 ~ExtensionImpl() {} | 84 ~ExtensionImpl() {} |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 }; | 330 }; |
332 | 331 |
333 } // namespace | 332 } // namespace |
334 | 333 |
335 // static | 334 // static |
336 ChromeV8Extension* EventBindings::Get(Dispatcher* dispatcher) { | 335 ChromeV8Extension* EventBindings::Get(Dispatcher* dispatcher) { |
337 return new ExtensionImpl(dispatcher); | 336 return new ExtensionImpl(dispatcher); |
338 } | 337 } |
339 | 338 |
340 } // namespace extensions | 339 } // namespace extensions |
OLD | NEW |