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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h

Issue 10982044: Adding thirdParty property to RequestMatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reordered the unit-test to spare setting up some URLs. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h
index cc5d2518e12746e82ef3fda3903e03f2cf3d99cc..00f5eed77fd849b461ea3db52d0fc4b6bcf82197 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h
@@ -36,7 +36,8 @@ class WebRequestConditionAttribute {
enum Type {
CONDITION_RESOURCE_TYPE,
CONDITION_CONTENT_TYPE,
- CONDITION_RESPONSE_HEADERS
+ CONDITION_RESPONSE_HEADERS,
+ CONDITION_THIRD_PARTY
};
WebRequestConditionAttribute();
@@ -172,6 +173,34 @@ class WebRequestConditionAttributeResponseHeaders
DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeResponseHeaders);
};
+// This condition tests whether the request origin is third-party.
+class WebRequestConditionAttributeThirdParty
+ : public WebRequestConditionAttribute {
+ public:
+ virtual ~WebRequestConditionAttributeThirdParty();
+
+ static bool IsMatchingType(const std::string& instance_type);
+
+ // Factory method, see WebRequestConditionAttribute::Create.
+ static scoped_ptr<WebRequestConditionAttribute> Create(
+ const std::string& name,
+ const base::Value* value,
+ std::string* error);
+
+ // Implementation of WebRequestConditionAttribute:
+ virtual int GetStages() const OVERRIDE;
+ virtual bool IsFulfilled(
+ const WebRequestRule::RequestData& request_data) const OVERRIDE;
+ virtual Type GetType() const OVERRIDE;
+
+ private:
+ explicit WebRequestConditionAttributeThirdParty(bool match_third_party);
+
+ const bool match_third_party_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeThirdParty);
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_CONDITION_ATTRIBUTE_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698