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

Side by Side Diff: chrome/common/extensions/event_matcher.h

Issue 12208078: Move chrome/common/extensions/event_* to extensions/common/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: v8 Created 7 years, 10 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_EVENT_MATCHER_H_
6 #define CHROME_COMMON_EXTENSIONS_EVENT_MATCHER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h"
10
11 namespace extensions {
12
13 class EventFilteringInfo;
14
15 // Matches EventFilteringInfos against a set of criteria. This is intended to
16 // be used by EventFilter which performs efficient URL matching across
17 // potentially many EventMatchers itself. This is why this class only exposes
18 // MatchNonURLCriteria() - URL matching is handled by EventFilter.
19 class EventMatcher {
20 public:
21 explicit EventMatcher(scoped_ptr<base::DictionaryValue> filter);
22 ~EventMatcher();
23
24 // Returns true if |event_info| satisfies this matcher's criteria, not taking
25 // into consideration any URL criteria.
26 bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const;
27
28 int GetURLFilterCount() const;
29 bool GetURLFilter(int i, base::DictionaryValue** url_filter_out);
30
31 int HasURLFilters() const;
32
33 base::DictionaryValue* value() const {
34 return filter_.get();
35 }
36
37 private:
38 // Contains a dictionary that corresponds to a single event filter, eg:
39 //
40 // {url: [{hostSuffix: 'google.com'}]}
41 //
42 // The valid filter keys are event-specific.
43 scoped_ptr<base::DictionaryValue> filter_;
44
45 DISALLOW_COPY_AND_ASSIGN(EventMatcher);
46 };
47
48 } // namespace extensions
49
50 #endif // CHROME_COMMON_EXTENSIONS_EVENT_MATCHER_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/event_filtering_info.cc ('k') | chrome/common/extensions/event_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698