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 EXTENSIONS_COMMON_EVENT_MATCHER_H_ | 5 #ifndef EXTENSIONS_COMMON_EVENT_MATCHER_H_ |
6 #define EXTENSIONS_COMMON_EVENT_MATCHER_H_ | 6 #define EXTENSIONS_COMMON_EVENT_MATCHER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Returns true if |event_info| satisfies this matcher's criteria, not taking | 24 // Returns true if |event_info| satisfies this matcher's criteria, not taking |
25 // into consideration any URL criteria. | 25 // into consideration any URL criteria. |
26 bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const; | 26 bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const; |
27 | 27 |
28 int GetURLFilterCount() const; | 28 int GetURLFilterCount() const; |
29 bool GetURLFilter(int i, base::DictionaryValue** url_filter_out); | 29 bool GetURLFilter(int i, base::DictionaryValue** url_filter_out); |
30 | 30 |
31 int HasURLFilters() const; | 31 int HasURLFilters() const; |
32 | 32 |
| 33 int GetInstanceID() const; |
| 34 |
33 base::DictionaryValue* value() const { | 35 base::DictionaryValue* value() const { |
34 return filter_.get(); | 36 return filter_.get(); |
35 } | 37 } |
36 | 38 |
37 private: | 39 private: |
38 // Contains a dictionary that corresponds to a single event filter, eg: | 40 // Contains a dictionary that corresponds to a single event filter, eg: |
39 // | 41 // |
40 // {url: [{hostSuffix: 'google.com'}]} | 42 // {url: [{hostSuffix: 'google.com'}]} |
41 // | 43 // |
42 // The valid filter keys are event-specific. | 44 // The valid filter keys are event-specific. |
43 scoped_ptr<base::DictionaryValue> filter_; | 45 scoped_ptr<base::DictionaryValue> filter_; |
44 | 46 |
45 DISALLOW_COPY_AND_ASSIGN(EventMatcher); | 47 DISALLOW_COPY_AND_ASSIGN(EventMatcher); |
46 }; | 48 }; |
47 | 49 |
48 } // namespace extensions | 50 } // namespace extensions |
49 | 51 |
50 #endif // EXTENSIONS_COMMON_EVENT_MATCHER_H_ | 52 #endif // EXTENSIONS_COMMON_EVENT_MATCHER_H_ |
OLD | NEW |