Chromium Code Reviews| 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..8c9095e26967ff68366efa4fddf1d4066f3fb490 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,52 @@ void ChromeOmniboxClient::OnResultChanged( |
| BitmapFetcherServiceFactory::GetForBrowserContext(profile_); |
| if (image_service) { |
| image_service->CancelRequest(request_id_); |
| + |
| + // If you cheange this, please also update annotation: |
| + DCHECK(...); |
|
Ramin Halavati
2017/02/15 11:52:03
Can we have a simple check here to ensure that Goo
Justin Donnelly
2017/02/15 21:39:44
We have no control over whether and when other Sug
Ramin Halavati
2017/02/16 07:03:30
Done.
|
| + |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
| + net::DefineNetworkTrafficAnnotation("omnibox_result_change", R"( |
| + semantics { |
| + sender: "Omnibox Suggest" |
| + description: |
| + "The Google Chrome provides answers in the suggestion list to " |
|
Justin Donnelly
2017/02/15 21:39:44
Remove "The".
Ramin Halavati
2017/02/16 07:03:30
Done.
|
| + "the queries you type in the omnibox. This request retrieves a " |
| + "small image (for example, an icon illustrating the current " |
| + "weather conditions) when this can add information to the " |
| + "answer." |
| + trigger: |
| + "Change of results for the query typed by the user in the " |
| + "omnibox." |
| + data: |
| + "The only data sent is the path to an image. No user data is " |
| + "included, although the general weather condition (sunny, " |
| + "rainy, etc.) in the user's current location could be inferred " |
| + "from the name of the image in the path." |
| + destination: GOOGLE_OWNED_SERVICE |
| + } |
| + policy { |
| + cookies_allowed: false |
| + cookies_store: "" |
| + setting: |
| + "You can enable or disable this feature via 'Use a prediction " |
| + "service to help complete searches and URLs typed in the " |
| + "address bar.' in Chrome's settings under Advanced. The " |
| + "feature is enabled by default." |
| + policy { |
| + SearchSuggestEnabled { |
| + policy_options {mode: MANDATORY} |
| + value: false |
| + } |
| + } |
| + })"); |
| + |
| 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); |
| } |
| } |
| } |