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 #ifndef CHROME_COMMON_EXTENSIONS_EVENT_FILTER_H_ | 5 #ifndef EXTENSIONS_COMMON_EVENT_FILTER_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EVENT_FILTER_H_ | 6 #define EXTENSIONS_COMMON_EVENT_FILTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "chrome/common/extensions/event_filtering_info.h" | 12 #include "extensions/common/event_filtering_info.h" |
13 #include "chrome/common/extensions/event_matcher.h" | 13 #include "extensions/common/event_matcher.h" |
14 #include "extensions/common/matcher/url_matcher.h" | 14 #include "extensions/common/matcher/url_matcher.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 // Matches incoming events against a collection of EventMatchers. Each added | 18 // Matches incoming events against a collection of EventMatchers. Each added |
19 // EventMatcher is given an id which is returned by MatchEvent() when it is | 19 // EventMatcher is given an id which is returned by MatchEvent() when it is |
20 // passed a matching event. | 20 // passed a matching event. |
21 class EventFilter { | 21 class EventFilter { |
22 public: | 22 public: |
23 typedef int MatcherID; | 23 typedef int MatcherID; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 condition_set_id_to_event_matcher_id_; | 116 condition_set_id_to_event_matcher_id_; |
117 | 117 |
118 // Maps from event matcher ids to the name of the event they match on. | 118 // Maps from event matcher ids to the name of the event they match on. |
119 std::map<MatcherID, std::string> id_to_event_name_; | 119 std::map<MatcherID, std::string> id_to_event_name_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(EventFilter); | 121 DISALLOW_COPY_AND_ASSIGN(EventFilter); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace extensions | 124 } // namespace extensions |
125 | 125 |
126 #endif // CHROME_COMMON_EXTENSIONS_EVENT_FILTER_H_ | 126 #endif // EXTENSIONS_COMMON_EVENT_FILTER_H_ |
OLD | NEW |