Commit 7ba9103e authored by rhalavati's avatar rhalavati Committed by Commit bot

Network traffic annotation added to one_google_bar.

Network traffic annotation is added to network request of:
chrome/browser/search/one_google_bar/one_google_bar_fetcher_impl.cc

BUG=656607

Review-Url: https://codereview.chromium.org/2900673002
Cr-Commit-Position: refs/heads/master@{#473860}
parent 17d6248c
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "google_apis/google_api_keys.h" #include "google_apis/google_api_keys.h"
#include "net/base/load_flags.h" #include "net/base/load_flags.h"
#include "net/http/http_status_code.h" #include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_fetcher_delegate.h"
...@@ -268,7 +269,31 @@ void OneGoogleBarFetcherImpl::AuthenticatedURLFetcher::GotAccessToken( ...@@ -268,7 +269,31 @@ void OneGoogleBarFetcherImpl::AuthenticatedURLFetcher::GotAccessToken(
bool use_oauth = !access_token.empty(); bool use_oauth = !access_token.empty();
GURL url = GetApiUrl(use_oauth); GURL url = GetApiUrl(use_oauth);
url_fetcher_ = net::URLFetcher::Create(0, url, net::URLFetcher::POST, this); net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("one_google_bar_service", R"(
semantics {
sender: "One Google Bar Service"
description: "Downloads the 'One Google' bar."
trigger:
"Displaying the new tab page on Desktop, if Google is the "
"configured search provider."
data: "Credentials if user is signed in."
destination: GOOGLE_OWNED_SERVICE
}
policy {
cookies_allowed: false
setting:
"Users can control this feature via selecting a non-Google default "
"search engine in Chrome settings under 'Search Engine'."
chrome_policy {
DefaultSearchProviderEnabled {
policy_options {mode: MANDATORY}
DefaultSearchProviderEnabled: false
}
}
})");
url_fetcher_ = net::URLFetcher::Create(0, url, net::URLFetcher::POST, this,
traffic_annotation);
url_fetcher_->SetRequestContext(request_context_); url_fetcher_->SetRequestContext(request_context_);
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_AUTH_DATA | url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_AUTH_DATA |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment