Chromium Code Reviews| Index: chrome/browser/net/safe_search_util.h |
| diff --git a/chrome/browser/net/safe_search_util.h b/chrome/browser/net/safe_search_util.h |
| index 2e9a0edb7afe9f269d3fc777d9d45627fd381751..f12b443934490b20b4f2020f0642cb322ff9bbdf 100644 |
| --- a/chrome/browser/net/safe_search_util.h |
| +++ b/chrome/browser/net/safe_search_util.h |
| @@ -14,20 +14,33 @@ class URLRequest; |
| namespace safe_search_util { |
| +// Values for YouTube Restricted Mode. |
| +// VALUES MUST COINCIDE WITH ForceYouTubeRestrict POLICY. |
| +enum class YouTubeRestrictMode { |
| + kOff = 0, // Do not restrict YouTube content. YouTube might still |
|
Thiemo Nagel
2016/10/05 17:38:14
Sadly the Chromium style guide requires SHOUTY_CAS
ljusten (tachyonic)
2016/10/06 10:14:45
Sigh... I cannot simply rename kStrict to STRICT b
|
| + // restrict content based on its user settings. |
| + kModerate = 1, // Enforce at least a moderately strict content filter for |
| + // YouTube. |
| + kStrict = 2 // Enforce a strict content filter for YouTube. |
| +}; |
| + |
| // If |request| is a request to Google Web Search, enforces that the SafeSearch |
| // query parameters are set to active. Sets |new_url| to a copy of the request |
| // url in which the query part contains the new values of the parameters. |
| void ForceGoogleSafeSearch(const net::URLRequest* request, GURL* new_url); |
| -// If |request| is a request to YouTube, enforces YouTube's Safety Mode by |
| -// setting YouTube's Safety Mode header. |
| -void ForceYouTubeSafetyMode(const net::URLRequest* request, |
| - net::HttpRequestHeaders* headers); |
| +// Does nothing if |request| is not a request to YouTube. Otherwise, if |mode| |
| +// is not |YouTubeRestrictMode::kOff|, enforces a minimum YouTube Restrict mode |
| +// by setting YouTube Restrict header. Setting |YouTubeRestrictMode::kOff| |
| +// removes a Restrict header if it exists. |
| +void ForceYouTubeRestrict(const net::URLRequest* request, |
| + net::HttpRequestHeaders* headers, |
| + YouTubeRestrictMode mode); |
| int GetForceGoogleSafeSearchCountForTesting(); |
| -int GetForceYouTubeSafetyModeCountForTesting(); |
| +int GetForceYouTubeRestrictCountForTesting(); |
| void ClearForceGoogleSafeSearchCountForTesting(); |
| -void ClearForceYouTubeSafetyModeCountForTesting(); |
| +void ClearForceYouTubeRestrictCountForTesting(); |
| } // namespace safe_search_util |