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

Side by Side Diff: chrome/browser/net/safe_search_util.h

Issue 2239753002: Added a ForceYouTubeRestrict policy and deprecated the old ForceYouTubeSafetyMode policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_ 5 #ifndef CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_
6 #define CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_ 6 #define CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_
7 7
8 class GURL; 8 class GURL;
9 9
10 namespace net { 10 namespace net {
11 class HttpRequestHeaders; 11 class HttpRequestHeaders;
12 class URLRequest; 12 class URLRequest;
13 } 13 }
14 14
15 namespace safe_search_util { 15 namespace safe_search_util {
16 16
17 // Values for YouTube Restricted Mode.
18 // VALUES MUST COINCIDE WITH ForceYouTubeRestrict POLICY.
19 enum YouTubeRestrictMode {
20 YTRM_OFF = 0, // Do not enforce a restriction on YouTube content. YouTube
Thiemo Nagel 2016/08/12 12:12:20 Nit: Please don't use abbreviations. I'd suggest
ljusten (tachyonic) 2016/08/16 09:24:54 Ohhhkayyy :-)
21 // might still restrict based on its user settings.
22 YTRM_MODERATE = 1, // Enforce at least a moderately strict content filter for
23 // YouTube.
24 YTRM_STRICT = 2, // Enforce a strict content filter for YouTube.
25 };
26
17 // If |request| is a request to Google Web Search, enforces that the SafeSearch 27 // If |request| is a request to Google Web Search, enforces that the SafeSearch
18 // query parameters are set to active. Sets |new_url| to a copy of the request 28 // query parameters are set to active. Sets |new_url| to a copy of the request
19 // url in which the query part contains the new values of the parameters. 29 // url in which the query part contains the new values of the parameters.
20 void ForceGoogleSafeSearch(const net::URLRequest* request, GURL* new_url); 30 void ForceGoogleSafeSearch(const net::URLRequest* request, GURL* new_url);
21 31
22 // If |request| is a request to YouTube, enforces YouTube's Safety Mode by 32 // If |request| is a request to YouTube, enforces a minimum YouTube's Restrict
Thiemo Nagel 2016/08/12 12:12:20 Nit: The 's is weird here.
ljusten (tachyonic) 2016/08/16 09:24:54 Acknowledged.
23 // setting YouTube's Safety Mode header. 33 // mode by setting YouTube's Restrict header. Forcing to YTRM_OFF will remove
Thiemo Nagel 2016/08/12 12:12:20 Nit: Present tense is better style, imho.
ljusten (tachyonic) 2016/08/16 09:24:54 I've reformulated that a bit.
24 void ForceYouTubeSafetyMode(const net::URLRequest* request, 34 // a Restrict header if it exists.
25 net::HttpRequestHeaders* headers); 35 void ForceYouTubeRestrict(const net::URLRequest* request,
36 net::HttpRequestHeaders* headers,
37 YouTubeRestrictMode mode);
26 38
27 int GetForceGoogleSafeSearchCountForTesting(); 39 int GetForceGoogleSafeSearchCountForTesting();
28 int GetForceYouTubeSafetyModeCountForTesting(); 40 int GetForceYouTubeRestrictCountForTesting();
29 void ClearForceGoogleSafeSearchCountForTesting(); 41 void ClearForceGoogleSafeSearchCountForTesting();
30 void ClearForceYouTubeSafetyModeCountForTesting(); 42 void ClearForceYouTubeRestrictCountForTesting();
31 43
32 } // namespace safe_search_util 44 } // namespace safe_search_util
33 45
34 #endif // CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_ 46 #endif // CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698