Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1550)

Unified Diff: components/doodle/doodle_service.cc

Issue 2794343002: Network traffic annotation added to image_data_fetcher. (Closed)
Patch Set: Comments addressed. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/search/thumbnail_source.cc ('k') | components/doodle/doodle_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/doodle/doodle_service.cc
diff --git a/components/doodle/doodle_service.cc b/components/doodle/doodle_service.cc
index 8e61a0e4d43545d48708285950d600efa9525267..ce3ab4d73a2ed69ddb6b9ebd49aff9f9624df1d3 100644
--- a/components/doodle/doodle_service.cc
+++ b/components/doodle/doodle_service.cc
@@ -17,6 +17,7 @@
#include "components/prefs/pref_registry.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "ui/gfx/image/image.h"
namespace doodle {
@@ -106,10 +107,34 @@ void DoodleService::GetImage(const ImageCallback& callback) {
bool has_cta = cached_config_->large_cta_image.has_value();
const GURL& image_url = has_cta ? cached_config_->large_cta_image->url
: cached_config_->large_image.url;
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("doodle_service", R"(
+ semantics {
+ sender: "Doodle Service"
+ description:
+ "Downloads the Doodle image if Google is the configured search "
+ "provider."
+ trigger: "Displaying the new tab page on Android."
+ data: "None."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "Choosing a non-Google search engine in Chromium settings under "
+ "'Search Engine' disables this feature."
+ chrome_policy {
+ DefaultSearchProviderEnabled {
+ policy_options {mode: MANDATORY}
+ DefaultSearchProviderEnabled: false
+ }
+ }
+ })");
image_fetcher_->StartOrQueueNetworkRequest(
image_url.spec(), image_url,
base::Bind(&DoodleService::ImageFetched, base::Unretained(this),
- callback));
+ callback),
+ traffic_annotation);
}
void DoodleService::AddObserver(Observer* observer) {
« no previous file with comments | « chrome/browser/search/thumbnail_source.cc ('k') | components/doodle/doodle_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698