| 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 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const char kAllURLsPermissionNeeded[] = | 29 const char kAllURLsPermissionNeeded[] = |
| 30 "To execute the action '*', you need to request host permission for all " | 30 "To execute the action '*', you need to request host permission for all " |
| 31 "hosts."; | 31 "hosts."; |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 namespace extensions { | 35 namespace extensions { |
| 36 | 36 |
| 37 WebRequestRulesRegistry::WebRequestRulesRegistry( | 37 WebRequestRulesRegistry::WebRequestRulesRegistry( |
| 38 Profile* profile, | 38 Profile* profile, |
| 39 RulesCacheDelegate* cache_delegate) | 39 RulesCacheDelegate* cache_delegate, |
| 40 const WebViewKey& webview_key) |
| 40 : RulesRegistry(profile, | 41 : RulesRegistry(profile, |
| 41 declarative_webrequest_constants::kOnRequest, | 42 declarative_webrequest_constants::kOnRequest, |
| 42 content::BrowserThread::IO, | 43 content::BrowserThread::IO, |
| 43 cache_delegate), | 44 cache_delegate, |
| 45 webview_key), |
| 44 profile_id_(profile) { | 46 profile_id_(profile) { |
| 45 if (profile) | 47 if (profile) |
| 46 extension_info_map_ = ExtensionSystem::Get(profile)->info_map(); | 48 extension_info_map_ = ExtensionSystem::Get(profile)->info_map(); |
| 47 } | 49 } |
| 48 | 50 |
| 49 std::set<const WebRequestRule*> WebRequestRulesRegistry::GetMatches( | 51 std::set<const WebRequestRule*> WebRequestRulesRegistry::GetMatches( |
| 50 const WebRequestData& request_data_without_ids) const { | 52 const WebRequestData& request_data_without_ids) const { |
| 51 RuleSet result; | 53 RuleSet result; |
| 52 | 54 |
| 53 WebRequestDataWithMatchIds request_data(&request_data_without_ids); | 55 WebRequestDataWithMatchIds request_data(&request_data_without_ids); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 RuleTriggers::const_iterator rule_trigger = rule_triggers_.find(*url_match); | 401 RuleTriggers::const_iterator rule_trigger = rule_triggers_.find(*url_match); |
| 400 CHECK(rule_trigger != rule_triggers_.end()); | 402 CHECK(rule_trigger != rule_triggers_.end()); |
| 401 if (!ContainsKey(*result, rule_trigger->second) && | 403 if (!ContainsKey(*result, rule_trigger->second) && |
| 402 rule_trigger->second->conditions().IsFulfilled(*url_match, | 404 rule_trigger->second->conditions().IsFulfilled(*url_match, |
| 403 request_data)) | 405 request_data)) |
| 404 result->insert(rule_trigger->second); | 406 result->insert(rule_trigger->second); |
| 405 } | 407 } |
| 406 } | 408 } |
| 407 | 409 |
| 408 } // namespace extensions | 410 } // namespace extensions |
| OLD | NEW |