summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/safe_search_util.h
blob: 2e9a0edb7afe9f269d3fc777d9d45627fd381751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_
#define CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_

class GURL;

namespace net {
class HttpRequestHeaders;
class URLRequest;
}

namespace safe_search_util {

// 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);

int GetForceGoogleSafeSearchCountForTesting();
int GetForceYouTubeSafetyModeCountForTesting();
void ClearForceGoogleSafeSearchCountForTesting();
void ClearForceYouTubeSafetyModeCountForTesting();

}  // namespace safe_search_util

#endif  // CHROME_BROWSER_NET_SAFE_SEARCH_UTIL_H_