Index: chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc |
diff --git a/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc b/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc |
index f887bb5ca9697af7709a4d452c8b91ef3a4af18b..e08fd9623854ab8808fe460a07ac4a4b67c57032 100644 |
--- a/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc |
+++ b/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc |
@@ -25,6 +25,7 @@ |
#include "net/base/load_flags.h" |
#include "net/base/net_errors.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_request_status.h" |
#include "url/gurl.h" |
@@ -182,8 +183,35 @@ void PermissionRequestCreatorApiary::OnGetTokenSuccess( |
DCHECK(it != requests_.end()); |
(*it)->access_token = access_token; |
- (*it)->url_fetcher = URLFetcher::Create((*it)->url_fetcher_id, GetApiUrl(), |
- URLFetcher::POST, this); |
+ net::NetworkTrafficAnnotationTag traffic_annotation = |
+ net::DefineNetworkTrafficAnnotation("permission_request_creator", R"( |
+ semantics { |
+ sender: "Supervised Users" |
+ description: |
+ "Requests permission for the user to access a blocked site." |
+ trigger: "Initiated by the user." |
+ data: |
+ "The request is authenticated with an OAuth2 access token " |
+ "identifying the Google account and contains the URL that the user " |
+ "requests access to." |
+ destination: GOOGLE_OWNED_SERVICE |
+ } |
+ policy { |
+ cookies_allowed: false |
+ setting: |
+ "This feature cannot be disabled in settings and is only enabled " |
+ "for child accounts. If sign-in is restricted to accounts from a " |
+ "managed domain, those accounts are not going to be child accounts." |
+ chrome_policy { |
+ RestrictSigninToPattern { |
+ policy_options {mode: MANDATORY} |
+ RestrictSigninToPattern: "*@manageddomain.com" |
+ } |
+ } |
+ })"); |
+ (*it)->url_fetcher = |
+ URLFetcher::Create((*it)->url_fetcher_id, GetApiUrl(), URLFetcher::POST, |
+ this, traffic_annotation); |
data_use_measurement::DataUseUserData::AttachToFetcher( |
(*it)->url_fetcher.get(), |