Index: chrome/browser/search/thumbnail_source.cc |
diff --git a/chrome/browser/search/thumbnail_source.cc b/chrome/browser/search/thumbnail_source.cc |
index 2331ee0b1adbc68c205a50ceb56026989c16ac7a..277edff2587bd706eeb4f6c7a3d652e4230c4bf8 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 { |
+ 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); |
} |