Chromium Code Reviews| Index: chrome/browser/safe_search_api/safe_search_url_checker.cc |
| diff --git a/chrome/browser/safe_search_api/safe_search_url_checker.cc b/chrome/browser/safe_search_api/safe_search_url_checker.cc |
| index 16dda018fcc8324bbc82d50720c0f966a51d859b..17fdafd56763d67b85beaad7564828aecb186014 100644 |
| --- a/chrome/browser/safe_search_api/safe_search_url_checker.cc |
| +++ b/chrome/browser/safe_search_api/safe_search_url_checker.cc |
| @@ -20,6 +20,7 @@ |
| #include "google_apis/google_api_keys.h" |
| #include "net/base/escape.h" |
| #include "net/base/load_flags.h" |
| +#include "net/traffic_annotation/network_traffic_annotation.h" |
| #include "net/url_request/url_fetcher.h" |
| #include "net/url_request/url_request_context.h" |
| #include "url/url_constants.h" |
| @@ -49,8 +50,29 @@ std::unique_ptr<net::URLFetcher> CreateFetcher(URLFetcherDelegate* delegate, |
| URLRequestContextGetter* context, |
| const std::string& api_key, |
| const GURL& url) { |
| - std::unique_ptr<net::URLFetcher> fetcher = |
| - URLFetcher::Create(0, GURL(kApiUrl), URLFetcher::POST, delegate); |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
| + net::DefineNetworkTrafficAnnotation("safe_search_api", R"( |
| + semantics { |
| + sender: "SafeSearch API" |
| + description: |
| + "Checks whether a given URL (or set of URLs) is considered safe by " |
| + "Google SafeSearch." |
| + trigger: |
| + "If the parent enabled this feature for the child account, this is " |
| + "sent for every navigation." |
| + data: "URL(s) to be checked." |
| + destination: GOOGLE_OWNED_SERVICE |
| + } |
| + policy { |
| + cookies_allowed: false |
| + setting: |
| + "This feature is only used in child accounts and cannot be " |
| + "disabled by settings. Parent accounts can disable it in " |
| + "Supervised Users dashboard." |
|
Marc Treib
2017/03/16 09:05:38
s/Supervised Users/the family/
("Supervised Users
Ramin Halavati
2017/03/16 12:28:07
Done.
|
| + policy_exception_justification: "Not implemented." |
| + })"); |
| + std::unique_ptr<net::URLFetcher> fetcher = URLFetcher::Create( |
| + 0, GURL(kApiUrl), URLFetcher::POST, delegate, traffic_annotation); |
| fetcher->SetUploadData(kDataContentType, BuildRequestData(api_key, url)); |
| fetcher->SetRequestContext(context); |
| fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |