Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 29331737: Issue 3363 - Implement IsDocumentWhitelisted and IsElemhideWhitelisted (Closed)
Patch Set: Removed unnecessary @throw doc param. Created Dec. 2, 2015, 2:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
diff --git a/include/AdblockPlus/FilterEngine.h b/include/AdblockPlus/FilterEngine.h
index 40484cc26cb9512a15688d28c354dc67d10cf037..46c4fd039cb03746cf5e2ca3b73634aacde66a64 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -299,6 +299,34 @@ namespace AdblockPlus
const std::vector<std::string>& documentUrls) const;
/**
+ * Checks if the supplied URL is whitelisted.
Felix Dahlke 2015/12/02 17:17:29 "Checks whether the document at the supplied URL i
René Jeschke 2015/12/02 17:38:40 Done.
+ * @param url URL to match.
Felix Dahlke 2015/12/02 17:17:29 I'd vote for: "URL of the document" instead, "matc
René Jeschke 2015/12/02 17:38:40 Done.
+ * @param documentUrls Chain of documents requesting the resource, starting
Felix Dahlke 2015/12/02 17:17:29 If you decide to go for "URL of the document" abov
René Jeschke 2015/12/02 17:38:40 Done.
+ * with the current resource's parent frame, ending with the
+ * top-level frame.
+ * If the application is not capable of identifying the frame
+ * structure, e.g. because it is a proxy, it can be approximated
+ * using `ReferrerMapping`.
+ * @return `true` if the URL is whitelisted.
+ */
+ bool IsDocumentWhitelisted(const std::string& url,
+ const std::vector<std::string>& documentUrls) const;
+
+ /**
+ * Checks if the element hiding is whitelisted for the supplied URL.
Felix Dahlke 2015/12/02 17:17:29 Doesn't sound entirely right to me, how about: "Ch
René Jeschke 2015/12/02 17:38:39 Done.
+ * @param url URL to match.
+ * @param documentUrls Chain of documents requesting the resource, starting
+ * with the current resource's parent frame, ending with the
+ * top-level frame.
+ * If the application is not capable of identifying the frame
+ * structure, e.g. because it is a proxy, it can be approximated
+ * using `ReferrerMapping`.
+ * @return `true` if element hiding is whitelisted for the supplied URL.
+ */
+ bool IsElemhideWhitelisted(const std::string& url,
+ const std::vector<std::string>& documentUrls) const;
+
+ /**
* Retrieves CSS selectors for all element hiding filters active on the
* supplied domain.
* @param domain Domain to retrieve CSS selectors for.
@@ -409,6 +437,11 @@ namespace AdblockPlus
void FilterChanged(FilterChangeCallback callback, JsValueList& params);
void ShowNotification(const ShowNotificationCallback& callback,
const JsValueList& params);
+ std::string GetWhitelistingFilter(const std::string& url,
+ const std::string& parent, ContentType contentType) const;
Felix Dahlke 2015/12/02 17:17:29 Nit: s/parent/documentUrl/, analogous to the two M
Felix Dahlke 2015/12/02 17:17:29 Nit: Switch parent/documentUrl and contentType, an
René Jeschke 2015/12/02 17:38:40 Done.
René Jeschke 2015/12/02 17:38:40 Done.
+ std::string GetWhitelistingFilter(const std::string& urlArg,
Felix Dahlke 2015/12/02 17:17:29 Nit: s/urlArg/url/?
René Jeschke 2015/12/02 17:38:40 Done.
+ const std::vector<std::string>& documentUrls,
+ ContentType contentType) const;
};
}
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld