| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "chrome/browser/extensions/api/declarative/rules_registry_with_cache.h" | 16 #include "chrome/browser/extensions/api/declarative/rules_registry_with_cache.h" |
| 17 #include "chrome/browser/extensions/api/declarative_webrequest/request_stages.h" | 17 #include "chrome/browser/extensions/api/declarative_webrequest/request_stages.h" |
| 18 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h
" | 18 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h
" |
| 19 #include "chrome/browser/extensions/extension_info_map.h" | 19 #include "chrome/browser/extensions/extension_info_map.h" |
| 20 #include "chrome/common/extensions/matcher/url_matcher.h" | 20 #include "chrome/common/extensions/matcher/url_matcher.h" |
| 21 | 21 |
| 22 class Profile; | 22 class Profile; |
| 23 class WebRequestPermissions; |
| 23 | 24 |
| 24 namespace extension_web_request_api_helpers { | 25 namespace extension_web_request_api_helpers { |
| 25 struct EventResponseDelta; | 26 struct EventResponseDelta; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace net { | 29 namespace net { |
| 29 class URLRequest; | 30 class URLRequest; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace extensions { | 33 namespace extensions { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // a way to also execute the actions of the rules. | 70 // a way to also execute the actions of the rules. |
| 70 std::set<WebRequestRule::GlobalRuleId> GetMatches( | 71 std::set<WebRequestRule::GlobalRuleId> GetMatches( |
| 71 net::URLRequest* request, | 72 net::URLRequest* request, |
| 72 RequestStages request_stage); | 73 RequestStages request_stage); |
| 73 | 74 |
| 74 // Returns which modifications should be executed on the network request | 75 // Returns which modifications should be executed on the network request |
| 75 // according to the rules registered in this registry. | 76 // according to the rules registered in this registry. |
| 76 std::list<LinkedPtrEventResponseDelta> CreateDeltas( | 77 std::list<LinkedPtrEventResponseDelta> CreateDeltas( |
| 77 const ExtensionInfoMap* extension_info_map, | 78 const ExtensionInfoMap* extension_info_map, |
| 78 net::URLRequest* request, | 79 net::URLRequest* request, |
| 80 bool crosses_incognito, |
| 79 RequestStages request_stage, | 81 RequestStages request_stage, |
| 80 const WebRequestRule::OptionalRequestData& optional_request_data); | 82 const WebRequestRule::OptionalRequestData& optional_request_data); |
| 81 | 83 |
| 82 // Implementation of RulesRegistryWithCache: | 84 // Implementation of RulesRegistryWithCache: |
| 83 virtual std::string AddRulesImpl( | 85 virtual std::string AddRulesImpl( |
| 84 const std::string& extension_id, | 86 const std::string& extension_id, |
| 85 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; | 87 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; |
| 86 virtual std::string RemoveRulesImpl( | 88 virtual std::string RemoveRulesImpl( |
| 87 const std::string& extension_id, | 89 const std::string& extension_id, |
| 88 const std::vector<std::string>& rule_identifiers) OVERRIDE; | 90 const std::vector<std::string>& rule_identifiers) OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 110 RulesMap webrequest_rules_; | 112 RulesMap webrequest_rules_; |
| 111 | 113 |
| 112 URLMatcher url_matcher_; | 114 URLMatcher url_matcher_; |
| 113 | 115 |
| 114 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 116 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace extensions | 119 } // namespace extensions |
| 118 | 120 |
| 119 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 121 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
| OLD | NEW |