chromium/components/safe_search_api/safe_search_util.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/safe_search_api/safe_search_util.h"

#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "components/google/core/common/google_util.h"
#include "net/cookies/cookie_util.h"
#include "net/http/http_request_headers.h"
#include "url/gurl.h"

namespace {

// Returns whether a URL parameter, |first_parameter| (e.g. foo=bar), has the
// same key as the the |second_parameter| (e.g. foo=baz). Both parameters
// must be in key=value form.
bool HasSameParameterKey(std::string_view first_parameter,
                         std::string_view second_parameter) {}

// Examines the query string containing parameters and adds the necessary ones
// so that SafeSearch is active. |query| is the string to examine and the
// return value is the |query| string modified such that SafeSearch is active.
std::string AddSafeSearchParameters(const std::string& query) {}

bool IsSafeSearchSettingUrl(const GURL& url) {}

}  // namespace

namespace safe_search_api {

const char kSafeSearchSafeParameter[] =;
const char kSafeSearchSsuiParameter[] =;
const char kYouTubeRestrictHeaderName[] =;
const char kYouTubeRestrictHeaderValueModerate[] =;
const char kYouTubeRestrictHeaderValueStrict[] =;
const char kGoogleAppsAllowedDomains[] =;

// If |request| is a request to Google Web Search the function
// enforces that the SafeSearch query parameters are set to active.
// Sets the query part of |new_url| with the new value of the parameters.
void ForceGoogleSafeSearch(const GURL& url, GURL* new_url) {}

void ForceYouTubeRestrict(const GURL& url,
                          net::HttpRequestHeaders* headers,
                          YouTubeRestrictMode mode) {}

}  // namespace safe_search_api