| 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 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 WebRequestCondition( | 72 WebRequestCondition( |
| 73 scoped_refptr<url_matcher::URLMatcherConditionSet> url_matcher_conditions, | 73 scoped_refptr<url_matcher::URLMatcherConditionSet> url_matcher_conditions, |
| 74 scoped_refptr<url_matcher::URLMatcherConditionSet> | 74 scoped_refptr<url_matcher::URLMatcherConditionSet> |
| 75 first_party_url_matcher_conditions, | 75 first_party_url_matcher_conditions, |
| 76 const WebRequestConditionAttributes& condition_attributes); | 76 const WebRequestConditionAttributes& condition_attributes); |
| 77 ~WebRequestCondition(); | 77 ~WebRequestCondition(); |
| 78 | 78 |
| 79 // Factory method that instantiates a WebRequestCondition according to | 79 // Factory method that instantiates a WebRequestCondition according to |
| 80 // the description |condition| passed by the extension API. | 80 // the description |condition| passed by the extension API. |
| 81 static scoped_ptr<WebRequestCondition> Create( | 81 static std::unique_ptr<WebRequestCondition> Create( |
| 82 const Extension* extension, | 82 const Extension* extension, |
| 83 url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory, | 83 url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory, |
| 84 const base::Value& condition, | 84 const base::Value& condition, |
| 85 std::string* error); | 85 std::string* error); |
| 86 | 86 |
| 87 // Returns whether the request matches this condition. | 87 // Returns whether the request matches this condition. |
| 88 bool IsFulfilled(const MatchData& request_data) const; | 88 bool IsFulfilled(const MatchData& request_data) const; |
| 89 | 89 |
| 90 // If this condition has url attributes, appends them to |condition_sets|. | 90 // If this condition has url attributes, appends them to |condition_sets|. |
| 91 void GetURLMatcherConditionSets( | 91 void GetURLMatcherConditionSets( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 110 int applicable_request_stages_; | 110 int applicable_request_stages_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(WebRequestCondition); | 112 DISALLOW_COPY_AND_ASSIGN(WebRequestCondition); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 typedef DeclarativeConditionSet<WebRequestCondition> WebRequestConditionSet; | 115 typedef DeclarativeConditionSet<WebRequestCondition> WebRequestConditionSet; |
| 116 | 116 |
| 117 } // namespace extensions | 117 } // namespace extensions |
| 118 | 118 |
| 119 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ | 119 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_H_ |
| OLD | NEW |