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_condit
ion_attribute.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion_attribute.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 using base::StringValue; | 31 using base::StringValue; |
32 using base::Value; | 32 using base::Value; |
33 | 33 |
34 namespace helpers = extension_web_request_api_helpers; | 34 namespace helpers = extension_web_request_api_helpers; |
35 namespace keys = extensions::declarative_webrequest_constants; | 35 namespace keys = extensions::declarative_webrequest_constants; |
36 | 36 |
37 namespace extensions { | 37 namespace extensions { |
38 | 38 |
39 namespace { | 39 namespace { |
40 // Error messages. | 40 // Error messages. |
41 const char kUnknownConditionAttribute[] = "Unknown matching condition: '*'"; | |
42 const char kInvalidValue[] = "Condition '*' has an invalid value"; | 41 const char kInvalidValue[] = "Condition '*' has an invalid value"; |
43 | 42 |
44 struct WebRequestConditionAttributeFactory { | 43 struct WebRequestConditionAttributeFactory { |
45 DedupingFactory<WebRequestConditionAttribute> factory; | 44 DedupingFactory<WebRequestConditionAttribute> factory; |
46 | 45 |
47 WebRequestConditionAttributeFactory() : factory(5) { | 46 WebRequestConditionAttributeFactory() : factory(5) { |
48 factory.RegisterFactoryMethod( | 47 factory.RegisterFactoryMethod( |
49 keys::kResourceTypeKey, | 48 keys::kResourceTypeKey, |
50 DedupingFactory<WebRequestConditionAttribute>::IS_PARAMETERIZED, | 49 DedupingFactory<WebRequestConditionAttribute>::IS_PARAMETERIZED, |
51 &WebRequestConditionAttributeResourceType::Create); | 50 &WebRequestConditionAttributeResourceType::Create); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 bool WebRequestConditionAttributeStages::Equals( | 866 bool WebRequestConditionAttributeStages::Equals( |
868 const WebRequestConditionAttribute* other) const { | 867 const WebRequestConditionAttribute* other) const { |
869 if (!WebRequestConditionAttribute::Equals(other)) | 868 if (!WebRequestConditionAttribute::Equals(other)) |
870 return false; | 869 return false; |
871 const WebRequestConditionAttributeStages* casted_other = | 870 const WebRequestConditionAttributeStages* casted_other = |
872 static_cast<const WebRequestConditionAttributeStages*>(other); | 871 static_cast<const WebRequestConditionAttributeStages*>(other); |
873 return allowed_stages_ == casted_other->allowed_stages_; | 872 return allowed_stages_ == casted_other->allowed_stages_; |
874 } | 873 } |
875 | 874 |
876 } // namespace extensions | 875 } // namespace extensions |
OLD | NEW |