| 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 "extensions/common/matcher/url_matcher_factory.h" | 5 #include "extensions/common/matcher/url_matcher_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cctype> | 8 #include <cctype> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 factory_methods_[keys::kQueryContainsKey] = | 50 factory_methods_[keys::kQueryContainsKey] = |
| 51 &F::CreateQueryContainsCondition; | 51 &F::CreateQueryContainsCondition; |
| 52 factory_methods_[keys::kQueryEqualsKey] = &F::CreateQueryEqualsCondition; | 52 factory_methods_[keys::kQueryEqualsKey] = &F::CreateQueryEqualsCondition; |
| 53 factory_methods_[keys::kQueryPrefixKey] = &F::CreateQueryPrefixCondition; | 53 factory_methods_[keys::kQueryPrefixKey] = &F::CreateQueryPrefixCondition; |
| 54 factory_methods_[keys::kQuerySuffixKey] = &F::CreateQuerySuffixCondition; | 54 factory_methods_[keys::kQuerySuffixKey] = &F::CreateQuerySuffixCondition; |
| 55 factory_methods_[keys::kURLContainsKey] = &F::CreateURLContainsCondition; | 55 factory_methods_[keys::kURLContainsKey] = &F::CreateURLContainsCondition; |
| 56 factory_methods_[keys::kURLEqualsKey] = &F::CreateURLEqualsCondition; | 56 factory_methods_[keys::kURLEqualsKey] = &F::CreateURLEqualsCondition; |
| 57 factory_methods_[keys::kURLPrefixKey] = &F::CreateURLPrefixCondition; | 57 factory_methods_[keys::kURLPrefixKey] = &F::CreateURLPrefixCondition; |
| 58 factory_methods_[keys::kURLSuffixKey] = &F::CreateURLSuffixCondition; | 58 factory_methods_[keys::kURLSuffixKey] = &F::CreateURLSuffixCondition; |
| 59 factory_methods_[keys::kURLMatchesKey] = &F::CreateURLMatchesCondition; | 59 factory_methods_[keys::kURLMatchesKey] = &F::CreateURLMatchesCondition; |
| 60 factory_methods_[keys::kStrippedURLMatchesKey] = |
| 61 &F::CreateStrippedURLMatchesCondition; |
| 60 } | 62 } |
| 61 | 63 |
| 62 // Returns whether a factory method for the specified |pattern_type| (e.g. | 64 // Returns whether a factory method for the specified |pattern_type| (e.g. |
| 63 // "host_suffix") is known. | 65 // "host_suffix") is known. |
| 64 bool Contains(const std::string& pattern_type) const { | 66 bool Contains(const std::string& pattern_type) const { |
| 65 return factory_methods_.find(pattern_type) != factory_methods_.end(); | 67 return factory_methods_.find(pattern_type) != factory_methods_.end(); |
| 66 } | 68 } |
| 67 | 69 |
| 68 // Creates a URLMatcherCondition instance from |url_matcher_condition_factory| | 70 // Creates a URLMatcherCondition instance from |url_matcher_condition_factory| |
| 69 // of the given |pattern_type| (e.g. "host_suffix") for the given | 71 // of the given |pattern_type| (e.g. "host_suffix") for the given |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } else { | 266 } else { |
| 265 *error = kInvalidPortRanges; | 267 *error = kInvalidPortRanges; |
| 266 return scoped_ptr<URLMatcherPortFilter>(NULL); | 268 return scoped_ptr<URLMatcherPortFilter>(NULL); |
| 267 } | 269 } |
| 268 } | 270 } |
| 269 | 271 |
| 270 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); | 272 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); |
| 271 } | 273 } |
| 272 | 274 |
| 273 } // namespace extensions | 275 } // namespace extensions |
| OLD | NEW |