| 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_ATTRI
BUTE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_ATTRI
BUTE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_ATTRI
BUTE_H_ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_ATTRI
BUTE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "content/public/common/resource_type.h" | |
| 15 #include "extensions/browser/api/declarative_webrequest/request_stage.h" | 14 #include "extensions/browser/api/declarative_webrequest/request_stage.h" |
| 15 #include "extensions/browser/api/web_request/web_request_resource_type.h" |
| 16 #include "extensions/common/api/events.h" | 16 #include "extensions/common/api/events.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class Value; | 19 class Value; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 class HeaderMatcher; | 24 class HeaderMatcher; |
| 25 struct WebRequestData; | 25 struct WebRequestData; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Implementation of WebRequestConditionAttribute: | 94 // Implementation of WebRequestConditionAttribute: |
| 95 int GetStages() const override; | 95 int GetStages() const override; |
| 96 bool IsFulfilled(const WebRequestData& request_data) const override; | 96 bool IsFulfilled(const WebRequestData& request_data) const override; |
| 97 Type GetType() const override; | 97 Type GetType() const override; |
| 98 std::string GetName() const override; | 98 std::string GetName() const override; |
| 99 bool Equals(const WebRequestConditionAttribute* other) const override; | 99 bool Equals(const WebRequestConditionAttribute* other) const override; |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 explicit WebRequestConditionAttributeResourceType( | 102 explicit WebRequestConditionAttributeResourceType( |
| 103 const std::vector<content::ResourceType>& types); | 103 const std::vector<WebRequestResourceType>& types); |
| 104 ~WebRequestConditionAttributeResourceType() override; | 104 ~WebRequestConditionAttributeResourceType() override; |
| 105 | 105 |
| 106 const std::vector<content::ResourceType> types_; | 106 const std::vector<WebRequestResourceType> types_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeResourceType); | 108 DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeResourceType); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 // Condition that checks whether a response's Content-Type header has a | 111 // Condition that checks whether a response's Content-Type header has a |
| 112 // certain MIME media type. | 112 // certain MIME media type. |
| 113 class WebRequestConditionAttributeContentType | 113 class WebRequestConditionAttributeContentType |
| 114 : public WebRequestConditionAttribute { | 114 : public WebRequestConditionAttribute { |
| 115 public: | 115 public: |
| 116 // Factory method, see WebRequestConditionAttribute::Create. | 116 // Factory method, see WebRequestConditionAttribute::Create. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 ~WebRequestConditionAttributeStages() override; | 258 ~WebRequestConditionAttributeStages() override; |
| 259 | 259 |
| 260 const int allowed_stages_; // Composition of RequestStage values. | 260 const int allowed_stages_; // Composition of RequestStage values. |
| 261 | 261 |
| 262 DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeStages); | 262 DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeStages); |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 } // namespace extensions | 265 } // namespace extensions |
| 266 | 266 |
| 267 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_AT
TRIBUTE_H_ | 267 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_AT
TRIBUTE_H_ |
| OLD | NEW |