Chromium Code Reviews| Index: chrome/browser/search/thumbnail_source.cc |
| diff --git a/chrome/browser/search/thumbnail_source.cc b/chrome/browser/search/thumbnail_source.cc |
| index 95bfd6a20304832514dab7b46a89b776bc0adfb6..9fc5bea4a4b52290c64f68dae6a57e38164b5e3b 100644 |
| --- a/chrome/browser/search/thumbnail_source.cc |
| +++ b/chrome/browser/search/thumbnail_source.cc |
| @@ -11,6 +11,7 @@ |
| #include "chrome/browser/thumbnails/thumbnail_service.h" |
| #include "chrome/browser/thumbnails/thumbnail_service_factory.h" |
| #include "chrome/common/url_constants.h" |
| +#include "net/traffic_annotation/network_traffic_annotation.h" |
| #include "net/url_request/url_request.h" |
| #include "url/gurl.h" |
| @@ -47,12 +48,45 @@ void ThumbnailSource::StartDataRequest( |
| // If a local thumbnail is available for the page's URL, provide it. |
| callback.Run(data.get()); |
| } else if (fallback_thumbnail_url.is_valid()) { |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
| + net::DefineNetworkTrafficAnnotation("thumbnail_source", R"( |
| + semantics { |
| + sender: "Thumbnail Source" |
| + description: |
| + "Retrieves thumbnails for site suggestions based on the user's " |
| + "synced browsing history, for use e.g. on the New Tab page." |
| + trigger: |
| + "Triggered when a thumbnail for a suggestion is required (e.g. on " |
| + "the New Tab page), and no local thumbnail is available." |
| + data: "The URL for which to retrieve a thumbnail." |
| + destination: GOOGLE_OWNED_SERVICE |
| + } |
| + policy { |
| + cookies_allowed: false |
| + setting: |
| + "Users can disable this feature by signing out of Chrome, or " |
| + "disabling Sync or History Sync in Chrome settings under 'Advanced " |
| + "sync settings...'. The feature is enabled by default." |
| + chrome_policy { |
| + SyncDisabled { |
| + policy_options {mode: MANDATORY} |
| + SyncDisabled: true |
| + } |
| + } |
| + chrome_policy { |
|
Marc Treib
2017/05/09 13:40:36
nit: Misaligned? (I think SyncDisabled above is in
Ramin Halavati
2017/05/09 13:57:49
Done.
|
| + SigninAllowed { |
| + policy_options {mode: MANDATORY} |
| + SigninAllowed: false |
| + } |
| + } |
| + })"); |
| // Otherwise, if a fallback thumbnail URL was provided, fetch it and |
| // eventually return it. |
| image_data_fetcher_.FetchImageData( |
| fallback_thumbnail_url, |
| base::Bind(&ThumbnailSource::SendFetchedUrlImage, |
| - weak_ptr_factory_.GetWeakPtr(), callback)); |
| + weak_ptr_factory_.GetWeakPtr(), callback), |
| + traffic_annotation); |
| } else { |
| callback.Run(nullptr); |
| } |