| 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 25 matching lines...) Expand all Loading... |
| 36 // that allows translating string literals from the extension API into | 36 // that allows translating string literals from the extension API into |
| 37 // the corresponding factory method to be called. | 37 // the corresponding factory method to be called. |
| 38 class URLMatcherConditionFactoryMethods { | 38 class URLMatcherConditionFactoryMethods { |
| 39 public: | 39 public: |
| 40 URLMatcherConditionFactoryMethods() { | 40 URLMatcherConditionFactoryMethods() { |
| 41 typedef extensions::URLMatcherConditionFactory F; | 41 typedef extensions::URLMatcherConditionFactory F; |
| 42 factory_methods_[keys::kHostContainsKey] = &F::CreateHostContainsCondition; | 42 factory_methods_[keys::kHostContainsKey] = &F::CreateHostContainsCondition; |
| 43 factory_methods_[keys::kHostEqualsKey] = &F::CreateHostEqualsCondition; | 43 factory_methods_[keys::kHostEqualsKey] = &F::CreateHostEqualsCondition; |
| 44 factory_methods_[keys::kHostPrefixKey] = &F::CreateHostPrefixCondition; | 44 factory_methods_[keys::kHostPrefixKey] = &F::CreateHostPrefixCondition; |
| 45 factory_methods_[keys::kHostSuffixKey] = &F::CreateHostSuffixCondition; | 45 factory_methods_[keys::kHostSuffixKey] = &F::CreateHostSuffixCondition; |
| 46 factory_methods_[keys::kOriginAndPathMatchesKey] = |
| 47 &F::CreateOriginAndPathMatchesCondition; |
| 46 factory_methods_[keys::kPathContainsKey] = &F::CreatePathContainsCondition; | 48 factory_methods_[keys::kPathContainsKey] = &F::CreatePathContainsCondition; |
| 47 factory_methods_[keys::kPathEqualsKey] = &F::CreatePathEqualsCondition; | 49 factory_methods_[keys::kPathEqualsKey] = &F::CreatePathEqualsCondition; |
| 48 factory_methods_[keys::kPathPrefixKey] = &F::CreatePathPrefixCondition; | 50 factory_methods_[keys::kPathPrefixKey] = &F::CreatePathPrefixCondition; |
| 49 factory_methods_[keys::kPathSuffixKey] = &F::CreatePathSuffixCondition; | 51 factory_methods_[keys::kPathSuffixKey] = &F::CreatePathSuffixCondition; |
| 50 factory_methods_[keys::kQueryContainsKey] = | 52 factory_methods_[keys::kQueryContainsKey] = |
| 51 &F::CreateQueryContainsCondition; | 53 &F::CreateQueryContainsCondition; |
| 52 factory_methods_[keys::kQueryEqualsKey] = &F::CreateQueryEqualsCondition; | 54 factory_methods_[keys::kQueryEqualsKey] = &F::CreateQueryEqualsCondition; |
| 53 factory_methods_[keys::kQueryPrefixKey] = &F::CreateQueryPrefixCondition; | 55 factory_methods_[keys::kQueryPrefixKey] = &F::CreateQueryPrefixCondition; |
| 54 factory_methods_[keys::kQuerySuffixKey] = &F::CreateQuerySuffixCondition; | 56 factory_methods_[keys::kQuerySuffixKey] = &F::CreateQuerySuffixCondition; |
| 55 factory_methods_[keys::kURLContainsKey] = &F::CreateURLContainsCondition; | 57 factory_methods_[keys::kURLContainsKey] = &F::CreateURLContainsCondition; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } else { | 267 } else { |
| 266 *error = kInvalidPortRanges; | 268 *error = kInvalidPortRanges; |
| 267 return scoped_ptr<URLMatcherPortFilter>(NULL); | 269 return scoped_ptr<URLMatcherPortFilter>(NULL); |
| 268 } | 270 } |
| 269 } | 271 } |
| 270 | 272 |
| 271 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); | 273 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); |
| 272 } | 274 } |
| 273 | 275 |
| 274 } // namespace extensions | 276 } // namespace extensions |
| OLD | NEW |