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_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // will respond with the URLMatcherConditionSet::ID. We can map this | 69 // will respond with the URLMatcherConditionSet::ID. We can map this |
70 // to the WebRequestRule and check whether also the other conditions (in this | 70 // to the WebRequestRule and check whether also the other conditions (in this |
71 // example 'scheme': 'http') are fulfilled. | 71 // example 'scheme': 'http') are fulfilled. |
72 class WebRequestRulesRegistry : public RulesRegistryWithCache { | 72 class WebRequestRulesRegistry : public RulesRegistryWithCache { |
73 public: | 73 public: |
74 WebRequestRulesRegistry(Profile* profile, Delegate* delegate); | 74 WebRequestRulesRegistry(Profile* profile, Delegate* delegate); |
75 | 75 |
76 // TODO(battre): This will become an implementation detail, because we need | 76 // TODO(battre): This will become an implementation detail, because we need |
77 // a way to also execute the actions of the rules. | 77 // a way to also execute the actions of the rules. |
78 std::set<const WebRequestRule*> GetMatches( | 78 std::set<const WebRequestRule*> GetMatches( |
79 const DeclarativeWebRequestData& request_data); | 79 DeclarativeWebRequestData* request_data); |
80 | 80 |
81 // Returns which modifications should be executed on the network request | 81 // Returns which modifications should be executed on the network request |
82 // according to the rules registered in this registry. | 82 // according to the rules registered in this registry. |
83 std::list<LinkedPtrEventResponseDelta> CreateDeltas( | 83 std::list<LinkedPtrEventResponseDelta> CreateDeltas( |
84 const ExtensionInfoMap* extension_info_map, | 84 const ExtensionInfoMap* extension_info_map, |
85 const DeclarativeWebRequestData& request_data, | 85 DeclarativeWebRequestData* request_data, |
86 bool crosses_incognito); | 86 bool crosses_incognito); |
87 | 87 |
88 // Implementation of RulesRegistryWithCache: | 88 // Implementation of RulesRegistryWithCache: |
89 virtual std::string AddRulesImpl( | 89 virtual std::string AddRulesImpl( |
90 const std::string& extension_id, | 90 const std::string& extension_id, |
91 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; | 91 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; |
92 virtual std::string RemoveRulesImpl( | 92 virtual std::string RemoveRulesImpl( |
93 const std::string& extension_id, | 93 const std::string& extension_id, |
94 const std::vector<std::string>& rule_identifiers) OVERRIDE; | 94 const std::vector<std::string>& rule_identifiers) OVERRIDE; |
95 virtual std::string RemoveAllRulesImpl( | 95 virtual std::string RemoveAllRulesImpl( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 RulesMap webrequest_rules_; | 137 RulesMap webrequest_rules_; |
138 | 138 |
139 URLMatcher url_matcher_; | 139 URLMatcher url_matcher_; |
140 | 140 |
141 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 141 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
142 }; | 142 }; |
143 | 143 |
144 } // namespace extensions | 144 } // namespace extensions |
145 | 145 |
146 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
OLD | NEW |