Chromium Code Reviews| Index: components/dom_distiller/core/distiller_url_fetcher.cc |
| diff --git a/components/dom_distiller/core/distiller_url_fetcher.cc b/components/dom_distiller/core/distiller_url_fetcher.cc |
| index 752c7ad77ae76b3b4f50a5448d7f18768ec4a225..9fe864e065c0b013aabd0b5f80e5d8faffc7615d 100644 |
| --- a/components/dom_distiller/core/distiller_url_fetcher.cc |
| +++ b/components/dom_distiller/core/distiller_url_fetcher.cc |
| @@ -6,6 +6,7 @@ |
| #include "components/data_use_measurement/core/data_use_user_data.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_delegate.h" |
| #include "net/url_request/url_request_context_getter.h" |
| @@ -47,8 +48,39 @@ void DistillerURLFetcher::FetchURL(const std::string& url, |
| std::unique_ptr<URLFetcher> DistillerURLFetcher::CreateURLFetcher( |
| net::URLRequestContextGetter* context_getter, |
| const std::string& url) { |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
| + net::DefineNetworkTrafficAnnotation("dom_distiller", R"( |
| + semantics { |
| + sender: "DOM Distiller" |
| + description: |
| + "Chromium provides Mobile-friendly view on Android and iOS phones " |
|
wychen
2017/02/24 18:22:10
"Chromium provides Mobile-friendly view on Android
Ramin Halavati
2017/02/27 10:13:16
Done.
|
| + "when the web page contains an article, and is not " |
| + "mobile-friendly. If the user enters Mobile-friendly view, the " |
| + "main content would be extracted and reflowed for better " |
| + "readability. DOM distiller is the backend service for " |
| + "Mobile-friendly view, Reader Mode, and Reading List." |
| + trigger: |
| + "On Android phones, when the user enters Mobile-friendly view, " |
|
wychen
2017/02/24 18:22:10
I guess the lack of feature parity between Android
Ramin Halavati
2017/02/27 10:13:16
Done.
|
| + "Reader Mode, or Reading List. On iOS it is called in the " |
| + "background as soon as the user has an entry on the reading list " |
| + "and the entry can be added from another app." |
| + data: |
| + "URL of the required website resources to fetch. No user " |
| + "information is sent." |
| + destination: WEBSITE |
| + } |
| + policy { |
| + cookies_allowed: true |
| + cookies_store: "user" |
| + setting: "Users can enable or disable Mobile-friendly view by " |
| + "toggling chrome://flags#reader-mode-heuristics in Chromium on " |
| + "Android." |
| + policy_exception_justification: |
| + "Not implemented, considered not useful as no content is being " |
| + "uploaded; this request merely downloads the resources on the web." |
| + })"); |
| std::unique_ptr<net::URLFetcher> fetcher = |
| - URLFetcher::Create(GURL(url), URLFetcher::GET, this); |
| + URLFetcher::Create(GURL(url), URLFetcher::GET, this, traffic_annotation); |
| data_use_measurement::DataUseUserData::AttachToFetcher( |
| fetcher.get(), data_use_measurement::DataUseUserData::DOM_DISTILLER); |
| fetcher->SetRequestContext(context_getter); |