Chromium Code Reviews| Index: components/translate/core/browser/translate_url_fetcher.cc |
| diff --git a/components/translate/core/browser/translate_url_fetcher.cc b/components/translate/core/browser/translate_url_fetcher.cc |
| index 45615e34af9d38d1f98fe5955699ab5f2090369b..5bb2cde82f527f4eb856f60cf64885e9d1a858ac 100644 |
| --- a/components/translate/core/browser/translate_url_fetcher.cc |
| +++ b/components/translate/core/browser/translate_url_fetcher.cc |
| @@ -8,6 +8,7 @@ |
| #include "components/translate/core/browser/translate_download_manager.h" |
| #include "net/base/load_flags.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" |
| @@ -46,7 +47,28 @@ bool TranslateURLFetcher::Request( |
| url_ = url; |
| callback_ = callback; |
| - fetcher_ = net::URLFetcher::Create(id_, url_, net::URLFetcher::GET, this); |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
|
Takashi Toyoshima
2017/04/10 09:18:58
rogerm: can you modify following my descriptions t
|
| + net::DefineNetworkTrafficAnnotation("...", R"( |
| + semantics { |
| + sender: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:57
sender: "translate"
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + description: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:58
description: "Chrome can provide a feature to tran
Ramin Halavati
2017/04/10 13:28:26
Done.
Roger McFarlane (Chromium)
2017/04/10 15:51:03
How about:
Chrome can provide translations for th
Takashi Toyoshima
2017/04/11 06:39:26
Thanks, Roger.
Ramin, can you update your patch s
Ramin Halavati
2017/04/11 06:57:29
Done.
|
| + trigger: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:57
trigger: "When Chrome translates a web site, it tr
Ramin Halavati
2017/04/11 06:57:29
Done.
|
| + data: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:57
data: "Translation library that is obtained via th
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER |
|
Takashi Toyoshima
2017/04/10 09:18:57
destination: GOOGLE_OWNED_SERVICE
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + } |
| + policy { |
| + cookies_allowed: false |
| + setting: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:58
setting: "chrome://settings/ Languages section has
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + chrome_policy { |
| + [POLICY_NAME] { |
| + policy_options {mode: MANDATORY/RECOMMENDED/UNSET} |
|
Takashi Toyoshima
2017/04/10 09:18:58
policy_options: RECOMMENDED (according to http://d
Ramin Halavati
2017/04/10 13:28:26
Thank you.
RECOMMENDED=true is the default case. H
Takashi Toyoshima
2017/04/11 06:39:26
Thank you for correction.
|
| + [POLICY_NAME]: ... //(value to disable it) |
|
Takashi Toyoshima
2017/04/10 09:18:58
POLICY_NAME is TranslateEnabled. I think disabling
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + } |
| + } |
| + policy_exception_justification: "..." |
|
Takashi Toyoshima
2017/04/10 09:18:57
n/a
Ramin Halavati
2017/04/10 13:28:26
Done.
|
| + })"); |
| + fetcher_ = net::URLFetcher::Create(id_, url_, net::URLFetcher::GET, this, |
| + traffic_annotation); |
| data_use_measurement::DataUseUserData::AttachToFetcher( |
| fetcher_.get(), data_use_measurement::DataUseUserData::TRANSLATE); |
| fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |