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/common/extensions/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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/common/extensions/matcher/url_matcher_constants.h" | |
15 #include "chrome/common/extensions/matcher/url_matcher_helpers.h" | |
16 #include "extensions/common/error_utils.h" | 14 #include "extensions/common/error_utils.h" |
| 15 #include "extensions/common/matcher/url_matcher_constants.h" |
| 16 #include "extensions/common/matcher/url_matcher_helpers.h" |
17 #include "third_party/re2/re2/re2.h" | 17 #include "third_party/re2/re2/re2.h" |
18 | 18 |
19 namespace helpers = extensions::url_matcher_helpers; | 19 namespace helpers = extensions::url_matcher_helpers; |
20 namespace keys = extensions::url_matcher_constants; | 20 namespace keys = extensions::url_matcher_constants; |
21 | 21 |
22 namespace { | 22 namespace { |
23 // Error messages: | 23 // Error messages: |
24 const char kInvalidPortRanges[] = "Invalid port ranges in UrlFilter."; | 24 const char kInvalidPortRanges[] = "Invalid port ranges in UrlFilter."; |
25 const char kVectorOfStringsExpected[] = | 25 const char kVectorOfStringsExpected[] = |
26 "UrlFilter attribute '*' expected a vector of strings as parameter."; | 26 "UrlFilter attribute '*' expected a vector of strings as parameter."; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } else { | 264 } else { |
265 *error = kInvalidPortRanges; | 265 *error = kInvalidPortRanges; |
266 return scoped_ptr<URLMatcherPortFilter>(NULL); | 266 return scoped_ptr<URLMatcherPortFilter>(NULL); |
267 } | 267 } |
268 } | 268 } |
269 | 269 |
270 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); | 270 return scoped_ptr<URLMatcherPortFilter>(new URLMatcherPortFilter(ranges)); |
271 } | 271 } |
272 | 272 |
273 } // namespace extensions | 273 } // namespace extensions |
OLD | NEW |