| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ |
| 6 #define EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ | 6 #define EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 const std::string& event_name); | 147 const std::string& event_name); |
| 148 | 148 |
| 149 // Returns true if this map contains an EventListener that .Equals() | 149 // Returns true if this map contains an EventListener that .Equals() |
| 150 // |listener|. | 150 // |listener|. |
| 151 bool HasListener(const EventListener* listener); | 151 bool HasListener(const EventListener* listener); |
| 152 | 152 |
| 153 // Returns true if there is a listener for |extension_id| in |process|. | 153 // Returns true if there is a listener for |extension_id| in |process|. |
| 154 bool HasProcessListener(content::RenderProcessHost* process, | 154 bool HasProcessListener(content::RenderProcessHost* process, |
| 155 const std::string& extension_id); | 155 const std::string& extension_id); |
| 156 | 156 |
| 157 // Removes any lazy listeners that |extension_id| has added. | 157 // Removes any listeners that |extension_id| has added, both lazy and regular. |
| 158 void RemoveLazyListenersForExtension(const std::string& extension_id); | 158 void RemoveListenersForExtension(const std::string& extension_id); |
| 159 | 159 |
| 160 // Adds unfiltered lazy listeners as described their serialised descriptions. | 160 // Adds unfiltered lazy listeners as described their serialised descriptions. |
| 161 // |event_names| the names of the lazy events. | 161 // |event_names| the names of the lazy events. |
| 162 // Note that we can only load lazy listeners in this fashion, because there | 162 // Note that we can only load lazy listeners in this fashion, because there |
| 163 // is no way to serialise a RenderProcessHost*. | 163 // is no way to serialise a RenderProcessHost*. |
| 164 void LoadUnfilteredLazyListeners(const std::string& extension_id, | 164 void LoadUnfilteredLazyListeners(const std::string& extension_id, |
| 165 const std::set<std::string>& event_names); | 165 const std::set<std::string>& event_names); |
| 166 | 166 |
| 167 // Adds filtered lazy listeners as described their serialised descriptions. | 167 // Adds filtered lazy listeners as described their serialised descriptions. |
| 168 // |filtered| contains a map from event names to filters, each pairing | 168 // |filtered| contains a map from event names to filters, each pairing |
| (...skipping 20 matching lines...) Expand all Loading... |
| 189 std::map<EventFilter::MatcherID, EventListener*> listeners_by_matcher_id_; | 189 std::map<EventFilter::MatcherID, EventListener*> listeners_by_matcher_id_; |
| 190 | 190 |
| 191 EventFilter event_filter_; | 191 EventFilter event_filter_; |
| 192 | 192 |
| 193 DISALLOW_COPY_AND_ASSIGN(EventListenerMap); | 193 DISALLOW_COPY_AND_ASSIGN(EventListenerMap); |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 } // namespace extensions | 196 } // namespace extensions |
| 197 | 197 |
| 198 #endif // EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ | 198 #endif // EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ |
| OLD | NEW |