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/common/extensions/event_filter.h" | 5 #include "chrome/common/extensions/event_filter.h" |
6 | 6 |
7 #include "chrome/common/extensions/matcher/url_matcher_factory.h" | 7 #include "extensions/common/matcher/url_matcher_factory.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
11 EventFilter::EventMatcherEntry::EventMatcherEntry( | 11 EventFilter::EventMatcherEntry::EventMatcherEntry( |
12 scoped_ptr<EventMatcher> event_matcher, | 12 scoped_ptr<EventMatcher> event_matcher, |
13 URLMatcher* url_matcher, | 13 URLMatcher* url_matcher, |
14 const URLMatcherConditionSet::Vector& condition_sets) | 14 const URLMatcherConditionSet::Vector& condition_sets) |
15 : event_matcher_(event_matcher.Pass()), | 15 : event_matcher_(event_matcher.Pass()), |
16 url_matcher_(url_matcher) { | 16 url_matcher_(url_matcher) { |
17 for (URLMatcherConditionSet::Vector::const_iterator it = | 17 for (URLMatcherConditionSet::Vector::const_iterator it = |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 int EventFilter::GetMatcherCountForEvent(const std::string& name) { | 164 int EventFilter::GetMatcherCountForEvent(const std::string& name) { |
165 EventMatcherMultiMap::const_iterator it = event_matchers_.find(name); | 165 EventMatcherMultiMap::const_iterator it = event_matchers_.find(name); |
166 if (it == event_matchers_.end()) | 166 if (it == event_matchers_.end()) |
167 return 0; | 167 return 0; |
168 | 168 |
169 return it->second.size(); | 169 return it->second.size(); |
170 } | 170 } |
171 | 171 |
172 } // namespace extensions | 172 } // namespace extensions |
OLD | NEW |