Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: extensions/common/matcher/url_matcher_factory.cc

Issue 13699007: Provide a mechanism to the decl. WebRequest API to match URLs without the query against a RegEx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/common/matcher/url_matcher_constants.cc ('k') | extensions/common/matcher/url_matcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698