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

Unified Diff: chrome/browser/privacy_blacklist/blocked_response.h

Issue 252001: Privacy Blacklist Unblock... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/privacy_blacklist/blocked_response.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/privacy_blacklist/blocked_response.h
===================================================================
--- chrome/browser/privacy_blacklist/blocked_response.h (revision 27622)
+++ chrome/browser/privacy_blacklist/blocked_response.h (working copy)
@@ -6,24 +6,52 @@
#define CHROME_BROWSER_PRIVACY_BLACKLIST_BLOCKED_RESPONSE_H_
#include <string>
+#include <set>
#include "chrome/browser/privacy_blacklist/blacklist.h"
+namespace chrome {
+
+extern const char kUnblockScheme[];
+extern const char kBlockScheme[];
+
// Generate localized responses to replace blacklisted resources.
// Blacklisted resources such as frames and iframes are replaced
// by HTML. Non visual resources such as Javascript and CSS are
// simply be cancelled so there is no blocked response for them.
-namespace BlockedResponse {
+class BlockedResponse {
+ public:
+ BlockedResponse() {};
-// Returns the HTML document used as substituted content for blacklisted
-// elements.
-std::string GetHTML(const Blacklist::Match* match);
+ // Returns the HTML document used as substituted content for blacklisted
+ // elements.
+ std::string GetHTML(const std::string& url, const Blacklist::Match* match);
-// Returns the image (as a string because that is what is expected by callers)
-// used as substituted content for blacklisted elements.
-std::string GetImage(const Blacklist::Match* match);
+ // Returns the image (as a string because that is what is expected by callers)
+ // used as substituted content for blacklisted elements.
+ std::string GetImage(const Blacklist::Match* match);
-} // namespace BlockedResponse
+ // Returns HTTP headers for a blocked response replacing the given url.
+ std::string GetHeaders(const std::string& url);
+ // Gets the original url of a blocked resource from its blocked url.
+ // The input must be a chome-unblock://XXX url. If the unblock url is
+ // not found, then about:blank is returned.
+ std::string GetOriginalURL(const std::string& url);
+
+ private:
+ // Returns a chrome-block://XXX link for the given requested URL.
+ std::string GetBlockedURL(const std::string& url);
+
+ // Returns a chrome-unblock://XXX link for the given chrome-block://YYY url.
+ std::string GetUnblockedURL(const std::string& url);
+
+ std::set<std::string> blocked_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlockedResponse);
+};
+
+}
+
#endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLOCKED_RESPONSE_H_
« no previous file with comments | « no previous file | chrome/browser/privacy_blacklist/blocked_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698