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 13 matching lines...) Expand all Loading... |
24 int routing_id); | 24 int routing_id); |
25 ~EventMatcher(); | 25 ~EventMatcher(); |
26 | 26 |
27 // Returns true if |event_info| satisfies this matcher's criteria, not taking | 27 // Returns true if |event_info| satisfies this matcher's criteria, not taking |
28 // into consideration any URL criteria. | 28 // into consideration any URL criteria. |
29 bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const; | 29 bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const; |
30 | 30 |
31 int GetURLFilterCount() const; | 31 int GetURLFilterCount() const; |
32 bool GetURLFilter(int i, base::DictionaryValue** url_filter_out); | 32 bool GetURLFilter(int i, base::DictionaryValue** url_filter_out); |
33 | 33 |
| 34 int GetWindowTypeCount() const; |
| 35 bool GetWindowType(int i, std::string* window_type_out) const; |
| 36 |
34 std::string GetServiceTypeFilter() const; | 37 std::string GetServiceTypeFilter() const; |
35 | 38 |
36 int HasURLFilters() const; | 39 int HasURLFilters() const; |
37 | 40 |
38 int GetInstanceID() const; | 41 int GetInstanceID() const; |
39 | 42 |
40 int GetRoutingID() const; | 43 int GetRoutingID() const; |
41 | 44 |
42 base::DictionaryValue* value() const { | 45 base::DictionaryValue* value() const { |
43 return filter_.get(); | 46 return filter_.get(); |
44 } | 47 } |
45 | 48 |
46 private: | 49 private: |
47 // Contains a dictionary that corresponds to a single event filter, eg: | 50 // Contains a dictionary that corresponds to a single event filter, eg: |
48 // | 51 // |
49 // {url: [{hostSuffix: 'google.com'}]} | 52 // {url: [{hostSuffix: 'google.com'}]} |
50 // | 53 // |
51 // The valid filter keys are event-specific. | 54 // The valid filter keys are event-specific. |
52 scoped_ptr<base::DictionaryValue> filter_; | 55 scoped_ptr<base::DictionaryValue> filter_; |
53 | 56 |
54 int routing_id_; | 57 int routing_id_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(EventMatcher); | 59 DISALLOW_COPY_AND_ASSIGN(EventMatcher); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace extensions | 62 } // namespace extensions |
60 | 63 |
61 #endif // EXTENSIONS_COMMON_EVENT_MATCHER_H_ | 64 #endif // EXTENSIONS_COMMON_EVENT_MATCHER_H_ |
OLD | NEW |