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

Unified Diff: chrome/browser/ui/omnibox/chrome_omnibox_client.cc

Issue 2682263002: Network traffic annotation added to chrome::BitmapFetcher. (Closed)
Patch Set: Minor correction. Created 3 years, 10 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
Index: chrome/browser/ui/omnibox/chrome_omnibox_client.cc
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
index 3e12199b9ce6e01a39cd809637a45215c28636ef..f9e22ed7d033385d55709dff911bc3f9411dadd4 100644
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -48,6 +48,7 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
@@ -289,11 +290,32 @@ void ChromeOmniboxClient::OnResultChanged(
BitmapFetcherServiceFactory::GetForBrowserContext(profile_);
if (image_service) {
image_service->CancelRequest(request_id_);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("", R"(
+ semantics {
+ sender: ""
Justin Donnelly 2017/02/14 17:01:05 suggest (Alternatively, "omnibox" if a more genera
Ramin Halavati 2017/02/15 11:52:03 Done.
+ description: ""
Justin Donnelly 2017/02/14 17:01:05 Google Chrome provides answers in the suggestion l
Ramin Halavati 2017/02/15 11:52:03 Done.
+ trigger: ""
Justin Donnelly 2017/02/14 17:01:05 Query typed by the user in the omnibox.
Ramin Halavati 2017/02/15 11:52:03 Done.
+ data: ""
Justin Donnelly 2017/02/14 17:01:05 The only data sent is the path to an image. No use
Ramin Halavati 2017/02/15 11:52:03 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
Justin Donnelly 2017/02/14 17:01:05 Yeah, this is a tough one. Currently, no search en
Ramin Halavati 2017/02/15 11:52:03 Can we add a DCHECK to insure that Google owned se
Justin Donnelly 2017/02/15 21:39:44 Response in other comment.
Ramin Halavati 2017/02/16 07:03:30 Done.
+ }
+ policy {
+ cookies_allowed: false/true
Justin Donnelly 2017/02/14 17:01:05 false (requests are to ssl.gstatic.com)
Ramin Halavati 2017/02/15 11:52:03 I wonder as the default URLFetcher allows to send
Justin Donnelly 2017/02/15 21:39:44 Yeah, if the annotation is meant to be a descripti
Ramin Halavati 2017/02/16 07:03:30 Done.
+ cookies_store: ""
+ setting: ""
Justin Donnelly 2017/02/14 17:01:05 Disable ‘Use a prediction service to help complete
Ramin Halavati 2017/02/15 11:52:03 Done.
+ policy {
+ [POLICY_NAME] {
Justin Donnelly 2017/02/14 17:01:05 SearchSuggestEnabled
Ramin Halavati 2017/02/15 11:52:03 Done.
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
Justin Donnelly 2017/02/14 17:01:05 I'm honestly not sure. I see that there's a Cloud
Ramin Halavati 2017/02/15 11:52:03 It seems that selecting false value for this will
Justin Donnelly 2017/02/15 21:39:44 Cool, thanks for the reference, that's helpful.
Ramin Halavati 2017/02/16 07:03:30 Done.
+ value: ...
+ }
+ }
+ })");
request_id_ = image_service->RequestImage(
match->answer->second_line().image_url(),
new AnswerImageObserver(
base::Bind(&ChromeOmniboxClient::OnBitmapFetched,
- base::Unretained(this), on_bitmap_fetched)));
+ base::Unretained(this), on_bitmap_fetched)),
+ traffic_annotation);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698